Skip to content

Commit

Permalink
mtd: bcm47xxpart: lower minimal blocksize to 4Ki (from 64Ki)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rafał Miłecki authored and Brian Norris committed Jan 7, 2015
1 parent bd10c26 commit 16bd87b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/mtd/bcm47xxpart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 16bd87b

Please sign in to comment.