Skip to content

Commit

Permalink
mmc: sdio: Add empty bus-level suspend/resume callbacks
Browse files Browse the repository at this point in the history
Suspend methods provided by SDIO drivers are not supposed to be called by
the PM core.  Instead, when the SDIO core gets to suspend a device's
ancestor, it calls the device driver's suspend routine.  However, the PM
core executes suspend callback routines directly for device drivers whose
bus types don't provide suspend callbacks.  In consequece, because the
SDIO bus type doesn't provide a suspend callback, the SDIO drivers'
suspend routines will be executed by the PM core (which shouldn't
happen).

To prevent this from happening, add empty system suspend/resume callbacks
for the SDIO bus type.

An analogous change had been made already by commit (e841a7c mmc: sdio:
Use empty system suspend/resume callbacks at the bus level), but then it
was reverted inadvertently by commit (d8e2ac3 mmc: sdio: Fix PM_SLEEP
related build warnings) that attempted to fix build warnings introduced
by commit e841a7c.

Reported-by: NeilBrown <neilb@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Rafael J. Wysocki authored and Chris Ball committed Dec 6, 2012
1 parent 063f96c commit b0afd8f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/mmc/core/sdio_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,21 @@ static int sdio_bus_remove(struct device *dev)
}

#ifdef CONFIG_PM

#ifdef CONFIG_PM_SLEEP
static int pm_no_operation(struct device *dev)
{
/*
* Prevent the PM core from calling SDIO device drivers' suspend
* callback routines, which it is not supposed to do, by using this
* empty function as the bus type suspend callaback for SDIO.
*/
return 0;
}
#endif

static const struct dev_pm_ops sdio_bus_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(pm_no_operation, pm_no_operation)
SET_RUNTIME_PM_OPS(
pm_generic_runtime_suspend,
pm_generic_runtime_resume,
Expand Down

0 comments on commit b0afd8f

Please sign in to comment.