netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: fec: fix initial runtime PM refcount
@ 2015-08-03 15:50 Lucas Stach
  2015-08-03 16:15 ` Andrew Lunn
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Lucas Stach @ 2015-08-03 15:50 UTC (permalink / raw)
  To: David S. Miller
  Cc: Andrew Lunn, Uwe Kleine-König, netdev, kernel, patchwork-lst

The clocks are initially active and thus the device is marked active.
This still keeps the PM refcount at 0, the pm_runtime_put_autosuspend()
call at the end of probe then leaves us with an invalid refcount of -1,
which in turn leads to the device staying in suspended state even though
netdev open had been called.

Fix this by initializing the refcount to be coherent with the initial
device status.

Fixes:
8fff755e9f8 (net: fec: Ensure clocks are enabled while using mdio bus)

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
Please apply this as a fix for 4.2
---
 drivers/net/ethernet/freescale/fec_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 32e3807c650e..271bb5862346 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -3433,6 +3433,7 @@ fec_probe(struct platform_device *pdev)
 
 	pm_runtime_set_autosuspend_delay(&pdev->dev, FEC_MDIO_PM_TIMEOUT);
 	pm_runtime_use_autosuspend(&pdev->dev);
+	pm_runtime_get_noresume(&pdev->dev);
 	pm_runtime_set_active(&pdev->dev);
 	pm_runtime_enable(&pdev->dev);
 
-- 
2.1.4

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

end of thread, other threads:[~2015-08-07  1:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-03 15:50 [PATCH] net: fec: fix initial runtime PM refcount Lucas Stach
2015-08-03 16:15 ` Andrew Lunn
2015-08-03 18:05   ` Uwe Kleine-König
2015-08-03 18:28     ` Alan Stern
2015-08-04  7:43       ` Lucas Stach
2015-08-04 14:20         ` Alan Stern
2015-08-04 14:35           ` Uwe Kleine-König
2015-08-04 15:59             ` Alan Stern
2015-08-04  7:34   ` Lucas Stach
2015-08-04  5:23 ` David Miller
2015-08-04  8:11 ` Uwe Kleine-König
2015-08-05  8:49 ` [PATCH net-master v2] " Uwe Kleine-König
2015-08-07  1:54 ` [PATCH] " David Miller

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