* [PATCH] mmc: sdio: fix runtime PM path during driver removal
@ 2011-06-09 23:40 Ohad Ben-Cohen
[not found] ` <1307662827-16618-1-git-send-email-ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Ohad Ben-Cohen @ 2011-06-09 23:40 UTC (permalink / raw)
To: linux-mmc-u79uwXL29TY76Z2rM5mHXA
Cc: Chris Ball, linux-wireless-u79uwXL29TY76Z2rM5mHXA, Ohad Ben-Cohen
After commit e1866b3 "PM / Runtime: Rework runtime PM handling
during driver removal" was introduced, the driver core stopped
incrementing the runtime PM usage counter of the device during
the invocation of the ->remove() callback.
This indirectly broke SDIO's runtime PM path during driver removal,
because no one calls _put_sync() anymore after ->remove() completes.
This means that the power of runtime-PM-managed SDIO cards is kept
high after their driver is removed (even if it was powered down
beforehand).
Fix that by directly calling _put_sync() when the last usage
counter is downref'ed by the SDIO bus.
Reported-and-tested-by: Daniel Drake <dsd-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org>
Signed-off-by: Ohad Ben-Cohen <ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
---
drivers/mmc/core/sdio_bus.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c
index d29b9c3..d2565df 100644
--- a/drivers/mmc/core/sdio_bus.c
+++ b/drivers/mmc/core/sdio_bus.c
@@ -189,7 +189,7 @@ static int sdio_bus_remove(struct device *dev)
/* Then undo the runtime PM settings in sdio_bus_probe() */
if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD)
- pm_runtime_put_noidle(dev);
+ pm_runtime_put_sync(dev);
out:
return ret;
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <1307662827-16618-1-git-send-email-ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] mmc: sdio: fix runtime PM path during driver removal [not found] ` <1307662827-16618-1-git-send-email-ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org> @ 2011-06-26 11:50 ` Ohad Ben-Cohen [not found] ` <BANLkTi=JcXG04coTJCA=fvwxXzuRsYzT4Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Ohad Ben-Cohen @ 2011-06-26 11:50 UTC (permalink / raw) To: linux-mmc-u79uwXL29TY76Z2rM5mHXA, Chris Ball Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA Hi Chris, On Fri, Jun 10, 2011 at 2:40 AM, Ohad Ben-Cohen <ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org> wrote: > After commit e1866b3 "PM / Runtime: Rework runtime PM handling > during driver removal" was introduced, the driver core stopped > incrementing the runtime PM usage counter of the device during > the invocation of the ->remove() callback. > > This indirectly broke SDIO's runtime PM path during driver removal, > because no one calls _put_sync() anymore after ->remove() completes. > > This means that the power of runtime-PM-managed SDIO cards is kept > high after their driver is removed (even if it was powered down > beforehand). > > Fix that by directly calling _put_sync() when the last usage > counter is downref'ed by the SDIO bus. Can you please take this 1-liner into 3.0-rc ? It fixes SDIO runtime PM after a breakage was introduced in 3.0. Thanks, Ohad. -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <BANLkTi=JcXG04coTJCA=fvwxXzuRsYzT4Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] mmc: sdio: fix runtime PM path during driver removal [not found] ` <BANLkTi=JcXG04coTJCA=fvwxXzuRsYzT4Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2011-06-26 15:09 ` Chris Ball 0 siblings, 0 replies; 3+ messages in thread From: Chris Ball @ 2011-06-26 15:09 UTC (permalink / raw) To: Ohad Ben-Cohen Cc: linux-mmc-u79uwXL29TY76Z2rM5mHXA, linux-wireless-u79uwXL29TY76Z2rM5mHXA Hi Ohad, On Sun, Jun 26 2011, Ohad Ben-Cohen wrote: > On Fri, Jun 10, 2011 at 2:40 AM, Ohad Ben-Cohen <ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org> wrote: >> After commit e1866b3 "PM / Runtime: Rework runtime PM handling >> during driver removal" was introduced, the driver core stopped >> incrementing the runtime PM usage counter of the device during >> the invocation of the ->remove() callback. >> >> This indirectly broke SDIO's runtime PM path during driver removal, >> because no one calls _put_sync() anymore after ->remove() completes. >> >> This means that the power of runtime-PM-managed SDIO cards is kept >> high after their driver is removed (even if it was powered down >> beforehand). >> >> Fix that by directly calling _put_sync() when the last usage >> counter is downref'ed by the SDIO bus. > > Can you please take this 1-liner into 3.0-rc ? > > It fixes SDIO runtime PM after a breakage was introduced in 3.0. Merged, thanks. I'll be sending a pull request on my for-linus branch shortly: http://git.kernel.org/?p=linux/kernel/git/cjb/mmc.git;a=shortlog;h=refs/heads/for-linus - Chris. -- Chris Ball <cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org> <http://printf.net/> One Laptop Per Child -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-06-26 15:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-09 23:40 [PATCH] mmc: sdio: fix runtime PM path during driver removal Ohad Ben-Cohen
[not found] ` <1307662827-16618-1-git-send-email-ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
2011-06-26 11:50 ` Ohad Ben-Cohen
[not found] ` <BANLkTi=JcXG04coTJCA=fvwxXzuRsYzT4Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-06-26 15:09 ` Chris Ball
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox