[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1438764564-15321-1-git-send-email-u.kleine-koenig@pengutronix.de>
Date: Wed, 5 Aug 2015 10:49:24 +0200
From: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
To: David Miller <davem@...emloft.net>
Cc: Andrew Lunn <andrew@...n.ch>, netdev@...r.kernel.org,
kernel@...gutronix.de, Lucas Stach <l.stach@...gutronix.de>,
Alan Stern <stern@...land.harvard.edu>
Subject: [PATCH net-master v2] net: fec: fix initial runtime PM refcount
From: Lucas Stach <l.stach@...gutronix.de>
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@...gutronix.de>
Acked-by: Alan Stern <stern@...land.harvard.edu>
Tested-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
---
Hello David,
I think this is fine to apply now for 4.2-rc. I just picked up the
patch, added Alan's ack and a tested-by for me to make it easier for
you.
Best regards
Uwe
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.4.6
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists