Possible MMC subsystem bug
Hi Andy,
I was going through the MMC code, trying to get Phison 8007 SD-to-NAND bridge working (don't ask please, this chip's sole existence defies any logic).
So, I found the following code and I was wondering if the following patch is not needed. Maybe my brain is just giving up though. Give it some thought please and let me know, thanks!
drivers/mmc/mmc.c +4 -1
@@ -475,8 +474,11 @@ static int sd_send_op_cond(struct mmc *mmc)if (err)return err; +if (!(cmd.response[0 ] &OCR_BUSY )) +break ; +udelay (1000 ); - }while ((!(cmd.response[0 ] &OCR_BUSY )) && timeout--); + }while (timeout--);if (timeout <=0 )return UNUSABLE_ERR ;
I'll need to double-check the spec, but I believe the BUSY bit has the opposite meaning of common sense.
Quoted 27 lines · Marek Vasut
Hi Andy,
I was going through the MMC code, trying to get Phison 8007 SD-to-NAND bridge working (don't ask please, this chip's sole existence defies any logic).
So, I found the following code and I was wondering if the following patch is not needed. Maybe my brain is just giving up though. Give it some thought please and let me know, thanks!
drivers/mmc/mmc.c +4
-1@@ -475,8 +474,11 @@ static int sd_send_op_cond(struct mmc *mmc)if (err)return err; +if (!(cmd.response[0 ] &OCR_BUSY )) +break ; +udelay (1000 ); - }while ((!(cmd.response[0 ] &OCR_BUSY )) && timeout--); + }while (timeout--);if (timeout <=0 )return UNUSABLE_ERR ;
Dear Fleming Andy-AFLEMING,
Quoted 2 lines
I'll need to double-check the spec, but I believe the BUSY bit has the opposite meaning of common sense.
I tihnk my brain is maybe just giving up really ... I think the code is right after some quick poking through the spec.
Quoted 25 lines · Marek Vasut
Quoted 24 lines
Hi Andy,
I was going through the MMC code, trying to get Phison 8007 SD-to-NAND bridge working (don't ask please, this chip's sole existence defies any logic).
So, I found the following code and I was wondering if the following patch is not needed. Maybe my brain is just giving up though. Give it some thought please and let me know, thanks!
drivers/mmc/mmc.c +3
-0@@ -475,8 +474,11 @@ static int sd_send_op_cond(struct mmc *mmc)if (err)return err; +if (!(cmd.response[0 ] &OCR_BUSY )) +break ; +
Quoted 8 lines
drivers/mmc/mmc.c static int sd_send_op_cond(struct mmc *mmc) · line 484
Quoted 8 lines
drivers/mmc/mmc.c +1
-1udelay (1000 ); - }while ((!(cmd.response[0 ] &OCR_BUSY )) && timeout--); + }while (timeout--);if (timeout <=0 )return UNUSABLE_ERR ;
Best regards,
Marek Vasut