From: "Jim Ramsay" <kernel@jimramsay.com>
To: "Thiago Galesi" <thiagogalesi@gmail.com>
Cc: "Linux Kernel" <linux-kernel@vger.kernel.org>
Subject: Re: Possible MTD bug in 2.6.15
Date: Sat, 22 Apr 2006 21:48:28 -0600 [thread overview]
Message-ID: <4789af9e0604222048g5a10b573pf687f137a2e99042@mail.gmail.com> (raw)
In-Reply-To: <82ecf08e0604221008ieb22a4cuc59be570cf025bba@mail.gmail.com>
On 22/04/06, Thiago Galesi <thiagogalesi@gmail.com> wrote:
> > > > Ok, a couple of comments/questions
> > > >
> > > > 1 - Wouldn't it be better to map all flash, and leave the unneeded
> > > > part as read only?
> >
> > In general, yes. But this should either be enforced somewhere nicer
> > (ie, die gracefully) so the kernel doesn't panic later, or be allowed
> > as in my patch.
>
> The fundamental problem there seems to be a mismatch between what is
> set by the user and what is read from the flash chip. As you mention
> in your first message, (what it came across is that) you don't have
> (physical / electrical) access to all the flash; not something I would
> recommend (that is, having limited electrical connection to the flash)
Yes, that is exactly what is going on - we have only have electrical
access to 32M of addresses regardless of the size of the actual chip
installed, and unfortunately I can't change that. However, it's not
really a problem from the electrical side of things - We can still
access the lowest 32M on the chip, just the highest address pin isn't
connected to anything.
> As for the options you propose - enforce and die gracefully (that is,
> if there is a size mismatch, warning and purposely not working) seems
> more correct than the second option.
I don't see why - The size mismatch doesn't prevent the flash chip
from functioning. Isn't it better to help things work in more
circumstances rather than in less?
And really, it's not a big stretch from what the code currently does
to what my patch changes. At this point in the code, we know for a
fact that we already have at least one flash chip. The math that's
going on here with the 'max_chips' variable is to check if there is
actually more than one physical chip implementing the entire reported
size. The only mistake is that the math goes too far, shifting the
count down to zero if the reported size is too small. This
'max_chips' should never be allowed to be lower than 1, because we
really do know that there is at least one flash chip.
I agree with you that it's probably "more correct" to actually specify
the real size of the chip in the 'map' struct before the CFI probe,
but I can't think of any reason why specifying a smaller size should
die (even gracefully) when it still works just fine.
Of course, maybe there are some models of flash chips where this
wouldn't work and a graceful prevention of this would be important.
But with our CFI-compliant chip, we don't see any problem with my
patch applied.
--
Jim Ramsay
"Me fail English? That's unpossible!"
next prev parent reply other threads:[~2006-04-23 3:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1145723704.3524.TMDA@mail.tag.jimramsay.com>
2006-04-22 16:49 ` Fw: " Jim Ramsay
2006-04-22 17:08 ` Thiago Galesi
2006-04-23 3:48 ` Jim Ramsay [this message]
2006-04-23 7:45 ` Jörn Engel
2006-04-19 16:49 Jim Ramsay
2006-04-19 17:06 ` Thiago Galesi
2006-04-19 17:43 ` Pekka Enberg
2006-05-30 12:30 ` David Woodhouse
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=4789af9e0604222048g5a10b573pf687f137a2e99042@mail.gmail.com \
--to=kernel@jimramsay.com \
--cc=linux-kernel@vger.kernel.org \
--cc=thiagogalesi@gmail.com \
/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
all inboxes | Powered by JetHome®