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]
Message-Id: <200901081249.20152.jpihet@mvista.com>
Date:	Thu, 8 Jan 2009 12:49:19 +0100
From:	Jean Pihet <jpihet@...sta.com>
To:	Adrian Hunter <ext-adrian.hunter@...ia.com>
Cc:	linux-arm-kernel@...ts.arm.linux.org.uk,
	Tony Lindgren <tony@...mide.com>,
	Pierre Ossman <drzeus-mmc@...eus.cx>,
	linux-kernel@...r.kernel.org, linux-omap@...r.kernel.org,
	Madhusudhan Chikkature <madhu.cr@...com>,
	David Brownell <david-b@...bell.net>,
	"Jarkko Lavinen (NMP/Helsinki)" <jarkko.lavinen@...ia.com>
Subject: Re: [PATCH] OMAP: MMC: recover from transfer failures

Thanks for the suggestion, it works great (stress tested) and is a cleaner 
fix.
Here is a patch the latest linux-omap-2.6 tree. Is this OK?

Regards,
Jean

From d143f6b2e705aa4e9d2b032097fd1c82f8163262 Mon Sep 17 00:00:00 2001
From: Jean Pihet <jpihet@...sta.com>
Date: Thu, 8 Jan 2009 12:35:21 +0100
Subject: [PATCH] OMAP: MMC: recover from transfer failures

Timeouts during a command that has a data phase can result in the
next command issued after the command that failed not being processed,
i.e. no interrupt ever occurs to indicate the command has completed.
This failure can result in a deadlock.

This patch resets the data state machine to clear the error in
case of a command timeout.

Tested on OMAP3430 chip and intensive MMC/SD device removal while
transferring data.

Signed-off-by: Andy Lowe <alowe@...sta.com>
Signed-off-by: Jean Pihet <jpihet@...sta.com>
Signed-off-by: Adrian Hunter <ext-adrian.hunter@...ia.com>
---
 drivers/mmc/host/omap_hsmmc.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index d5c1e9d..97150c0 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -464,8 +464,15 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
                                }
                                end_cmd = 1;
                        }
-                       if (host->data)
+                       if (host->data) {
                                mmc_dma_cleanup(host);
+                               OMAP_HSMMC_WRITE(host->base, SYSCTL,
+                                       OMAP_HSMMC_READ(host->base,
+                                                       SYSCTL) | SRD);
+                               while (OMAP_HSMMC_READ(host->base,
+                                               SYSCTL) & SRD)
+                                       ;
+                       }
                }
                if ((status & DATA_TIMEOUT) ||
                        (status & DATA_CRC)) {
--
1.5.4.4.21.gc4a6c



On Thursday 08 January 2009 10:02:24 Adrian Hunter wrote:
> Why not do the reset in mmc_omap_irq() like the other resets?
> e.g.
>
> static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
> ...
>                 if ((status & CMD_TIMEOUT) ||
>                         (status & CMD_CRC)) {
>                         if (host->cmd) {
>                                 if (status & CMD_TIMEOUT) {
>                                         OMAP_HSMMC_WRITE(host->base,
> SYSCTL, OMAP_HSMMC_READ(host->base, SYSCTL) | SRC); while
> (OMAP_HSMMC_READ(host->base, SYSCTL) & SRC) ;
>
>                                         host->cmd->error = -ETIMEDOUT;
>                                 } else {
>                                         host->cmd->error = -EILSEQ;
>                                 }
>                                 end_cmd = 1;
>                         }
> -                       if (host->data)
> +                       if (host->data) {
>                                 mmc_dma_cleanup(host);
> +                               OMAP_HSMMC_WRITE(host->base, SYSCTL,
> +                                       OMAP_HSMMC_READ(host->base,
> +                                                       SYSCTL) | SRD);
> +                               while (OMAP_HSMMC_READ(host->base,
> +                                               SYSCTL) & SRD)
> +                                       ;
> +                       }
>                 }
>                 if ((status & DATA_TIMEOUT) ||
>                         (status & DATA_CRC)) {



View attachment "OMAP-MMC-recover-from-transfer-failures.patch" of type "text/x-diff" (1500 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ