Skip to contentSkip to conversation

Fix MTD device probing... (really)

PATCH Russell King 2 participants 2 messages Jan 24, 2005 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Fix MTD device probing, trying larger numbers of chips before smaller numbers of chips across the bus width.

This means we'll avoid misdetecting a 2 x16 array as 1 x32 if the high 16-bits happen to read as zeros in the QRY area.

drivers/mtd/chips/gen_probe.c +1 -1
@@ -162,7 +162,7 @@ static int genprobe_new_chip(struct map_
 	int max_chips = map_bankwidth(map); /* And minimum 1 */
 	int nr_chips, type;
 
-	for (nr_chips = min_chips; nr_chips <= max_chips; nr_chips <<= 1) {
+	for (nr_chips = max_chips; nr_chips >= min_chips; nr_chips >>= 1) {
 
 		if (!cfi_interleave_supported(nr_chips))
 		    continue;
Signature · 4 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core
#1 lore raw
Quoted 5 lines · Russell King

Fix MTD device probing, trying larger numbers of chips before smaller numbers of chips across the bus width.

This means we'll avoid misdetecting a 2 x16 array as 1 x32 if the high 16-bits happen to read as zeros in the QRY area.

Looks obviously correct to me. Please commit it.

Signature · 1 line
dwmw2