Skip to content

Commit

Permalink
mmc: sdio: fix runtime PM path during driver removal
Browse files Browse the repository at this point in the history
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@laptop.org>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Ohad Ben-Cohen authored and Chris Ball committed Jun 25, 2011
1 parent be98ca6 commit 297c7f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mmc/core/sdio_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 297c7f2

Please sign in to comment.