]> git.baikalelectronics.ru Git - kernel.git/commit
net: bcmgenet: disable clock before register_netdev
authorFlorian Fainelli <f.fainelli@gmail.com>
Thu, 26 Jun 2014 17:26:20 +0000 (10:26 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Jul 2014 00:25:02 +0000 (17:25 -0700)
commit6717aad80a5a0b37a89239fd640cde0cd791f29d
tree3528808aef384c8c63420ca544d1944c915d0473
parent4af23a53e02f6d46d07ca4a0ccbac12df0026d48
net: bcmgenet: disable clock before register_netdev

As soon as register_netdev() is called, the network device notifiers are
running which means that other parts of the kernel, or user-space
programs can call the network device ndo_open() callback and use the
interface.

Disable the Ethernet device clock before we register the network device
such that we do not create the following situation:

CPU0 CPU1
register_netdev()
bcmgenet_open()
clk_prepare_enable()
clk_disable_unprepare()

and leave the hardware block gated off, while we think it should be
gated on.

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