MMC OMAP driver
PATCH 3/5 MMC OMAP driver
Here are some misc fixes we've had in the OMAP tree. Might be worth testing them on other platforms too.
drivers/mmc/mmc.c +2 -1
@@ -704,6 +704,7 @@ static void mmc_power_up(struct mmc_hostint bit =fls (host->ocr_avail) -1 ; host->ios.vdd = bit; + host->ios.clock = host->f_min; host->ios.bus_mode =MMC_BUSMODE_OPENDRAIN ; host->ios.chip_select =MMC_CS_DONTCARE ; host->ios.power_mode =MMC_POWER_UP ;
@@ -712,7 +713,6 @@ static void mmc_power_up(struct mmc_hostmmc_delay (1 ); - host->ios.clock = host->f_min; host->ios.power_mode =MMC_POWER_ON ; host->ops->set_ios (host, &host->ios);
@@ -747,6 +747,7 @@ static int mmc_send_op_cond(struct mmc_hif (cmd.resp[0 ] &MMC_CARD_BUSY || ocr ==0 )break ; +mmc_delay (1 ); err =MMC_ERR_TIMEOUT ;mmc_delay (10 );
Quoted 16 lines · Anderson Briglia
Here are some misc fixes we've had in the OMAP tree. Might be worth testing them on other platforms too.
Index:
linux-2.6.15-mmc_omap/drivers/mmc/mmc.c
===================================================================drivers/mmc/mmc.c +1
-0@@ -704,6 +704,7 @@ static void mmc_power_up(struct mmc_hostint bit =fls (host->ocr_avail) -1 ; host->ios.vdd = bit; + host->ios.clock = host->f_min; host->ios.bus_mode =MMC_BUSMODE_OPENDRAIN ; host->ios.chip_select =MMC_CS_DONTCARE ; host->ios.power_mode =MMC_POWER_UP ;
drivers/mmc/mmc.c static void mmc_power_up(struct mmc_host · line 718
Quoted 7 lines
drivers/mmc/mmc.c +0
-1@@ -712,7 +713,6 @@ static void mmc_power_up(struct mmc_hostmmc_delay (1 ); - host->ios.clock = host->f_min; host->ios.power_mode =MMC_POWER_ON ; host->ops->set_ios (host, &host->ios);
Why? What you're doing there is enable the clock at the same time as the
power, instead of just the power first. To me, that seems less safe.
drivers/mmc/mmc.c static int mmc_send_op_cond(struct mmc_h · line 753
Quoted 8 lines
drivers/mmc/mmc.c +1
-0@@ -747,6 +747,7 @@ static int mmc_send_op_cond(struct mmc_hif (cmd.resp[0 ] &MMC_CARD_BUSY || ocr ==0 )break ; +mmc_delay (1 ); err =MMC_ERR_TIMEOUT ;mmc_delay (10 );
This seems particularly useless. Probably just a remnant from a separate mmc_delay() addition to the one that's in mainline now.
Rgds
Pierre
Quoted 2 lines · Anderson Briglia
Here are some misc fixes we've had in the OMAP tree. Might be worth testing them on other platforms too.
I've already provided feedback on this a year or so ago - and it annoys me that absolutely _nothing_ has happened as a result.
The quoted part of this patch is WRONG and will _NEVER_ be merged. You must NOT enable the clock until the power is stable. Maybe this is a cause of the problems that you're seeing with various cards, since you're not allowing them to reset correctly?
Fix this first, then re-test to see if every other fix you have is actually necessary.
Sorry, but not following the power up protocol invalidates all other testing wrt card initialisation behaviour.
Quoted 20 lines
Index:
linux-2.6.15-mmc_omap/drivers/mmc/mmc.c
===================================================================drivers/mmc/mmc.c +1
-1@@ -704,6 +704,7 @@ static void mmc_power_up(struct mmc_hostint bit =fls (host->ocr_avail) -1 ; host->ios.vdd = bit; + host->ios.clock = host->f_min; host->ios.bus_mode =MMC_BUSMODE_OPENDRAIN ; host->ios.chip_select =MMC_CS_DONTCARE ; host->ios.power_mode =MMC_POWER_UP ;@@ -712,7 +713,6 @@ static void mmc_power_up(struct mmc_hostmmc_delay (1 ); - host->ios.clock = host->f_min; host->ios.power_mode =MMC_POWER_ON ; host->ops->set_ios (host, &host->ios);
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core