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
Signature · 5 lines
-- Pierre Ossman Linux kernel, MMC maintainer http://www.kernel.org PulseAudio, core developer http://pulseaudio.org rdesktop, core developer http://www.rdesktop.org
Quoted 4 lines · Pierre Ossman
Linus, please pull from
git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc.gitfor-linus
*ping*
Signature · 5 lines
-- Pierre Ossman Linux kernel, MMC maintainer http://www.kernel.org PulseAudio, core developer http://pulseaudio.org rdesktop, core developer http://www.rdesktop.org
Quoted 7 lines · Pierre Ossman
Quoted 4 lines · Pierre Ossman
Linus, please pull from
git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc.gitfor-linus*ping*
*pong*.
Thanks for reminding me. I was away for a couple of days, missed some emails, just pulled and pushed out.
Linus
Quoted 5 lines · Pierre Ossman
Linus, please pull from
git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc.gitfor-linusto 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)
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of:
Quoted 10 lines · Russell King
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 oncedrivers/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?
Signature · 5 lines
-- Pierre Ossman Linux kernel, MMC maintainer http://www.kernel.org PulseAudio, core developer http://pulseaudio.org rdesktop, core developer http://www.rdesktop.org
Quoted 12 lines · Pierre Ossman
Quoted 10 lines · Russell King
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 oncedrivers/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)
Quoted 1 line
What are opcode defines doing in the driver?
See the comments immediately above and below its use.
Welcome to buggy hardware.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of:
Quoted 5 lines · Russell King
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?
Signature · 5 lines
-- Pierre Ossman Linux kernel, MMC maintainer http://www.kernel.org PulseAudio, core developer http://pulseaudio.org rdesktop, core developer http://www.rdesktop.org
Quoted 10 lines · Pierre Ossman
Quoted 3 lines · Russell King
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.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of:
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:
Quoted 15 lines · Pierre Ossman
Quoted 11 lines · Russell King
Quoted 10 lines
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 oncedrivers/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?
Quoted 9 lines · Pierre Ossman
Quoted 6 lines · Russell King
See the comments immediately above and below its use.
Welcome to buggy hardware.
Quoted 7 lines
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
Signature · 5 lines
-- Pierre Ossman Linux kernel, MMC maintainer http://www.kernel.org PulseAudio, core developer http://pulseaudio.org rdesktop, core developer http://www.rdesktop.org
Quoted 2 lines · Pierre Ossman
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.
Quoted 14 lines
Quoted 13 lines · Pierre Ossman
Quoted 6 lines · Russell King
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.
Quoted 5 lines
Quoted 3 lines
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
Quoted 6 lines · Nicolas Pitre
Quoted 2 lines · Pierre Ossman
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.
Quoted 8 lines
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.
Quoted 4 lines
Quoted 3 lines · Pierre Ossman
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.
---
drivers/mmc/host/pxamci.c +7 -12
@@ -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 );
Quoted 6 lines · Nicolas Pitre
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.
Quoted 5 lines
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
Signature · 5 lines
-- Pierre Ossman Linux kernel, MMC maintainer http://www.kernel.org PulseAudio, core developer http://pulseaudio.org rdesktop, core developer http://www.rdesktop.org
Quoted 10 lines · Pierre Ossman
Quoted 6 lines · Nicolas Pitre
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!
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of:
Quoted 5 lines · Russell King
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
PATCH 1/1 fix PXA27x MMC workaround for bad CRC with 136 bit response
In reply to Pierre Ossman... and make it depend on the response flag instead of the command type.
---
Quoted 9 lines · Pierre Ossman
Quoted 5 lines · Nicolas Pitre
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_136andMMC_RSP_CRCin case we get future variations.
Makes sense.
drivers/mmc/host/pxamci.c +6 -12
@@ -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 );
Re: [PATCH] fix PXA27x MMC workaround for bad CRC with 136 bit response
Quoted 5 lines · Nicolas Pitre
... and make it depend on the response flag instead of the command type.
Signed-off-by Nicolas Pitre <[email protected]>---
Fantastic. Applied.
Rgds
Signature · 5 lines
-- Pierre Ossman Linux kernel, MMC maintainer http://www.kernel.org PulseAudio, core developer http://pulseaudio.org rdesktop, core developer http://www.rdesktop.org