Description of problem: the tg3 driver does not allow the use of ethtool until the open method has been called on the driver. The use of any ethtool ioctls is gated in all versions of the driver by the TG3_FLAG_INIT_COMPLETE flag. This flag: a) I not initalized during module initalization (it probably should be) - we seem to be getting lucky and reading it as zero in the return from alloc_etherdev b) Set at the end of tg3_open c) Cleared at the start of tg3_close (a) is pretty clearly a bug (b) and (c) seem reasonable, but they imply that anytime an interface owned by this driver is closed, or not explicitly opened, any call to tg3_ethtool_ioctl (or the successor funtions in later versions of the driver), will return -EAGAIN. I've poked about, and it appears that all of the data which is manipulated by the ethtool ioctls is set during pci probing in the module initalization code, so I would guess that it would be safe to just remove the check for TG3_FLAG_INIT_COMPLETE in the ioctl functions. However, I don't know if thats a safe assumption in the long term. Version-Release number of selected component (if applicable): all driver versions How reproducible: Always Steps to Reproduce: 1.Boot a linux system containing a NIC managed by the tg3 driver. Ensure that it is not activated at boot time. 2.run "ethtool speed 1000 duplex full" on the interface while it is down Actual results: ioctl call to tg3 drvier will return -EAGAIN Expected results: ioctl call will change tg3 driver settings to force 1000f Additional info: Opened in response to issuetracker #27010
This is expected behavior. For the flag, TG3_FLAG_INIT_COMPLETE is only set when initialization is complete. This only occurs after tg3_open() finishes. However, that has nothing to do with the issue described in the summary -- tg3 requires the interface to be up, to use ethtool. This is because the hardware is shut down, when the interface is downed.