Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: bcm47xxpart: lower minimal blocksize to 4Ki (from 64Ki)
@ 2014-12-08 17:45 Rafał Miłecki
  2015-01-07 20:34 ` Brian Norris
  0 siblings, 1 reply; 2+ messages in thread
From: Rafał Miłecki @ 2014-12-08 17:45 UTC (permalink / raw)
  To: David Woodhouse, Artem Bityutskiy, Brian Norris, linux-mtd
  Cc: Hauke Mehrtens, Rafał Miłecki

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>
---
 drivers/mtd/bcm47xxpart.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/bcm47xxpart.c b/drivers/mtd/bcm47xxpart.c
index 26a4a4a..4ad3928 100644
--- a/drivers/mtd/bcm47xxpart.c
+++ b/drivers/mtd/bcm47xxpart.c
@@ -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,
-- 
1.8.4.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mtd: bcm47xxpart: lower minimal blocksize to 4Ki (from 64Ki)
  2014-12-08 17:45 [PATCH] mtd: bcm47xxpart: lower minimal blocksize to 4Ki (from 64Ki) Rafał Miłecki
@ 2015-01-07 20:34 ` Brian Norris
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Norris @ 2015-01-07 20:34 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Hauke Mehrtens, linux-mtd, David Woodhouse, Artem Bityutskiy

On Mon, Dec 08, 2014 at 06:45:00PM +0100, Rafał Miłecki wrote:
> 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>

Applied to l2-mtd.git. Thanks.

Brian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-07 20:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-08 17:45 [PATCH] mtd: bcm47xxpart: lower minimal blocksize to 4Ki (from 64Ki) Rafał Miłecki
2015-01-07 20:34 ` Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox