Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pxamci: 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 <npitre@mvista.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>

authored by

Nicolas Pitre and committed by
Pierre Ossman
90e07d9f fe6b4c88

+6 -12
+6 -12
drivers/mmc/host/pxamci.c
··· 232 232 /* 233 233 * workaround for erratum #42: 234 234 * Intel PXA27x Family Processor Specification Update Rev 001 235 + * A bogus CRC error can appear if the msb of a 136 bit 236 + * response is a one. 235 237 */ 236 - if (cmd->opcode == MMC_ALL_SEND_CID || 237 - cmd->opcode == MMC_SEND_CSD || 238 - cmd->opcode == MMC_SEND_CID) { 239 - /* a bogus CRC error can appear if the msb of 240 - the 15 byte response is a one */ 241 - if ((cmd->resp[0] & 0x80000000) == 0) 242 - cmd->error = MMC_ERR_BADCRC; 243 - } else { 244 - pr_debug("ignoring CRC from command %d - *risky*\n",cmd->opcode); 245 - } 246 - #else 247 - cmd->error = MMC_ERR_BADCRC; 238 + if (cmd->flags & MMC_RSP_136 && cmd->resp[0] & 0x80000000) { 239 + pr_debug("ignoring CRC from command %d - *risky*\n", cmd->opcode); 240 + } else 248 241 #endif 242 + cmd->error = MMC_ERR_BADCRC; 249 243 } 250 244 251 245 pxamci_disable_irq(host, END_CMD_RES);