All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Omap MMC init updates and new controller for 2.6.29 merge window
@ 2008-12-07 21:45 Tony Lindgren
  2008-12-07 21:46 ` [PATCH 1/5] omap mmc: Remove broken MMC init code Tony Lindgren
                   ` (5 more replies)
  0 siblings, 6 replies; 45+ messages in thread
From: Tony Lindgren @ 2008-12-07 21:45 UTC (permalink / raw)
  To: drzeus-mmc, linux-kernel, linux-arm-kernel; +Cc: linux-omap

Hi Pierre & Russell,

This series contains a better platform init for omap MMC as discussed earlier
on the linux-omap mailing list. The last patch in the series adds support for
a newer omap MMC controller available on 2430 and 34xx omaps.

The first four patches should get merged via Russell. The last one adding
the new controller depends on comments from Pierre, so I can separate
that out if desired.

The third patch in the series depends on the "Omap3 updates for 2.6.29
merge window" series for the changes to Pandora board support.

Comments welcome as always!

Regards,

Tony

---

Kevin Hilman (1):
      omap mmc: force MMC module reset on boot

Madhusudhan Chikkature (1):
      omap mmc: Add new omap hsmmc controller for 2430 and 34xx

Tony Lindgren (3):
      omap mmc: Add low-level initialization for hsmmc controller
      omap mmc: Add better MMC low-level init
      omap mmc: Remove broken MMC init code


 arch/arm/mach-omap1/board-h2-mmc.c         |   89 +-
 arch/arm/mach-omap1/board-h2.c             |   25 -
 arch/arm/mach-omap1/board-h3-mmc.c         |  100 +-
 arch/arm/mach-omap1/board-h3.c             |   10 
 arch/arm/mach-omap1/board-innovator.c      |   50 +
 arch/arm/mach-omap1/board-nokia770.c       |   74 +-
 arch/arm/mach-omap1/board-palmte.c         |    1 
 arch/arm/mach-omap1/board-palmz71.c        |   11 
 arch/arm/mach-omap1/board-sx1-mmc.c        |   80 --
 arch/arm/mach-omap1/board-sx1.c            |   10 
 arch/arm/mach-omap1/board-voiceblue.c      |   10 
 arch/arm/mach-omap1/clock.h                |    3 
 arch/arm/mach-omap1/devices.c              |   90 ++
 arch/arm/mach-omap2/Makefile               |   15 
 arch/arm/mach-omap2/board-2430sdp.c        |   48 +
 arch/arm/mach-omap2/board-apollon.c        |   11 
 arch/arm/mach-omap2/board-generic.c        |   11 
 arch/arm/mach-omap2/board-h4.c             |   11 
 arch/arm/mach-omap2/board-ldp.c            |   40 +
 arch/arm/mach-omap2/board-omap3beagle.c    |   90 ++
 arch/arm/mach-omap2/board-omap3pandora.c   |   32 +
 arch/arm/mach-omap2/board-overo.c          |   43 +
 arch/arm/mach-omap2/clock24xx.h            |    9 
 arch/arm/mach-omap2/clock34xx.h            |   10 
 arch/arm/mach-omap2/devices.c              |  169 ++++
 arch/arm/mach-omap2/mmc-twl4030.c          |  408 +++++++++
 arch/arm/mach-omap2/mmc-twl4030.h          |   29 +
 arch/arm/plat-omap/devices.c               |  225 +----
 arch/arm/plat-omap/include/mach/board-h2.h |    6 
 arch/arm/plat-omap/include/mach/board.h    |   22 
 arch/arm/plat-omap/include/mach/control.h  |   17 
 arch/arm/plat-omap/include/mach/mmc.h      |   74 ++
 drivers/mmc/host/Kconfig                   |   11 
 drivers/mmc/host/Makefile                  |    1 
 drivers/mmc/host/omap.c                    |    7 
 drivers/mmc/host/omap_hsmmc.c              | 1242 ++++++++++++++++++++++++++++
 36 files changed, 2536 insertions(+), 548 deletions(-)
 create mode 100644 arch/arm/mach-omap2/mmc-twl4030.c
 create mode 100644 arch/arm/mach-omap2/mmc-twl4030.h
 create mode 100644 drivers/mmc/host/omap_hsmmc.c

-- 
Signature

^ permalink raw reply	[flat|nested] 45+ messages in thread
* [RFC/PATCH] OMAP: MMC: recover from transfer failures
@ 2008-12-16 18:57 Jean Pihet
  2008-12-19  9:06 ` [PATCH] " Jean Pihet
  0 siblings, 1 reply; 45+ messages in thread
From: Jean Pihet @ 2008-12-16 18:57 UTC (permalink / raw)
  To: linux-omap

[-- Attachment #1: Type: text/plain, Size: 3237 bytes --]

Hi,

Here is a patch that fixes a MMC host controller deadlock. The problem happens 
when removing the MMC/SD device when a transfer is on-going.

It has been tested on OMAP3430 but this fix should apply to OMAP2 chips as 
well, as seen from the TRMs.

    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.

    The indication that the mmc host controller is in this error state is
    that the DATI bit is set in the PSTATE register.  This patch checks
    to see if the DATI bit is set before starting a new command, and if it
    is set it resets the data state machine to clear the error.

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

Regards,
Jean


From 48a40925a4d57f6e7e45809a4b5c09b20f9314d7 Mon Sep 17 00:00:00 2001
From: Jean Pihet <jpihet@mvista.com>
Date: Tue, 16 Dec 2008 19:44:12 +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.

The indication that the mmc host controller is in this error state is
that the DATI bit is set in the PSTATE register.  This patch checks
to see if the DATI bit is set before starting a new command, and if it
is set it resets the data state machine to clear the error.

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

Signed-off-by: Andy Lowe <alowe@mvista.com>
Signed-off-by: Jean Pihet <jpihet@mvista.com>
---
 drivers/mmc/host/omap_hsmmc.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 1fcc544..b7d111e 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -44,6 +44,7 @@
 #define OMAP_HSMMC_RSP54	0x0118
 #define OMAP_HSMMC_RSP76	0x011C
 #define OMAP_HSMMC_DATA		0x0120
+#define OMAP_HSMMC_PSTATE	0x0124
 #define OMAP_HSMMC_HCTL		0x0128
 #define OMAP_HSMMC_SYSCTL	0x012C
 #define OMAP_HSMMC_STAT		0x0130
@@ -89,6 +90,7 @@
 #define DUAL_VOLT_OCR_BIT	7
 #define SRC			(1 << 25)
 #define SRD			(1 << 26)
+#define DATI			(1 << 1)
 
 /*
  * FIXME: Most likely all the data using these _DEVID defines should come
@@ -273,6 +275,15 @@ mmc_omap_start_command(struct mmc_omap_host *host, struct 
mmc_command *cmd,
 		mmc_hostname(host->mmc), cmd->opcode, cmd->arg);
 	host->cmd = cmd;
 
+	if (OMAP_HSMMC_READ(host->base, PSTATE) & DATI) {
+		dev_dbg(mmc_dev(host->mmc), "mmc_omap_start_command: "
+			" resetting data state machine\n");
+		OMAP_HSMMC_WRITE(host->base, SYSCTL,
+			OMAP_HSMMC_READ(host->base, SYSCTL) | SRD);
+		while (OMAP_HSMMC_READ(host->base, SYSCTL) & SRD)
+			;
+	}
+
 	/*
 	 * Clear status bits and enable interrupts
 	 */
-- 
1.5.4.4.21.gc4a6c


[-- Attachment #2: OMAP-MMC-recover-from-transfer-failures.patch --]
[-- Type: text/x-diff, Size: 2250 bytes --]

From 48a40925a4d57f6e7e45809a4b5c09b20f9314d7 Mon Sep 17 00:00:00 2001
From: Jean Pihet <jpihet@mvista.com>
Date: Tue, 16 Dec 2008 19:44:12 +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.

The indication that the mmc host controller is in this error state is
that the DATI bit is set in the PSTATE register.  This patch checks
to see if the DATI bit is set before starting a new command, and if it
is set it resets the data state machine to clear the error.

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

Signed-off-by: Andy Lowe <alowe@mvista.com>
Signed-off-by: Jean Pihet <jpihet@mvista.com>
---
 drivers/mmc/host/omap_hsmmc.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 1fcc544..b7d111e 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -44,6 +44,7 @@
 #define OMAP_HSMMC_RSP54	0x0118
 #define OMAP_HSMMC_RSP76	0x011C
 #define OMAP_HSMMC_DATA		0x0120
+#define OMAP_HSMMC_PSTATE	0x0124
 #define OMAP_HSMMC_HCTL		0x0128
 #define OMAP_HSMMC_SYSCTL	0x012C
 #define OMAP_HSMMC_STAT		0x0130
@@ -89,6 +90,7 @@
 #define DUAL_VOLT_OCR_BIT	7
 #define SRC			(1 << 25)
 #define SRD			(1 << 26)
+#define DATI			(1 << 1)
 
 /*
  * FIXME: Most likely all the data using these _DEVID defines should come
@@ -273,6 +275,15 @@ mmc_omap_start_command(struct mmc_omap_host *host, struct mmc_command *cmd,
 		mmc_hostname(host->mmc), cmd->opcode, cmd->arg);
 	host->cmd = cmd;
 
+	if (OMAP_HSMMC_READ(host->base, PSTATE) & DATI) {
+		dev_dbg(mmc_dev(host->mmc), "mmc_omap_start_command: "
+			" resetting data state machine\n");
+		OMAP_HSMMC_WRITE(host->base, SYSCTL,
+			OMAP_HSMMC_READ(host->base, SYSCTL) | SRD);
+		while (OMAP_HSMMC_READ(host->base, SYSCTL) & SRD)
+			;
+	}
+
 	/*
 	 * Clear status bits and enable interrupts
 	 */
-- 
1.5.4.4.21.gc4a6c


^ permalink raw reply related	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2009-03-24 20:04 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-07 21:45 [PATCH 0/5] Omap MMC init updates and new controller for 2.6.29 merge window Tony Lindgren
2008-12-07 21:46 ` [PATCH 1/5] omap mmc: Remove broken MMC init code Tony Lindgren
2008-12-07 21:47 ` [PATCH 2/5] omap mmc: Add better MMC low-level init Tony Lindgren
2009-01-10 22:49   ` Ladislav Michl
2009-01-10 23:00     ` Ladislav Michl
2009-01-13 13:43       ` Tony Lindgren
2009-03-23 17:47         ` Ladislav Michl
2009-03-24 20:04           ` [APPLIED] " Tony Lindgren
2009-01-10 23:03   ` Ladislav Michl
2008-12-07 21:49 ` [PATCH 3/5] omap mmc: Add low-level initialization for hsmmc controller Tony Lindgren
2008-12-07 21:50 ` [PATCH 4/5] omap mmc: force MMC module reset on boot Tony Lindgren
2008-12-07 21:51 ` [PATCH 5/5] omap mmc: Add new omap hsmmc controller for 2430 and 34xx Tony Lindgren
2008-12-21 16:17   ` Pierre Ossman
2008-12-29 16:55     ` Tony Lindgren
2008-12-30  8:36       ` Tony Lindgren
2008-12-31 17:59         ` Pierre Ossman
2009-01-07 10:18           ` Tony Lindgren
2009-01-07 10:28             ` [PATCH] OMAP: MMC: recover from transfer failures (was: Re: [PATCH 5/5] omap mmc: Add new omap hsmmc controller for 2430 and 34xx) Jean Pihet
2009-01-07 15:40               ` Tony Lindgren
2009-01-08  9:02               ` [PATCH] OMAP: MMC: recover from transfer failures Adrian Hunter
2009-01-08 11:49                 ` Jean Pihet
2009-01-08 12:17                   ` Adrian Hunter
2009-02-02  8:46                   ` Jean Pihet
2009-02-02 19:05                     ` Tony Lindgren
2009-02-03 14:05                       ` [PATCH] OMAP: MMC: recover from transfer failures - Resend Jean Pihet
2009-02-03 14:05                         ` Jean Pihet
2009-02-05 20:10                         ` Andrew Morton
2009-02-05 20:10                           ` Andrew Morton
2009-02-05 20:32                           ` Paul Walmsley
2009-02-06 13:22                             ` Jean Pihet
2009-02-06 13:53                               ` Pierre Ossman
2009-02-06 15:53                                 ` [PATCH] OMAP: MMC: replace infinite loops with timeouts (was Re: [PATCH] OMAP: MMC: recover from transfer failures - Resend) Jean Pihet
2009-02-09 15:58                                   ` Adrian Hunter
2009-02-09 15:58                                     ` Adrian Hunter
2009-02-11  9:41                                     ` Jean Pihet
2009-02-11  9:41                                       ` Jean Pihet
2009-02-09 17:58                                 ` [PATCH] OMAP: MMC: recover from transfer failures - Resend Jarkko Lavinen
2009-02-09 17:58                                   ` Jarkko Lavinen
2009-02-09 18:46                                   ` Tony Lindgren
2009-02-09 18:46                                     ` Tony Lindgren
2009-02-10  0:09                               ` Paul Walmsley
2009-02-08 20:27                             ` David Brownell
2009-02-08 20:27                               ` David Brownell
2008-12-15 22:26 ` git pull request for omap mmc init changes (Re: [PATCH 0/5] Omap MMC init updates and new controller for 2.6.29 merge window) Tony Lindgren
2008-12-16 18:57 [RFC/PATCH] OMAP: MMC: recover from transfer failures Jean Pihet
2008-12-19  9:06 ` [PATCH] " Jean Pihet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.