Skip to content

mmc: switch to 1-bit mode which stopping clocks.

NeilBrown linux-mmc linux-omap lkml 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 0 repliesNew
  2. v13 patches 2 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4mmc: core: fold mmc_set_bus_width calls into sdio_enable_4bit_bus.drivers/mmc/core/sdio.c+12 -200 replies
2/4mmc: core: allow non-blocking form of mmc_claim_hostdrivers/mmc/core/core.c+2 -10 replies
3/4mmc: sdio: support switching to 1-bit before turning off clocksdrivers/mmc/core/core.c drivers/mmc/core/sdio.c include/linux/mmc/core.h +1 more+59 -50 replies
4/4mmc: omap_hsmmc: switch to 1-bit before stopping clocks.drivers/mmc/host/omap_hsmmc.c+10 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

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

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