netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Need help with mdiobus_register and phy
@ 2016-10-13 23:15 Timur Tabi
  2016-10-14  4:06 ` Andrew Lunn
  0 siblings, 1 reply; 27+ messages in thread
From: Timur Tabi @ 2016-10-13 23:15 UTC (permalink / raw)
  To: netdev

I need help with a program I've discovered with my driver 
(ethernet/qualcomm/emac/) that occurs in the following process:

1. Load the driver
1a. Driver calls mdiobus_register (see emac_phy_config), which calls 
mdiobus_scan(), which calls get_phy_device()
1b. get_phy_device() performs MDIO bus operations, which means the bus 
and the external phy need to be active.
2. Bring up the interface
3. Bring down the interface.  This calls phy_disconnect() which calls 
phy_detach() which calls phy_suspend().  This puts the external phy to 
sleep.
4. Unload the driver
5. Re-load the driver.
5a. Driver calls mdiobus_register again, but this time the call to 
get_phy_device() fails because the external phy is asleep and does not 
respond to MDIO transactions.

I don't know what my driver is doing wrong.  I'm concerned that 
mdiobus_register() is causing MDIO transactions to occur before the rest 
of the EMAC has a chance to initialize.  I've examined many other 
drivers, and I think I'm initializing things in the proper order.

The call to mdiobus_register() occurs before I know what phydev is. 
Since I need the phydev in order to talk to the phy driver, I don't see 
how I can "wake up" the external phy before calling mdiobus_register().

-- 
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc.  Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2016-10-21 11:19 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-13 23:15 Need help with mdiobus_register and phy Timur Tabi
2016-10-14  4:06 ` Andrew Lunn
2016-10-14 11:38   ` Timur Tabi
2016-10-14 12:06     ` Andrew Lunn
2016-10-14 12:39       ` Timur Tabi
2016-10-14 12:49         ` Andrew Lunn
2016-10-14 12:49           ` Timur Tabi
2016-10-14 12:57             ` Andrew Lunn
2016-10-14 13:03               ` Timur Tabi
2016-10-14 13:18                 ` Andrew Lunn
2016-10-14 13:28                   ` Timur Tabi
2016-10-14 16:57                   ` Timur Tabi
2016-10-14 17:25                     ` Andrew Lunn
2016-10-14 18:30                       ` Timur Tabi
2016-10-15 10:19                       ` Florian Fainelli
2016-10-15 14:39                         ` Timur Tabi
2016-10-15 18:02                           ` Andrew Lunn
2016-10-15 18:28                             ` Timur Tabi
2016-10-17  9:05                               ` Zefir Kurtisi
2016-10-17 20:53                                 ` Timur Tabi
2016-10-18 10:31                                   ` Zefir Kurtisi
2016-10-18 12:40                                     ` Timur Tabi
2016-10-19  8:55                                       ` Zefir Kurtisi
2016-10-19 12:16                                         ` Timur Tabi
2016-10-20 12:55                                           ` Zefir Kurtisi
2016-10-21  7:44                                             ` Zefir Kurtisi
2016-10-21 11:19                                               ` Timur Tabi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).