2007-05-01 15:23:29

by Pierre Ossman

[permalink] [raw]
Subject: [GIT PULL] MMC updates

Linus, please pull from

git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc.git for-linus

to receive the following updates:

drivers/misc/tifm_7xx1.c | 332 +++----
drivers/misc/tifm_core.c | 305 +++--
drivers/mmc/Kconfig | 106 +--
drivers/mmc/Makefile | 33 +-
drivers/mmc/card/Kconfig | 17 +
drivers/mmc/card/Makefile | 11 +
drivers/mmc/{mmc_block.c => card/block.c} | 55 +-
drivers/mmc/{mmc_queue.c => card/queue.c} | 12 +-
drivers/mmc/{mmc_queue.h => card/queue.h} | 0
drivers/mmc/core/Kconfig | 17 +
drivers/mmc/core/Makefile | 11 +
drivers/mmc/core/core.c | 727 ++++++++++++
drivers/mmc/core/core.h | 70 ++
drivers/mmc/core/mmc.c | 537 +++++++++
drivers/mmc/core/mmc_ops.c | 276 +++++
drivers/mmc/core/mmc_ops.h | 27 +
drivers/mmc/core/sd.c | 587 ++++++++++
drivers/mmc/core/sd_ops.c | 316 ++++++
drivers/mmc/core/sd_ops.h | 25 +
drivers/mmc/{mmc_sysfs.c => core/sysfs.c} | 11 +-
drivers/mmc/{mmc.h => core/sysfs.h} | 10 +-
drivers/mmc/host/Kconfig | 103 ++
drivers/mmc/host/Makefile | 18 +
drivers/mmc/{ => host}/at91_mci.c | 1 -
drivers/mmc/{ => host}/au1xmmc.c | 1 -
drivers/mmc/{ => host}/au1xmmc.h | 0
drivers/mmc/{ => host}/imxmmc.c | 1 -
drivers/mmc/{ => host}/imxmmc.h | 0
drivers/mmc/{ => host}/mmci.c | 1 -
drivers/mmc/{ => host}/mmci.h | 0
drivers/mmc/{ => host}/omap.c | 56 +-
drivers/mmc/{ => host}/pxamci.c | 1 -
drivers/mmc/{ => host}/pxamci.h | 0
drivers/mmc/{ => host}/sdhci.c | 43 +-
drivers/mmc/{ => host}/sdhci.h | 4 +-
drivers/mmc/host/tifm_sd.c | 1102 ++++++++++++++++++
drivers/mmc/{ => host}/wbsd.c | 205 +---
drivers/mmc/{ => host}/wbsd.h | 9 +-
drivers/mmc/mmc.c | 1724 -----------------------------
drivers/mmc/tifm_sd.c | 987 -----------------
include/asm-arm/arch-imx/mmc.h | 2 +-
include/asm-arm/arch-pxa/mmc.h | 2 +-
include/asm-arm/mach/mmc.h | 2 +-
include/linux/mmc/card.h | 32 +-
include/linux/mmc/core.h | 112 ++
include/linux/mmc/host.h | 59 +-
include/linux/mmc/mmc.h | 322 ++++--
include/linux/mmc/protocol.h | 327 ------
include/linux/mmc/sd.h | 83 ++
include/linux/tifm.h | 117 +-
50 files changed, 4858 insertions(+), 3941 deletions(-)

Adrian Bunk (1):
mmc: make tifm_sd_set_dma_data() static

Alex Dubov (18):
mmc: cull sg list to match mmc request size
tifm: hide details of interrupt processing from socket drivers
tifm: use bus methods to handle probe/remove instead of driver ones.
tifm: simplify bus match and uevent handlers
tifm: replace per-adapter kthread with freezeable workqueue
tifm_7xx1: improve card detection routine
tifm: move common adapter management tasks from tifm_7xx1 to tifm_core
tifm: move common device management tasks from tifm_7xx1 to tifm_core
tifm_7xx1: fix adapter resume function
tifm: add sysfs attribute for tifm devices
tifm_sd: remove tifm_sd_terminate function
tifm_sd: remove wait for power off on remove
tifm_sd: separate command flags, socket flags and register bit masks
tifm_sd: merge dma and pio request processing paths
tifm_sd: replace command completion state machine with full checking
tifm_sd: fix resume handler
tifm_sd: implement software scatter-gather
tifm: layout fixes, small changes to comments and printfs

Andrew Morton (1):
tifm: add missing include for DMA_32BIT_MASK

Arnaud Patard (1):
mmc-omap: add missing '\n'

Philip Langdale (2):
MMC: Consolidate voltage definitions
MMC: Fix handling of low-voltage cards

Pierre Ossman (21):
mmc: enforce correct sg list
wbsd: remove block crc test
mmc: use right timing mode constant
mmc: MMC sector based cards
mmc: add type field to cards
mmc: Move OCR bit defines
mmc: Move "present" marking
mmc: Move queue functions to mmc_block
mmc: Move host and card drivers to subdirs
mmc: Flush pending detects on host removal
mmc: allow suspended block driver to be removed
mmc: remove card upon suspend
mmc: deprecate mmc bus topology
mmc: Move core functions to subdir
mmc: Separate out protocol ops
wbsd: check for data opcode earlier
mmc: add bus handler
mmc: break apart switch function
mmc: separate out reading EXT_CSD
mmc: support unsafe resume of cards
mmc: remove old card states

Tony Lindgren (2):
mmc-omap: Fix omap to use MMC_POWER_ON
mmc-omap: Clean up omap set_ios and make MMC_POWER_ON work


--
-- Pierre Ossman

Linux kernel, MMC maintainer http://www.kernel.org
PulseAudio, core developer http://pulseaudio.org
rdesktop, core developer http://www.rdesktop.org


2007-05-05 04:25:47

by Pierre Ossman

[permalink] [raw]
Subject: Re: [GIT PULL] MMC updates

Pierre Ossman wrote:
> Linus, please pull from
>
> git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc.git for-linus
>

*ping*

--
-- Pierre Ossman

Linux kernel, MMC maintainer http://www.kernel.org
PulseAudio, core developer http://pulseaudio.org
rdesktop, core developer http://www.rdesktop.org

2007-05-05 04:46:03

by Linus Torvalds

[permalink] [raw]
Subject: Re: [GIT PULL] MMC updates



On Sat, 5 May 2007, Pierre Ossman wrote:

> Pierre Ossman wrote:
> > Linus, please pull from
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc.git for-linus
> >
>
> *ping*

*pong*.

Thanks for reminding me. I was away for a couple of days, missed some
emails, just pulled and pushed out.

Linus

2007-05-09 18:56:58

by Russell King

[permalink] [raw]
Subject: Re: [GIT PULL] MMC updates

On Tue, May 01, 2007 at 05:22:00PM +0200, Pierre Ossman wrote:
> Linus, please pull from
>
> git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc.git for-linus
>
> to receive the following updates:

Dug out from the ARM kautobuild...

drivers/mmc/host/pxamci.c: In function 'pxamci_cmd_done':
drivers/mmc/host/pxamci.c:236: error: 'MMC_ALL_SEND_CID' undeclared (first use in this function)
drivers/mmc/host/pxamci.c:236: error: (Each undeclared identifier is reported only once
drivers/mmc/host/pxamci.c:236: error: for each function it appears in.)
drivers/mmc/host/pxamci.c:237: error: 'MMC_SEND_CSD' undeclared (first use in this function)
drivers/mmc/host/pxamci.c:238: error: 'MMC_SEND_CID' undeclared (first use in this function)

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:

2007-05-09 19:07:31

by Pierre Ossman

[permalink] [raw]
Subject: Re: [GIT PULL] MMC updates

Russell King wrote:
> Dug out from the ARM kautobuild...
>
> drivers/mmc/host/pxamci.c: In function 'pxamci_cmd_done':
> drivers/mmc/host/pxamci.c:236: error: 'MMC_ALL_SEND_CID' undeclared (first use in this function)
> drivers/mmc/host/pxamci.c:236: error: (Each undeclared identifier is reported only once
> drivers/mmc/host/pxamci.c:236: error: for each function it appears in.)
> drivers/mmc/host/pxamci.c:237: error: 'MMC_SEND_CSD' undeclared (first use in this function)
> drivers/mmc/host/pxamci.c:238: error: 'MMC_SEND_CID' undeclared (first use in this function)
>
>

What are opcode defines doing in the driver?

--
-- Pierre Ossman

Linux kernel, MMC maintainer http://www.kernel.org
PulseAudio, core developer http://pulseaudio.org
rdesktop, core developer http://www.rdesktop.org

2007-05-09 22:13:16

by Russell King

[permalink] [raw]
Subject: Re: [GIT PULL] MMC updates

On Wed, May 09, 2007 at 09:06:29PM +0200, Pierre Ossman wrote:
> Russell King wrote:
> > Dug out from the ARM kautobuild...
> >
> > drivers/mmc/host/pxamci.c: In function 'pxamci_cmd_done':
> > drivers/mmc/host/pxamci.c:236: error: 'MMC_ALL_SEND_CID' undeclared (first use in this function)
> > drivers/mmc/host/pxamci.c:236: error: (Each undeclared identifier is reported only once
> > drivers/mmc/host/pxamci.c:236: error: for each function it appears in.)
> > drivers/mmc/host/pxamci.c:237: error: 'MMC_SEND_CSD' undeclared (first use in this function)
> > drivers/mmc/host/pxamci.c:238: error: 'MMC_SEND_CID' undeclared (first use in this function)
> >
> >
>
> What are opcode defines doing in the driver?

See the comments immediately above and below its use.

Welcome to buggy hardware.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:

2007-05-10 05:45:00

by Pierre Ossman

[permalink] [raw]
Subject: Re: [GIT PULL] MMC updates

Russell King wrote:
> See the comments immediately above and below its use.
>
> Welcome to buggy hardware.
>
>

I've read through the erratum, and to me it seems like the bug affects
all long replies, not just these codes. So I think the code should be
fixed to look at the response flag, not the opcode.

Do you have hardware so that you can test such a change?

--
-- Pierre Ossman

Linux kernel, MMC maintainer http://www.kernel.org
PulseAudio, core developer http://pulseaudio.org
rdesktop, core developer http://www.rdesktop.org

2007-05-10 07:51:50

by Russell King

[permalink] [raw]
Subject: Re: [GIT PULL] MMC updates

On Thu, May 10, 2007 at 07:44:02AM +0200, Pierre Ossman wrote:
> Russell King wrote:
> > See the comments immediately above and below its use.
> >
> > Welcome to buggy hardware.
>
> I've read through the erratum, and to me it seems like the bug affects
> all long replies, not just these codes. So I think the code should be
> fixed to look at the response flag, not the opcode.
>
> Do you have hardware so that you can test such a change?

Nope. Suggest checking the git logs and contacting those who authored
the change.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:

2007-05-10 14:01:50

by Pierre Ossman

[permalink] [raw]
Subject: Re: [GIT PULL] MMC updates

Hi Nicolas,

You seem to be the source of this workaround, and also the maintainer of
PXA. So I guess this falls into your lap either way. Highlights from my
discussion with Russell:

Pierre Ossman wrote:
> Russell King wrote:
>
>> > Dug out from the ARM kautobuild...
>> >
>> > drivers/mmc/host/pxamci.c: In function 'pxamci_cmd_done':
>> > drivers/mmc/host/pxamci.c:236: error: 'MMC_ALL_SEND_CID' undeclared (first use in this function)
>> > drivers/mmc/host/pxamci.c:236: error: (Each undeclared identifier is reported only once
>> > drivers/mmc/host/pxamci.c:236: error: for each function it appears in.)
>> > drivers/mmc/host/pxamci.c:237: error: 'MMC_SEND_CSD' undeclared (first use in this function)
>> > drivers/mmc/host/pxamci.c:238: error: 'MMC_SEND_CID' undeclared (first use in this function)
>> >
>> >
>>
>
> What are opcode defines doing in the driver?

Pierre Ossman wrote:
> Russell King wrote:
>
>> See the comments immediately above and below its use.
>>
>> Welcome to buggy hardware.
>>
>>
>>
>
> I've read through the erratum, and to me it seems like the bug affects
> all long replies, not just these codes. So I think the code should be
> fixed to look at the response flag, not the opcode.
>
> Do you have hardware so that you can test such a change?
>
>

I guess the same question goes to you. :)

Rgds

--
-- Pierre Ossman

Linux kernel, MMC maintainer http://www.kernel.org
PulseAudio, core developer http://pulseaudio.org
rdesktop, core developer http://www.rdesktop.org

2007-05-10 14:52:54

by Nicolas Pitre

[permalink] [raw]
Subject: Re: [GIT PULL] MMC updates

On Thu, 10 May 2007, Pierre Ossman wrote:

> You seem to be the source of this workaround, and also the maintainer of
> PXA.

Well... I used to.

But the only MMC capable PXA hardware in working conditions I have
access to at the moment is PXA255 based which doesn't suffer from this
erratum.

> Pierre Ossman wrote:
> > Russell King wrote:
> >
> >> See the comments immediately above and below its use.
> >>
> >> Welcome to buggy hardware.
> >>
> >>
> >>
> >
> > I've read through the erratum, and to me it seems like the bug affects
> > all long replies, not just these codes. So I think the code should be
> > fixed to look at the response flag, not the opcode.
> >
> > Do you have hardware so that you can test such a change?
> >
> >
>
> I guess the same question goes to you. :)

People in better position than I currently do to test a fix are most
likely to be found on lak.


Nicolas

2007-05-12 15:38:47

by Nicolas Pitre

[permalink] [raw]
Subject: Re: [GIT PULL] MMC updates

On Thu, 10 May 2007, Nicolas Pitre wrote:

> On Thu, 10 May 2007, Pierre Ossman wrote:
>
> > You seem to be the source of this workaround, and also the maintainer of
> > PXA.
>
> Well... I used to.

Actually, I'm not the author of this workaround. And looking at it
closer, the current workaround is utterly buggy as it completely inhibit
CRC error reporting for everything but the listed commands when the MSB
of the response is a zero.

> But the only MMC capable PXA hardware in working conditions I have
> access to at the moment is PXA255 based which doesn't suffer from this
> erratum.
>
> > Pierre Ossman wrote:
> > > I've read through the erratum, and to me it seems like the bug affects
> > > all long replies, not just these codes. So I think the code should be
> > > fixed to look at the response flag, not the opcode.

Indeed.

Please apply the following patch. It is compile tested only as I don't
have PXA27x hardware with MMC at the moment, but it just cannot be worse
than the current code even when it was compiling.

----- >8
Subject: fix PXA27x MMC workaround for bad CRC on R2 response erratum

... and make it depend on the response flag rather than the command type.

Signed-off-by: Nicolas Pitre <[email protected]>
---
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index d97d386..8240609 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -232,20 +232,15 @@ static int pxamci_cmd_done(struct pxamci_host *host, unsigned int stat)
/*
* workaround for erratum #42:
* Intel PXA27x Family Processor Specification Update Rev 001
+ * A bogus CRC error can appear if the msb of a R2 response
+ * is a one.
*/
- if (cmd->opcode == MMC_ALL_SEND_CID ||
- cmd->opcode == MMC_SEND_CSD ||
- cmd->opcode == MMC_SEND_CID) {
- /* a bogus CRC error can appear if the msb of
- the 15 byte response is a one */
- if ((cmd->resp[0] & 0x80000000) == 0)
- cmd->error = MMC_ERR_BADCRC;
- } else {
- pr_debug("ignoring CRC from command %d - *risky*\n",cmd->opcode);
- }
-#else
- cmd->error = MMC_ERR_BADCRC;
+ if (RSP_TYPE(mmc_resp_type(cmd)) == RSP_TYPE(MMC_RSP_R2) &&
+ (cmd->resp[0] & 0x80000000)) {
+ pr_debug("ignoring CRC from command %d - *risky*\n", cmd->opcode);
+ } else
#endif
+ cmd->error = MMC_ERR_BADCRC;
}

pxamci_disable_irq(host, END_CMD_RES);

2007-05-12 16:13:18

by Pierre Ossman

[permalink] [raw]
Subject: Re: [GIT PULL] MMC updates

Nicolas Pitre wrote:
> Actually, I'm not the author of this workaround. And looking at it
> closer, the current workaround is utterly buggy as it completely inhibit
> CRC error reporting for everything but the listed commands when the MSB
> of the response is a zero.
>
>

Your name popped up on the commit for this, but as that was during the
bk days the information was severely lacking.

> Please apply the following patch. It is compile tested only as I don't
> have PXA27x hardware with MMC at the moment, but it just cannot be worse
> than the current code even when it was compiling.
>
>

I would think that it would be better to look at just MMC_RSP_136 and
MMC_RSP_CRC in case we get future variations.

Rgds

--
-- Pierre Ossman

Linux kernel, MMC maintainer http://www.kernel.org
PulseAudio, core developer http://pulseaudio.org
rdesktop, core developer http://www.rdesktop.org

2007-05-12 16:23:11

by Russell King

[permalink] [raw]
Subject: Re: [GIT PULL] MMC updates

On Sat, May 12, 2007 at 06:12:27PM +0200, Pierre Ossman wrote:
> Nicolas Pitre wrote:
> > Actually, I'm not the author of this workaround. And looking at it
> > closer, the current workaround is utterly buggy as it completely inhibit
> > CRC error reporting for everything but the listed commands when the MSB
> > of the response is a zero.
> >
> >
>
> Your name popped up on the commit for this, but as that was during the
> bk days the information was severely lacking.

That's not correct. Just as today, it's entirely trackable. We've had
the sign-off thing for quite a long time, and we've also had the ARM
patch system for ages. That's what the "2271/3" number means.

http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=2271%2F1
http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=2271%2F3

First submitted on 22 November 2004 by Nicolas. Went through a couple
of revisions until 2271/3 which was committed on 27 November 2004. No
indication that the code was done by anyone other than Nicolas, though
maybe Nico didn't add appropriate creditation to the real authors.
Slap Wrist if we're missing the proper creditation!

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:

2007-05-12 17:55:30

by Nicolas Pitre

[permalink] [raw]
Subject: Re: [GIT PULL] MMC updates

On Sat, 12 May 2007, Russell King wrote:

> First submitted on 22 November 2004 by Nicolas. Went through a couple
> of revisions until 2271/3 which was committed on 27 November 2004. No
> indication that the code was done by anyone other than Nicolas, though
> maybe Nico didn't add appropriate creditation to the real authors.
> Slap Wrist if we're missing the proper creditation!

Whatever happened, I certainly knew nothing about MMC back then, and I
did a less than appropriate job at reviewing the patch.

I'm getting far more involved with MMC/SD/SDIO now so this issue will
get properly resolved.


Nicolas

2007-05-13 03:13:47

by Nicolas Pitre

[permalink] [raw]
Subject: [PATCH] fix PXA27x MMC workaround for bad CRC with 136 bit response

... and make it depend on the response flag instead of the command type.

Signed-off-by: Nicolas Pitre <[email protected]>
---

On Sat, 12 May 2007, Pierre Ossman wrote:
> Nicolas Pitre wrote:
> > Please apply the following patch. It is compile tested only as I don't
> > have PXA27x hardware with MMC at the moment, but it just cannot be worse
> > than the current code even when it was compiling.
> >
> >
>
> I would think that it would be better to look at just MMC_RSP_136 and
> MMC_RSP_CRC in case we get future variations.

Makes sense.

diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index d97d386..f8985c5 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -232,20 +232,14 @@ static int pxamci_cmd_done(struct pxamci_host *host, unsigned int stat)
/*
* workaround for erratum #42:
* Intel PXA27x Family Processor Specification Update Rev 001
+ * A bogus CRC error can appear if the msb of a 136 bit
+ * response is a one.
*/
- if (cmd->opcode == MMC_ALL_SEND_CID ||
- cmd->opcode == MMC_SEND_CSD ||
- cmd->opcode == MMC_SEND_CID) {
- /* a bogus CRC error can appear if the msb of
- the 15 byte response is a one */
- if ((cmd->resp[0] & 0x80000000) == 0)
- cmd->error = MMC_ERR_BADCRC;
- } else {
- pr_debug("ignoring CRC from command %d - *risky*\n",cmd->opcode);
- }
-#else
- cmd->error = MMC_ERR_BADCRC;
+ if (cmd->flags & MMC_RSP_136 && cmd->resp[0] & 0x80000000) {
+ pr_debug("ignoring CRC from command %d - *risky*\n", cmd->opcode);
+ } else
#endif
+ cmd->error = MMC_ERR_BADCRC;
}

pxamci_disable_irq(host, END_CMD_RES);

2007-05-13 16:00:38

by Pierre Ossman

[permalink] [raw]
Subject: Re: [PATCH] fix PXA27x MMC workaround for bad CRC with 136 bit response

Nicolas Pitre wrote:
> ... and make it depend on the response flag instead of the command type.
>
> Signed-off-by: Nicolas Pitre <[email protected]>
> ---
>

Fantastic. Applied.

Rgds

--
-- Pierre Ossman

Linux kernel, MMC maintainer http://www.kernel.org
PulseAudio, core developer http://pulseaudio.org
rdesktop, core developer http://www.rdesktop.org