Skip to contentSkip to conversation

MMC OMAP driver

PATCH In review Anderson Briglia 2 participants 2 messages Jan 31, 2006 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 5/5 MMC OMAP driver

This patch by Tuukka Tikkanen provides a write work-around for broken MMC cards that set READY_FOR_DATA when it's not set.

Signed-off-by Tuukka Tikkanen
drivers/mmc/Kconfig +8 -0
Index: linux-2.6.15-mmc_omap/drivers/mmc/Kconfig
===================================================================
@@ -29,6 +29,14 @@ config MMC_BLOCK
 	  mount the filesystem. Almost everyone wishing MMC support
 	  should say Y or M here.
 
+config MMC_BLOCK_BROKEN_RFD
+	boolean "Write work-around for incompatible cards"
+	depends on MMC_BLOCK
+	default n
+	help
+	  Say y here if your MMC card fails write operations. Some cards
+  	  lie about being ready to receive data while they actually are not.
+
 config MMC_ARMMMCI
 	tristate "ARM AMBA Multimedia Card Interface support"
 	depends on ARM_AMBA && MMC
drivers/mmc/mmc_block.c +7 -0
Index: linux-2.6.15-mmc_omap/drivers/mmc/mmc_block.c
===================================================================
@@ -234,6 +234,13 @@ static int mmc_blk_issue_rq(struct mmc_q
 				       req->rq_disk->disk_name, err);
 				goto cmd_err;
 			}
+#ifdef CONFIG_MMC_BLOCK_BROKEN_RFD
+			/* Work-around for broken cards setting READY_FOR_DATA
+			 * when not actually ready.
+			 */
+			if (R1_CURRENT_STATE(cmd.resp[0]) == 7)
+				cmd.resp[0] &= ~R1_READY_FOR_DATA;
+#endif
 		} while (!(cmd.resp[0] & R1_READY_FOR_DATA));
 
 #if 0
#1 lore raw

drivers/mmc/mmc_block.c static int mmc_blk_issue_rq(struct mmc_q · line 241

Quoted 1 line · Anderson Briglia
drivers/mmc/mmc_block.c +1 -0
+			if (R1_CURRENT_STATE(cmd.resp[0]) == 7)

Please use a define so I don't have to reach for a MMC spec when reading this.

Rgds
Pierre