mmc: Allow host drivers to specify max block count
Many controllers have an upper limit on the number of blocks that can be transferred in one request. Allow the host drivers to specify this and make sure we avoid hitting this limit. Also change the max_sectors field to avoid confusion. This makes it map less directly to the block layer limits, but as they didn't apply directly on MMC cards anyway, this isn't a great loss. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
This commit is contained in:
@@ -885,10 +885,13 @@ static int tifm_sd_probe(struct tifm_dev *sock)
|
||||
mmc->f_max = 24000000;
|
||||
mmc->max_hw_segs = 1;
|
||||
mmc->max_phys_segs = 1;
|
||||
mmc->max_sectors = 127;
|
||||
//2k maximum hw block length
|
||||
mmc->max_seg_size = mmc->max_sectors << 11;
|
||||
// limited by DMA counter - it's safer to stick with
|
||||
// block counter has 11 bits though
|
||||
mmc->max_blk_count = 256;
|
||||
// 2k maximum hw block length
|
||||
mmc->max_blk_size = 2048;
|
||||
mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
|
||||
mmc->max_seg_size = mmc->max_req_size;
|
||||
sock->signal_irq = tifm_sd_signal_irq;
|
||||
rc = tifm_sd_initialize_host(host);
|
||||
|
||||
|
Reference in New Issue
Block a user