mmc: ignore bad max block size in sdhci
From: David Vrabel
Date: Fri Aug 10 2007 - 08:26:25 EST
--
David Vrabel, Software Engineer, Drivers group Tel: +44 (0)1223 692562
CSR plc, Churchill House, Cambridge Business Park, Cowley Road, CB4 0WZ
.
mmc: ignore bad max block size in sdhci
Some SDHC cards report an invalid maximum block size, in these cases
assume they support block sizes up to 512 bytes instead of returning
an error.
Signed-off-by: David Vrabel <david.vrabel@xxxxxxx>
---
Index: mmc/drivers/mmc/host/sdhci.c
===================================================================
--- mmc.orig/drivers/mmc/host/sdhci.c 2007-08-10 01:15:54.000000000 +0100
+++ mmc/drivers/mmc/host/sdhci.c 2007-08-10 01:15:58.000000000 +0100
@@ -1344,12 +1344,11 @@
*/
mmc->max_blk_size = (caps & SDHCI_MAX_BLOCK_MASK) >> SDHCI_MAX_BLOCK_SHIFT;
if (mmc->max_blk_size >= 3) {
- printk(KERN_ERR "%s: Invalid maximum block size.\n",
+ printk(KERN_WARNING "%s: Invalid maximum block size, assuming 512\n",
host->slot_descr);
- ret = -ENODEV;
- goto unmap;
- }
- mmc->max_blk_size = 512 << mmc->max_blk_size;
+ mmc->max_blk_size = 512;
+ } else
+ mmc->max_blk_size = 512 << mmc->max_blk_size;
/*
* Maximum block count.