mtd: bcm47xxpart: lower minimal blocksize to 4Ki (from 64Ki)
authorRafał Miłecki <zajec5@gmail.com>
Mon, 8 Dec 2014 17:45:00 +0000 (18:45 +0100)
committerBrian Norris <computersforpeace@gmail.com>
Wed, 7 Jan 2015 20:24:19 +0000 (12:24 -0800)
Some devices like Netgear WNR1000v3 or WGR614v10 have partitions aligned
to 0x1000. Using bigger blocksize stopped us from detecting some parts.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/bcm47xxpart.c

index 26a4a4a4e8ab043b2f6695c4b91e63bce615305b..4ad392892b70bf3ec0041ef7a029586c69c90954 100644 (file)
@@ -94,8 +94,12 @@ static int bcm47xxpart_parse(struct mtd_info *master,
        int last_trx_part = -1;
        int possible_nvram_sizes[] = { 0x8000, 0xF000, 0x10000, };
 
-       if (blocksize <= 0x10000)
-               blocksize = 0x10000;
+       /*
+        * Some really old flashes (like AT45DB*) had smaller erasesize-s, but
+        * partitions were aligned to at least 0x1000 anyway.
+        */
+       if (blocksize < 0x1000)
+               blocksize = 0x1000;
 
        /* Alloc */
        parts = kzalloc(sizeof(struct mtd_partition) * BCM47XXPART_MAX_PARTS,