]> git.baikalelectronics.ru Git - kernel.git/commit
net: bcmgenet: request and enable main clock earlier
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 11 Aug 2014 21:50:42 +0000 (14:50 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 11 Aug 2014 22:10:11 +0000 (15:10 -0700)
commit99933fc26bea0aaeb78b2a4fa658647beb9b6124
tree96ec0dcda6a0bb9535bc5a13bdb55ddb229be97e
parent1fc532498031fb51ab2b93c9085d0a342a1cb7cb
net: bcmgenet: request and enable main clock earlier

bcmgenet_set_hw_params() will read the hardware version and compare it
with the one we are getting from Device Tree. Due to the clock being
enabled too late, bcmgenet_set_hw_params() will cause bus errors since
the GENET hardware block is still gated off by the time
bcmgenet_set_hw_params() is called, this will also make us fail the
version check since we will read the value 0 from the hardware.

Fix this by requesting the clock before the first piece of code that
needs to access hardware register.

Fixes: 83c070ed8c89b ("net: bcmgenet: add main driver file")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmgenet.c