mmc: Don't force card to active state when entering suspend/shutdown
authorUlf Hansson <ulf.hansson@linaro.org>
Wed, 2 Oct 2013 15:37:09 +0000 (17:37 +0200)
committerlintao <lintao@rock-chips.com>
Fri, 7 Mar 2014 12:05:12 +0000 (20:05 +0800)
commit7b9586b50c56956fdf132c19c8ba4cd64449d678
tree5702f9af01989a0bfd05ecd71a75f626b5b527a9
parentfce56ca9963a694e3720385c74d79ecf9b578c0e
mmc: Don't force card to active state when entering suspend/shutdown

By adding a card state that records if it is suspended or resumed, we
can accept asyncronus suspend/resume requests for the mmc and sd
bus_ops.

MMC_CAP_AGGRESSIVE_PM, will at request inactivity through the runtime
bus_ops callbacks, execute a suspend of the the card. In the state were
this has been done, we can receive a suspend request for the mmc bus,
which for sd and mmc forced the card to active state by a
pm_runtime_get_sync. In other words, the card was resumed and then
immediately suspended again, completely unnecessary.

Since the suspend/resume bus_ops callbacks for sd and mmc are now
capable of handling asynchronous requests, we no longer need to force
the card to active state before executing suspend. Evidently preventing
the above sequence for MMC_CAP_AGGRESSIVE_PM.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Conflicts:
drivers/mmc/core/mmc.c
drivers/mmc/core/sd.c
drivers/mmc/card/block.c
drivers/mmc/core/mmc.c
drivers/mmc/core/sd.c