public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neil@brown.name>
To: Ulf Hansson <ulf.hansson@linaro.org>,
	Adrian Hunter <adrian.hunter@intel.com>
Cc: linux-mmc <linux-mmc@vger.kernel.org>
Subject: [PATCH 3/4] mmc/sdio: keep device awake when interrupts expected in 4bit mode
Date: Wed, 25 Mar 2015 07:56:10 +1100	[thread overview]
Message-ID: <20150324205610.20572.48941.stgit@notabene.brown> (raw)
In-Reply-To: <20150324205316.20572.30538.stgit@notabene.brown>

In 4-bit mode, SDIO interrupts are only reliable if clocks
are maintained.
So get an extra reference when that is the case.

Signed-off-by: NeilBrown  <neil@brown.name>
---
 drivers/mmc/core/sdio.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 5bc6c7dbbd60..f432b11677bd 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -227,6 +227,9 @@ static int sdio_enable_wide(struct mmc_card *card)
 	if (ret)
 		return ret;
 
+	/* Interrupts only work in 4bit mode if clocks stay on */
+	if (card->host->caps & MMC_CAP_SDIO_IRQ)
+		pm_runtime_get(card->host->parent);
 	return 1;
 }
 
@@ -283,6 +286,8 @@ static int sdio_disable_wide(struct mmc_card *card)
 		return ret;
 
 	mmc_set_bus_width(card->host, MMC_BUS_WIDTH_1);
+	if (card->host->caps & MMC_CAP_SDIO_IRQ)
+		pm_runtime_put(card->host->parent);
 
 	return 0;
 }



  reply	other threads:[~2015-03-24 21:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24 20:56 [PATCH/RFC 0/4] Use runtime-pm to switch sdio to 1-bit when idle NeilBrown
2015-03-24 20:56 ` NeilBrown [this message]
2015-03-24 20:56 ` [PATCH 1/4] mmc: core: fold mmc_set_bus_width calls into sdio_enable_4bit_bus NeilBrown
2015-03-24 21:18   ` Ulf Hansson
2015-03-24 20:56 ` [PATCH 4/4] mmc/host: use runtime_pm to switch to 1-bit mode NeilBrown
2015-03-24 20:56 ` [PATCH 2/4] mmc/core: add pm_runtime tracking to mmc_host devices NeilBrown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150324205610.20572.48941.stgit@notabene.brown \
    --to=neil@brown.name \
    --cc=adrian.hunter@intel.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox