public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* JFFS2 NAND flash support
@ 2002-03-27 17:42 John Hall
  2002-03-27 18:16 ` Thomas Gleixner
  0 siblings, 1 reply; 11+ messages in thread
From: John Hall @ 2002-03-27 17:42 UTC (permalink / raw)
  To: linux-mtd

Hi,

I'm wanting to get JFFS2 to go on some NAND flash (it's actually
Smartmedia, but it's pretty much just NAND flash) with a 2.4.17 kernel.
I've adapted the NAND flash driver in the kernel tree and that now seems
to work for me.

The jffs2 stuff in my kernel sources doesn't seem very up to date so
I've got the latest CVS stuff. Which branch of cvs do I need to use?
Should I update the whole of the mtd subsystem or can I just use the
updated jffs2 stuff?

I also came across some problems with the existing NAND flash driver,
especially with erases. It doesn't seem to mark an erase as done,
  i.e. instr->state = MTD_ERASE_DONE;

Also, when doing an erase it obtains a spin lock that disables all
bottom halves from running. It holds this lock for the duration of the
erase, which is up to 4ms in the code - is this really a good idea? The
Smartmedia specs say that this delay can be up to 400ms! Definitely not
a good idea.

Regards,
John Hall

-- 
OptionExist Limited.
The Irwin Centre, Scotland Road, Dry Drayton, Cambridge. UK.
Tel: +44 (0)1954 211244, Fax: +44 (0)1954 211565
http://www.optionexist.co.uk/

^ permalink raw reply	[flat|nested] 11+ messages in thread
* RE: JFFS2 NAND flash support
@ 2002-03-28  9:41 John Hall
  2002-03-28 10:00 ` Thomas Gleixner
  0 siblings, 1 reply; 11+ messages in thread
From: John Hall @ 2002-03-28  9:41 UTC (permalink / raw)
  To: gleixner; +Cc: linux-mtd

On 27 March 2002 18:16 Thomas Gleixner <gleixner@autronix.de> wrote:

> > I've adapted the NAND flash driver in the kernel tree and 
> > that now seems
> > to work for me.

> maybe you have done duplicated work . See below.

> > The jffs2 stuff in my kernel sources doesn't seem very up to date so
> > I've got the latest CVS stuff. Which branch of cvs do I need to use?
> > Should I update the whole of the mtd subsystem or can I just use the
> > updated jffs2 stuff?

> The current developer branch. Take care there were a lot of changes in
> nand.c and hardware driver files. See nand.c / autcpu12.c Adaptions
> should made in hardware drivers like autcpu12 and not in nand.c If
> there's a neccecarity to do this, please contact me or David
> Woodhouse.

Which is the current development branch?

Our hardware interface is a btit weird (ALE and CLE are controlled by
address lines...). I also can get interrupts from the busy pin, so I've
changed the code so it doesn't do busy waits as nand.c does.

> > I also came across some problems with the existing NAND flash
> > driver, especially with erases. It doesn't seem to mark an erase as
> > done,
> >   i.e. instr->state = MTD_ERASE_DONE;

> It's fixed in CVS long ago

OK - I hadn't looked at the latest versions very carefully. Now I've
looked, I notice that if the erase fails the user callback is not
called. The documentation on the mtd website seems to imply that you
should set the status to FAILED and still call the callback. Is that
correct?

> > Also, when doing an erase it obtains a spin lock that disables all
> > bottom halves from running. It holds this lock for the duration of
> > the erase, which is up to 4ms in the code - is this really a good
> > idea? The Smartmedia specs say that this delay can be up to 400ms! 

> There's no better to ensure, that erase read and write can coexist at
> the moment. But you're invited to hack a better solution :)

But you're holding a spinlock to ensure that your driver doesn't get
re-entered. Why do bottom halves need to be disabled at all?

> I this a new card type ? All chips and card types I know, have maximum
> block erase times of 20ms.

I'm just going by the Smartmedia spec. It says the maximum erase time is
400ms.

Regards,
John Hall

^ permalink raw reply	[flat|nested] 11+ messages in thread
* RE: JFFS2 NAND flash support
@ 2002-03-28 17:23 John Hall
  2002-03-28 17:18 ` David Woodhouse
  0 siblings, 1 reply; 11+ messages in thread
From: John Hall @ 2002-03-28 17:23 UTC (permalink / raw)
  To: gleixner; +Cc: linux-mtd

On 27 March 2002 18:16 Thomas Gleixner <gleixner@autronix.de> wrote:

> > The jffs2 stuff in my kernel sources doesn't seem very up to date so
> > I've got the latest CVS stuff. Which branch of cvs do I need to use?
> > Should I update the whole of the mtd subsystem or can I just use the
> > updated jffs2 stuff?

> The current developer branch. Take care there were a lot of changes in
> nand.c and hardware driver files. See nand.c / autcpu12.c

I've tried compiling the latest stuff on the CVS trunk, but cannot get
JFFS2 to work. I've compiled it as a module, but when I try to load it I
get a whole load of messages about missing zlib_ symbols:

e.g.
/lib/modules/2.4.17-rmk5/kernel/fs/jffs2/jffs2.o: unresolved symbol
zlib_inflate

I'm guessing that the zlib code has been moved recently so it can be
shared across several modules in the kernel. I am using 2.4.17; what is
the best thing for me to do?

Regards,
John Hall

^ permalink raw reply	[flat|nested] 11+ messages in thread
[parent not found: <541025071C7AC24C84E9F82296BB9B950804CD@OPTEX1.optex.local>]
* RE: JFFS2 NAND flash support
@ 2002-04-02 14:56 John Hall
  0 siblings, 0 replies; 11+ messages in thread
From: John Hall @ 2002-04-02 14:56 UTC (permalink / raw)
  To: gleixner; +Cc: linux-mtd

On 28 March 2002 18:12 Thomas Gleixner <gleixner@autronix.de> wrote:

> > OK, I will take a look at the feasability of merging the two next
> > week after the holidays.

> I will check it in the next days too and will prepare the stuff,
> what's neccecary to support your hardware. This are only 3 things to
> do, IMHO
> 1. give the possibility to provide a hardware specific command write
> function
> 2. give the possibility to provide a hardware specific wait
> function,which can be interrupt driven, if the hardware has this
> feature.
> 3. rewrite the erase blocking
> Have a look in CVS after your Easter weekend. 

Thomas,

Have you made any progress on this? If not, then I am willing to start
making the changes myself. I've been looking through the code and
started to create a smartmedia hardware-specific file similar to spia.c.
A change that I need is a function in nand.c that fills in most of the
fields of the mtd, as an alternative to nand_scan. I have therefore
added a function nand_fillin_mtd that fills in the fields in the mtd
that are relevant to nand flash apart from those to do with its size.
nand_scan also calls this.

> > In your opinion, is the solution that I have chosen (an interrupt
> > handler which schedules a tasklet) the best one for handling erases?
> > It seems a little little untidy, because reads and writes are
> > handled differently since they are synchronous. I haven't done much
> > 2.4 development, so I'm still feeling my way.

> Yep, it's a nice feature at all. But we should keep the synchronous
> functions for read/write as the max. delay is less, than running
> through an interrupt handler.

You're right - the context switches would give too big an overhead.

Regards,
John Hall

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

end of thread, other threads:[~2002-04-02 14:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-27 17:42 JFFS2 NAND flash support John Hall
2002-03-27 18:16 ` Thomas Gleixner
2002-03-27 18:26   ` David Woodhouse
2002-03-27 19:10     ` Thomas Gleixner
  -- strict thread matches above, loose matches on Subject: below --
2002-03-28  9:41 John Hall
2002-03-28 10:00 ` Thomas Gleixner
2002-03-28 10:01   ` David Woodhouse
2002-03-28 17:23 John Hall
2002-03-28 17:18 ` David Woodhouse
     [not found] <541025071C7AC24C84E9F82296BB9B950804CD@OPTEX1.optex.local>
2002-03-28 18:12 ` Thomas Gleixner
2002-04-02 14:56 John Hall

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