public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Fix MTD device probing... (really)
@ 2005-01-24 23:39 Russell King
  2005-01-24 23:43 ` David Woodhouse
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King @ 2005-01-24 23:39 UTC (permalink / raw)
  To: dwmw2, linux-mtd

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.

--- orig/drivers/mtd/chips/gen_probe.c	Sat Oct 23 11:38:17 2004
+++ linux/drivers/mtd/chips/gen_probe.c	Mon Jan 24 22:54:38 2005
@@ -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;

-- 
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

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

* Re: Fix MTD device probing... (really)
  2005-01-24 23:39 Fix MTD device probing... (really) Russell King
@ 2005-01-24 23:43 ` David Woodhouse
  0 siblings, 0 replies; 3+ messages in thread
From: David Woodhouse @ 2005-01-24 23:43 UTC (permalink / raw)
  To: Russell King; +Cc: linux-mtd

On Mon, 2005-01-24 at 23:39 +0000, Russell King wrote:
> 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.

-- 
dwmw2

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

* Re: Fix MTD device probing... (really)
@ 2009-08-26 10:25 Guillaume LECERF
  0 siblings, 0 replies; 3+ messages in thread
From: Guillaume LECERF @ 2009-08-26 10:25 UTC (permalink / raw)
  To: linux-mtd

Hi all,

I'm experiencing a problem with a 16bit SST 39VF3201 flash chip (id
0x235b) that is misdetected as a 8bit SST 49LF080A (id 0x005b).
I found that this commit is the source of my problem :

On Mon Jan 24 18:39:41 EST 2005, Russell King wrote :
>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.
>
>--- orig/drivers/mtd/chips/gen_probe.c	Sat Oct 23 11:38:17 2004
>+++ linux/drivers/mtd/chips/gen_probe.c	Mon Jan 24 22:54:38 2005
>@@ -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;


Before this commit, genprobe_new_chip() started the detection on
CFI_DEVICETYPE_X32, then CFI_DEVICETYPE_X16, and CFI_DEVICETYPE_X8.
I understand why this commit is useful, but can't find a way (apart
from reverting this change locally) to handle both cases.

Could you help me with this ?

Thanks in advance.

-- 
Guillaume LECERF
GeeXboX developer - www.geexbox.org

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

end of thread, other threads:[~2009-08-26 10:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-24 23:39 Fix MTD device probing... (really) Russell King
2005-01-24 23:43 ` David Woodhouse
  -- strict thread matches above, loose matches on Subject: below --
2009-08-26 10:25 Guillaume LECERF

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