netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 6/6] net: phy: Stop 'phy-state-machine' and 'phy_change' work on remove
@ 2015-10-27 14:49 Neil Armstrong
  2015-10-27 15:40 ` Florian Fainelli
  0 siblings, 1 reply; 5+ messages in thread
From: Neil Armstrong @ 2015-10-27 14:49 UTC (permalink / raw)
  To: David S. Miller
  Cc: Andrew Lunn, Florian Fainelli, Guenter Roeck, vivien.didelot,
	Fabian Frederick, Pavel Nakonechny, Joe Perches, netdev,
	linux-kernel, Frode Isaksen

Avoids:
 Unable to handle kernel NULL pointer dereference at virtual address 00000064
 Workqueue: events_power_efficient phy_state_machine
 PC is at phy_state_machine+0x28/0x480

Signed-off-by: Frode Isaksen <fisaksen@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/net/phy/phy_device.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 3833891..b5b6c1b 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1348,6 +1348,12 @@ static int phy_remove(struct device *dev)
 	phydev->state = PHY_DOWN;
 	mutex_unlock(&phydev->lock);

+	cancel_delayed_work_sync(&phydev->state_queue);
+	flush_delayed_work(&phydev->state_queue);
+
+	cancel_work_sync(&phydev->phy_queue);
+	flush_work(&phydev->phy_queue);
+
 	if (phydev->drv->remove)
 		phydev->drv->remove(phydev);
 	phydev->drv = NULL;
-- 
1.9.1

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

end of thread, other threads:[~2015-10-28 13:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-27 14:49 [PATCH 6/6] net: phy: Stop 'phy-state-machine' and 'phy_change' work on remove Neil Armstrong
2015-10-27 15:40 ` Florian Fainelli
     [not found]   ` <CAJ03sU_+nkvN1ZeqvWx56B7cb9GDCbpTFn6gJp2OmW-CKi7QFA@mail.gmail.com>
2015-10-27 15:57     ` Florian Fainelli
2015-10-27 21:20       ` Andrew Lunn
     [not found]         ` <CAJ03sU9Uw9SLXGpH9wqm+GWJtFZvcSuW=YCTZseSanpNeF_+Sw@mail.gmail.com>
2015-10-28 13:54           ` Neil Armstrong

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).