Bug in mmc.c == stops eMMC toshiba from working - sector check not good

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Folks

Toshiba part eMMC -- 2GB fails in standard linux.  The part is NOT sector addressable yet linux tries to do this.  See incorrect code below in mmc.c and notes below

The tosbiha part HAS  ext_csd.sectors

from mmc.c
static int mmc_read_ext_csd(struct mmc_card *card)

if (card->ext_csd.rev >= 2) {
card->ext_csd.sectors =
ext_csd[EXT_CSD_SEC_CNT + 0] << 0 |
ext_csd[EXT_CSD_SEC_CNT + 1] << 8 |
ext_csd[EXT_CSD_SEC_CNT + 2] << 16 |
ext_csd[EXT_CSD_SEC_CNT + 3] << 24;
if (card->ext_csd.sectors)
mmc_card_set_blockaddr(card);
}

when set cause code in block.c to not make address byte oriented

static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
.....
                brq.cmd.arg = blk_rq_pos(req);
                if (!mmc_card_blockaddr(card))
                        brq.cmd.arg <<= 9;


The Toshiba card HAS ext_csd.sectors even though the CMD1 response says it does not do sector addressing -- returning the ocr register.

The Simplified Physical Layer Spec defines for the OCR register
bit 29 as reserved and bit 30 as CCS -- High Capacity Card

The JEDEC Standard No. 84-A43 defines the OCR register Table 31 (OCR Register)
bits 29 and 30
00 == byte mode
10 == sector mode


I can change the code to save the ocr on the CMD1 and use the value of bit 30 to select Sector Mode IF there is a sector table.   

Are there any other thoughts ?

regards,

Philip--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux