lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu,  8 Nov 2012 15:06:19 +0200
From:	dragos.tatulea@...el.com
To:	linux-kernel@...r.kernel.org, linux-mmc@...r.kernel.org,
	cjb@...top.org
Cc:	kirill.shutemov@...ux.intel.com, irina.tirdea@...el.com,
	octavian.purdila@...el.com, tony.luck@...el.com,
	keescook@...omium.org, dragos.tatulea@...il.com,
	Adrian Hunter <adrian.hunter@...el.com>
Subject: [PATCH v2 21/26] mmc: sdhci: panic write: poll interrupts

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

We really don't want to use interrupts while doing a panic dump, so
implement polling.

The mmc panic begin/end ops have also been added for sdhci.

Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
Signed-off-by: Irina Tirdea <irina.tirdea@...el.com>
---
 drivers/mmc/host/sdhci.c |   33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index e096526..d85e9d5 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -131,6 +131,8 @@ static void sdhci_clear_set_irqs(struct sdhci_host *host, u32 clear, u32 set)
 	ier &= ~clear;
 	ier |= set;
 	sdhci_writel(host, ier, SDHCI_INT_ENABLE);
+	if (mmc_panic_task_active(host->mmc))
+		ier = 0;
 	sdhci_writel(host, ier, SDHCI_SIGNAL_ENABLE);
 }
 
@@ -1267,6 +1269,8 @@ static int sdhci_set_power(struct sdhci_host *host, unsigned short power)
  *                                                                           *
 \*****************************************************************************/
 
+static irqreturn_t sdhci_irq(int irq, void *dev_id);
+
 static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
 {
 	struct sdhci_host *host;
@@ -1347,6 +1351,11 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
 
 	mmiowb();
 	sdhci_unlock_irqrestore(host, flags);
+
+	if (mmc_am_panic_task(host->mmc)) {
+		while (host->mrq)
+			sdhci_irq(0, host);
+	}
 }
 
 static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
@@ -2066,6 +2075,27 @@ void sdhci_unlock_irqrestore(struct sdhci_host *host, unsigned long flags)
 		spin_unlock_irqrestore(&host->lock, flags);
 }
 
+static void sdhci_panic_begin(struct mmc_host *mmc)
+{
+	struct sdhci_host *host = mmc_priv(mmc);
+
+	sdhci_writel(host, 0, SDHCI_SIGNAL_ENABLE);
+}
+
+static void sdhci_panic_end(struct mmc_host *mmc)
+{
+	struct sdhci_host *host = mmc_priv(mmc);
+	u32 ier;
+
+	ier = sdhci_readl(host, SDHCI_INT_ENABLE);
+	sdhci_writel(host, ier, SDHCI_SIGNAL_ENABLE);
+}
+
+static const struct mmc_panic_ops sdhci_pops = {
+	.begin		= sdhci_panic_begin,
+	.end		= sdhci_panic_end,
+};
+
 #endif
 
 /*****************************************************************************\
@@ -2854,6 +2884,9 @@ int sdhci_add_host(struct sdhci_host *host)
 	 * Set host parameters.
 	 */
 	mmc->ops = &sdhci_ops;
+#ifdef CONFIG_MMC_BLOCK_PANIC_WRITE
+	mmc->pops = &sdhci_pops;
+#endif
 	mmc->f_max = host->max_clk;
 	if (host->ops->get_min_clock)
 		mmc->f_min = host->ops->get_min_clock(host);
-- 
1.7.9.5

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ