From: ebiederman@lnxi.com (Eric W. Biederman)
To: <linux-mtd@lists.infradead.org>
Subject: [RFC] refactoring MTD cmdset ops, jedec_probe, and cfi_probe
Date: 12 Jul 2004 21:13:11 -0600 [thread overview]
Message-ID: <m3vfgsmwfs.fsf@maxwell.lnxi.com> (raw)
Currently for NOR flash we have two general purpose probe
routines that cover almost every case: cfi_probe and jedec_probe.
cfi_probe was written first and it assumes that every command set
has a unique number. For CFI chips that appears to hold true
as the command set identifier is part of the interface. However
for devices detected by jedec_probe that is not quite true.
While all of the devices have command sets quite similar to those
supported by cfi_probe frequently there in not a one to one mapping of
functionality. The biggest differences are that many AMD command set
chips detected by jedec_probe do not support all of cfi_cmdset_0002,
and that several of the firmware hub based devices have weird offset
unlock registers, that cfi_cmdset_0001 does not support.
As more features are implemented and the mtd drivers are becoming
more widely used these semantic mismatches are beginning to cause
maintenance problems. Calling certain methods on chips
that do not support them could be quite error prone.
To remedy this I would like to have the probe functions fill in
not the CmdSet number but a structure full of function pointers.
And of course the upper layers need to be modified to cope.
Doing this refactoring will be a little bit painful but I don't see
any other way to keep the code base maintainable as our number
of supported chips grows.
I have both Intel and AMD chips to test against. CFI and non CFI
all being used as motherboard BIOS chips. So I should be able
to catch the vast majority of problems in testing. All but the
delicate chip interleave case, but I should not actually be touching
that part of the code, and at least I am aware of the issue.
Does anyone have any problems with this refactoring?
Eric
next reply other threads:[~2004-07-13 3:13 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-13 3:13 Eric W. Biederman [this message]
2004-07-13 6:25 ` [RFC] refactoring MTD cmdset ops, jedec_probe, and cfi_probe David Woodhouse
2004-07-13 7:05 ` Eric W. Biederman
2004-07-13 8:02 ` David Woodhouse
2004-07-13 14:23 ` Eric W. Biederman
2004-07-13 14:45 ` Thayne Harbaugh
2004-07-13 15:04 ` Eric W. Biederman
2004-07-13 15:21 ` Thayne Harbaugh
2004-07-13 15:40 ` Eric W. Biederman
2004-07-13 16:00 ` Eric W. Biederman
2004-07-14 5:44 ` Eric W. Biederman
2004-08-12 7:39 ` Eric W. Biederman
2004-07-13 15:25 ` Eric W. Biederman
2004-07-13 16:17 ` Josh Boyer
2004-08-12 7:13 ` Eric W. Biederman
2004-08-16 14:13 ` Josh Boyer
2004-07-13 16:36 ` Dan Post
2004-07-13 16:52 ` Nicolas Pitre
2004-07-13 17:33 ` Dan Post
2004-07-13 18:17 ` 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=m3vfgsmwfs.fsf@maxwell.lnxi.com \
--to=ebiederman@lnxi.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