public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Scott Wood <scott@timesys.com>
To: linux-mtd@lists.infradead.org
Subject: [PATCH] Interleave order while probing
Date: Tue, 19 Oct 2004 17:03:33 -0400	[thread overview]
Message-ID: <20041019210333.GA15953@yoda.timesys> (raw)

The current 2.6 MTD code probes starting with minimal interleave.
This can result in false positives, if the flash happens to contain
zeroes at the QRY address.  For example, two interleaved 16-bit chips
can be detected as a non-interleaved 32-bit chip when only one of the
chips is put into read-CFI-query mode, and the "\0\0\0Q" that it gets
back is the same as what a real 32-bit chip would produce.

The patch below (against the latest MTD CVS snapshot) starts with the
highest interleave first; I don't think there are any situations
where that would produce a false positive (short of having QRY as the
actual flash data at the relevant addresses).

Signed-off-by: Scott Wood <scott.wood@timesys.com> under TS0068

diff -urN mtd.orig/drivers/mtd/chips/gen_probe.c mtd/drivers/mtd/chips/gen_probe.c
--- mtd.orig/drivers/mtd/chips/gen_probe.c	2004-08-14 18:00:11.000000000 -0400
+++ mtd/drivers/mtd/chips/gen_probe.c	2004-10-19 16:42:11.000000000 -0400
@@ -162,7 +162,7 @@
 	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;

             reply	other threads:[~2004-10-19 21:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-19 21:03 Scott Wood [this message]
2004-10-20 23:39 ` [PATCH] Interleave order while probing Christopher Hoover
2004-10-21  0:11   ` Nicolas Pitre
2004-10-21 16:04     ` Scott Wood
2004-10-21 16:15       ` Nicolas Pitre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041019210333.GA15953@yoda.timesys \
    --to=scott@timesys.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox