mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Irina Tirdea <irina.tirdea@intel.com>
To: Anton Vorontsov <cbouatmailru@gmail.com>,
	Colin Cross <ccross@android.com>,
	Kees Cook <keescook@chromium.org>,
	Tony Luck <tony.luck@intel.com>, Chris Ball <cjb@laptop.org>
Cc: linux-kernel@vger.kernel.org,
	Adrian Hunter <adrian.hunter@intel.com>,
	Octavian Purdila <octavian.purdila@intel.com>,
	Irina Tirdea <irina.tirdea@intel.com>
Subject: [PATCH 10/26] mmc: panic write: do not msleep
Date: Tue, 23 Oct 2012 16:48:08 +0300	[thread overview]
Message-ID: <1351000104-13015-11-git-send-email-irina.tirdea@intel.com> (raw)
In-Reply-To: <1351000104-13015-1-git-send-email-irina.tirdea@intel.com>

From: Adrian Hunter <adrian.hunter@intel.com>

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
---
 drivers/mmc/core/core.c     |    6 +++---
 drivers/mmc/core/core.h     |    6 ++++--
 drivers/mmc/core/mmc_ops.c  |   10 +++++-----
 drivers/mmc/core/sd_ops.c   |    2 +-
 drivers/mmc/core/sdio_ops.c |    2 +-
 5 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 0b904bc..204a9bd 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1331,7 +1331,7 @@ static void mmc_power_up(struct mmc_host *host)
 	 * This delay should be sufficient to allow the power supply
 	 * to reach the minimum voltage.
 	 */
-	mmc_delay(10);
+	mmc_delay(host, 10);
 
 	host->ios.clock = host->f_init;
 
@@ -1342,7 +1342,7 @@ static void mmc_power_up(struct mmc_host *host)
 	 * This delay must be at least 74 clock sizes, or 1 ms, or the
 	 * time required to reach a stable voltage.
 	 */
-	mmc_delay(10);
+	mmc_delay(host, 10);
 
 	mmc_host_clk_release(host);
 }
@@ -1378,7 +1378,7 @@ void mmc_power_off(struct mmc_host *host)
 	 * XO-1.5, require a short delay after poweroff before the card
 	 * can be successfully turned on again.
 	 */
-	mmc_delay(1);
+	mmc_delay(host, 1);
 
 	mmc_host_clk_release(host);
 }
diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
index 3bdafbc..4cba1f1 100644
--- a/drivers/mmc/core/core.h
+++ b/drivers/mmc/core/core.h
@@ -46,9 +46,11 @@ void mmc_set_timing(struct mmc_host *host, unsigned int timing);
 void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type);
 void mmc_power_off(struct mmc_host *host);
 
-static inline void mmc_delay(unsigned int ms)
+static inline void mmc_delay(struct mmc_host *host, unsigned int ms)
 {
-	if (ms < 1000 / HZ) {
+	if (mmc_am_panic_task(host)) {
+		mdelay(ms);
+	} else if (ms < 1000 / HZ) {
 		cond_resched();
 		mdelay(ms);
 	} else {
diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
index a0e1720..23eaeab 100644
--- a/drivers/mmc/core/mmc_ops.c
+++ b/drivers/mmc/core/mmc_ops.c
@@ -83,7 +83,7 @@ int mmc_card_sleepawake(struct mmc_host *host, int sleep)
 	 * others) is invalid while the card sleeps.
 	 */
 	if (!(host->caps & MMC_CAP_WAIT_WHILE_BUSY))
-		mmc_delay(DIV_ROUND_UP(card->ext_csd.sa_timeout, 10000));
+		mmc_delay(host, DIV_ROUND_UP(card->ext_csd.sa_timeout, 10000));
 
 	if (!sleep)
 		err = mmc_select_card(card);
@@ -107,7 +107,7 @@ int mmc_go_idle(struct mmc_host *host)
 	 */
 	if (!mmc_host_is_spi(host)) {
 		mmc_set_chip_select(host, MMC_CS_HIGH);
-		mmc_delay(1);
+		mmc_delay(host, 1);
 	}
 
 	cmd.opcode = MMC_GO_IDLE_STATE;
@@ -116,11 +116,11 @@ int mmc_go_idle(struct mmc_host *host)
 
 	err = mmc_wait_for_cmd(host, &cmd, 0);
 
-	mmc_delay(1);
+	mmc_delay(host, 1);
 
 	if (!mmc_host_is_spi(host)) {
 		mmc_set_chip_select(host, MMC_CS_DONTCARE);
-		mmc_delay(1);
+		mmc_delay(host, 1);
 	}
 
 	host->use_spi_crc = 0;
@@ -159,7 +159,7 @@ int mmc_send_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
 
 		err = -ETIMEDOUT;
 
-		mmc_delay(10);
+		mmc_delay(host, 10);
 	}
 
 	if (rocr && !mmc_host_is_spi(host))
diff --git a/drivers/mmc/core/sd_ops.c b/drivers/mmc/core/sd_ops.c
index 274ef00..d4573fb 100644
--- a/drivers/mmc/core/sd_ops.c
+++ b/drivers/mmc/core/sd_ops.c
@@ -181,7 +181,7 @@ int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
 
 		err = -ETIMEDOUT;
 
-		mmc_delay(10);
+		mmc_delay(host, 10);
 	}
 
 	if (rocr && !mmc_host_is_spi(host))
diff --git a/drivers/mmc/core/sdio_ops.c b/drivers/mmc/core/sdio_ops.c
index d29e206..099908c 100644
--- a/drivers/mmc/core/sdio_ops.c
+++ b/drivers/mmc/core/sdio_ops.c
@@ -56,7 +56,7 @@ int mmc_send_io_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
 
 		err = -ETIMEDOUT;
 
-		mmc_delay(10);
+		mmc_delay(host, 10);
 	}
 
 	if (rocr)
-- 
1.7.9.5


  parent reply	other threads:[~2012-10-23 13:43 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-23 13:47 [PATCH 00/26] pstore, mmc: add mmc as backend for pstore Irina Tirdea
2012-10-23 13:47 ` [PATCH 01/26] pstore: allow for big files Irina Tirdea
2012-10-23 16:48   ` Kees Cook
2012-10-25  8:54     ` Tatulea, Dragos
2012-10-23 13:48 ` [PATCH 02/26] pstore: add flags Irina Tirdea
2012-10-23 16:54   ` Kees Cook
2012-10-23 16:57     ` Luck, Tony
2012-10-25 11:25       ` Tatulea, Dragos
2012-10-23 13:48 ` [PATCH 03/26] pstore: add flush Irina Tirdea
2012-10-23 16:50   ` Kees Cook
2012-10-23 13:48 ` [PATCH 04/26] blkoops: add a block device oops / panic logger Irina Tirdea
2012-10-23 13:48 ` [PATCH 05/26] block: add panic write Irina Tirdea
2012-10-23 13:48 ` [PATCH 06/26] mmc: block: add panic write support Irina Tirdea
2012-10-23 13:48 ` [PATCH 07/26] mmc: panic write: bypass host claiming Irina Tirdea
2012-10-23 13:48 ` [PATCH 08/26] mmc: panic write: bypass request completion Irina Tirdea
2012-10-23 13:48 ` [PATCH 09/26] mmc: panic write: suppress host not claimed warnings Irina Tirdea
2012-10-23 13:48 ` Irina Tirdea [this message]
2012-10-23 13:48 ` [PATCH 11/26] mmc: panic write: bypass clock gating Irina Tirdea
2012-10-23 13:48 ` [PATCH 12/26] mmc: panic write: bypass regulators Irina Tirdea
2012-10-23 13:48 ` [PATCH 13/26] mmc: panic write: trap non panic tasks Irina Tirdea
2012-10-23 13:48 ` [PATCH 14/26] mmc: panic write: bypass bus ref locking Irina Tirdea
2012-10-23 13:48 ` [PATCH 15/26] mmc: sdhci: panic write: bypass spin lock Irina Tirdea
2012-10-23 13:48 ` [PATCH 16/26] mmc: sdhci: panic write: no sleeping Irina Tirdea
2012-10-23 13:48 ` [PATCH 17/26] mmc: sdhci: panic write: call tasklets inline Irina Tirdea
2012-10-23 13:48 ` [PATCH 18/26] mmc: sdhci: panic write: no timeout timer Irina Tirdea
2012-10-23 13:48 ` [PATCH 19/26] mmc: sdhci: panic write: no runtime pm Irina Tirdea
2012-10-23 13:48 ` [PATCH 20/26] mmc: sdhci: panic write: no tuning Irina Tirdea
2012-10-23 13:48 ` [PATCH 21/26] mmc: sdhci: panic write: poll interrupts Irina Tirdea
2012-10-23 13:48 ` [PATCH 22/26] mmc: sdhci: panic write: no dma mapping Irina Tirdea
2012-10-23 13:48 ` [PATCH 23/26] mmc: sdhci: panic write: resume suspended host Irina Tirdea
2012-10-23 13:48 ` [PATCH 24/26] mmc: sdhci: panic write: abort request in progress Irina Tirdea
2012-10-23 13:48 ` [PATCH 25/26] mmc: sdhci: panic write: trap nonpanic tasks Irina Tirdea
2012-10-23 13:48 ` [PATCH 26/26] mmc: sdhci-pci: add panic write support Irina Tirdea
2012-10-29 20:28 ` [PATCH 00/26] pstore, mmc: add mmc as backend for pstore Kirill A. Shutemov
2012-10-29 20:50   ` Chris Ball

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=1351000104-13015-11-git-send-email-irina.tirdea@intel.com \
    --to=irina.tirdea@intel.com \
    --cc=adrian.hunter@intel.com \
    --cc=cbouatmailru@gmail.com \
    --cc=ccross@android.com \
    --cc=cjb@laptop.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=octavian.purdila@intel.com \
    --cc=tony.luck@intel.com \
    /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

all inboxes | Powered by JetHome®