[PATCH-v2 0/4] mmc: switch to 1-bit mode which stopping clocks.

From: NeilBrown
Date: Fri Jan 30 2015 - 17:31:52 EST


This is a new version which moves most of the code into
mmc/core so it is available to all drivers.

I was wrong about not being able to sleep in pm_runtime callbacks.
There are spinlocks, but not the ones I thought they were...

Anyway, I tried switching to 1-bit mode from within the
runtime_suspend callback and hit a different problem.
The sequence to switch to 1-bit involves calling set_ios
which, for omap_hsmmc at least, calls pm_runtime_get_sync().

Calling pm_runtime_get_sync from the runtime_suspend callback
deadlocks.

It would be possible to remove the pm_runtime_get_sync call
from set_ios() functions, and instead call host->enable(),
host->disable() around those mmc_set_ios() calls which don't
have the host claimed. However that seems a bit fragile to me.

So for now I'm persisting with doing the width change from
a work-queue. This set of patches does that.

If you think calling host->enable/disable around mmc_set_ios() calls
does make sense, I can post my other patch for review.

Thanks,
NeilBrown


---

NeilBrown (4):
mmc: core: fold mmc_set_bus_width calls into sdio_enable_4bit_bus.
mmc: core: allow non-blocking form of mmc_claim_host
mmc: sdio: support switching to 1-bit before turning off clocks
mmc: omap_hsmmc: switch to 1-bit before stopping clocks.


drivers/mmc/core/core.c | 21 +++++++++---
drivers/mmc/core/sdio.c | 74 +++++++++++++++++++++++++++++------------
drivers/mmc/host/omap_hsmmc.c | 13 ++++++-
include/linux/mmc/core.h | 2 +
include/linux/mmc/host.h | 2 +
5 files changed, 83 insertions(+), 29 deletions(-)

--
Signature

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/