]> git.karo-electronics.de Git - karo-tx-linux.git/commit
tg3: Only allow phy ioctls while netif_running
authorMatt Carlson <mcarlson@broadcom.com>
Wed, 20 Apr 2011 07:57:38 +0000 (07:57 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Apr 2011 00:05:56 +0000 (17:05 -0700)
commit34eea5ac214353ccd93ef7dd8dbd10aed87f5f46
tree73c13f9fc49f7c7a0ef517adca25c847dc214d44
parent4a85f09831329bc5a5e4b9bca3f3ecbffb78f858
tg3: Only allow phy ioctls while netif_running

When tg3 was new, phy accesses through ioctl were allowable at any time.
Then, the driver started shutting down the phy when the device was
closed.  Phy accesses would be allowed when the driver first attached to
the device, but then would be forbidden after the device had been up'd
and down'd.  After that, management firmware made it illegal to access
the phy unless the driver "owned" the device.  Now that most firmware
is being moved over to the APE, it is less clear when phy accesses are
safe.

While it is possible to attempt to identify these conditions and code
the driver to navigate through the pitfalls, it could be perplexing to
the admin why phy accesses work in some cases and not others.  This
patch brings some uniformity to the problem by only allowing phy
accesses while the driver has control of the device.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tg3.c