Bug 80751
Summary: | ethernet driver et131x oops on hotplug insert | ||
---|---|---|---|
Product: | Drivers | Reporter: | Mark Einon (mark.einon) |
Component: | Staging | Assignee: | drivers_staging (drivers_staging) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | ||
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 3.15.0-rc6+ | Subsystem: | |
Regression: | No | Bisected commit-id: |
Description
Mark Einon
2014-07-20 19:21:05 UTC
Bisected to (original addition), log: commit 1211ce53077164e0d34641d0ca5fb4d4a7574498 Author: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Date: Fri Dec 13 10:20:28 2013 +0100 net: phy: resume/suspend PHYs on attach/detach This ensures PHYs are resumed on attach and suspended on detach. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Acked-by: Mugunthan V N <mugunthanvnm@ti.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> and line: @@ -624,6 +624,8 @@ static int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, if (err) phy_detach(phydev); + phy_resume(phydev); + return err; N.B, Line has subsequently been modified by: commit b394745df2d9d4c30bf1bcc55773bec6f3bc7c67 Author: Guenter Roeck <linux@roeck-us.net> Date: Wed May 14 13:12:49 2014 -0700 net: phy: Don't call phy_resume if phy_init_hw failed *** This bug has been marked as a duplicate of bug 77121 *** The call stack is almost identical to Bug 77121, but as the architecture is different (x86_64 / x86) and the last call differs, reopening this bug until we're sure they are the same. The crash has been fixed by commit b394745df2d9, but the cause (presumably phy_init_hw() failing) is still an issue. ------------ commit b394745df2d9d4c30bf1bcc55773bec6f3bc7c67 Author: Guenter Roeck <linux@roeck-us.net> Date: Wed May 14 13:12:49 2014 -0700 net: phy: Don't call phy_resume if phy_init_hw failed After the call to phy_init_hw failed in phy_attach_direct, phy_detach is called to detach the phy device from its network device. If the attached driver is a generic phy driver, this also detaches the driver. Subsequently phy_resume is called, which assumes without checking that a driver is attached to the device. This will result in a crash such as Unable to handle kernel paging request for data at address 0xffffffffffffff90 Faulting instruction address: 0xc0000000003a0e18 Oops: Kernel access of bad area, sig: 11 [#1] ... NIP [c0000000003a0e18] .phy_attach_direct+0x68/0x17c LR [c0000000003a0e6c] .phy_attach_direct+0xbc/0x17c Call Trace: [c0000003fc0475d0] [c0000000003a0e6c] .phy_attach_direct+0xbc/0x17c (unreliable) [c0000003fc047670] [c0000000003a0ff8] .phy_connect_direct+0x28/0x98 [c0000003fc047700] [c0000000003f0074] .of_phy_connect+0x4c/0xa4 Only call phy_resume if phy_init_hw was successful. phy_init_hw() fails because a call to phy_init_hw() results in a call to et131x_mii_write() When adapter->phydev is accessed in this function, phydev is null. This adapter->phydev is only set at the end of et131x_mii_probe(), whereas the call to phy_connect() is at the beginning. This is similar to other drivers using a phy device (stmmac for example), so I'm initially suspecting the use of the adapter->phydev pointer in et131x_mii_write() may not be usual. Fix patch posted at http://marc.info/?l=linux-netdev&m=140727945201126&w=2 |