* Restart problems after writing to mtdblock?
@ 2002-11-28 0:57 Paul Nash
2002-11-28 9:44 ` David Woodhouse
0 siblings, 1 reply; 7+ messages in thread
From: Paul Nash @ 2002-11-28 0:57 UTC (permalink / raw)
To: 'linux-mtd@lists.infradead.org'
On 2.4.18, we're experiencing a problem where if we write some partition
through /dev/mtdblock (by opening, writing and closing in code, not from the
shell) when we close the device (and it's corresponding mtdchar device) and
then call reboot() with the restart option, the syste fails to successfully
restart.
I'm quite certain that what's happening is the flash chip (intel 640J part,
1x16 arrangement) is not being taken out of Read Array mode, so the
bootloader can't fetch instructions. On our StrongARM board at the moment,
we don't have nRESET_OUT fed into the flash chip. We're investingating
that, but I would like to knoew the root cause.
What's really weird is that if I go to the shell and cat file >
/dev/mtdblock/<id> and then reboot via the same system call, everything
works fine. On the one hand, a bunch of syncs happen when busybox does the
reboot, but on the other hand, this particular partition is not a mounted
filesystem, and we tried inserting some sync() calls as well.
I notice that cfi_cmdset_0001.c, for instance, doesn't explicitly put the
chip into Read Array mode after completeing a buffer write or erase block
operation. The intel datasheet generally recommends this. Is there any
harm in it? It looks like maybe the driver waits until a read operation is
requested before doing this?
Help greatly appreciated...
-Paul
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: Restart problems after writing to mtdblock?
@ 2002-11-28 2:33 Paul Nash
2002-11-28 7:39 ` Jörn Engel
0 siblings, 1 reply; 7+ messages in thread
From: Paul Nash @ 2002-11-28 2:33 UTC (permalink / raw)
To: 'linux-mtd@lists.infradead.org'
Partially answering my question, it looks like I was partly correct. It
appears that MTD is setup to lazily delay a reset to read array mode until
an actual read request comes along. In my case, this is fatal.
I'm wondering if a reasonable solution is to do something like install a
reboot_notifier so I can guarantee the chip is back in Read Array mode.
Where would be a good place to do such a thing, or if this is a bad idea,
what is a better one? Thanks...
-Paul
-----Original Message-----
From: Paul Nash [mailto:paulnash@wildseed.com]
Sent: Wednesday, November 27, 2002 4:58 PM
To: 'linux-mtd@lists.infradead.org'
Subject: Restart problems after writing to mtdblock?
On 2.4.18, we're experiencing a problem where if we write some partition
through /dev/mtdblock (by opening, writing and closing in code, not from the
shell) when we close the device (and it's corresponding mtdchar device) and
then call reboot() with the restart option, the syste fails to successfully
restart.
I'm quite certain that what's happening is the flash chip (intel 640J part,
1x16 arrangement) is not being taken out of Read Array mode, so the
bootloader can't fetch instructions. On our StrongARM board at the moment,
we don't have nRESET_OUT fed into the flash chip. We're investingating
that, but I would like to knoew the root cause.
What's really weird is that if I go to the shell and cat file >
/dev/mtdblock/<id> and then reboot via the same system call, everything
works fine. On the one hand, a bunch of syncs happen when busybox does the
reboot, but on the other hand, this particular partition is not a mounted
filesystem, and we tried inserting some sync() calls as well.
I notice that cfi_cmdset_0001.c, for instance, doesn't explicitly put the
chip into Read Array mode after completeing a buffer write or erase block
operation. The intel datasheet generally recommends this. Is there any
harm in it? It looks like maybe the driver waits until a read operation is
requested before doing this?
Help greatly appreciated...
-Paul
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Restart problems after writing to mtdblock?
2002-11-28 2:33 Paul Nash
@ 2002-11-28 7:39 ` Jörn Engel
0 siblings, 0 replies; 7+ messages in thread
From: Jörn Engel @ 2002-11-28 7:39 UTC (permalink / raw)
To: Paul Nash; +Cc: linux-mtd
On Wed, 27 November 2002 18:33:31 -0800, Paul Nash wrote:
>
> Partially answering my question, it looks like I was partly correct. It
> appears that MTD is setup to lazily delay a reset to read array mode until
> an actual read request comes along. In my case, this is fatal.
>
> I'm wondering if a reasonable solution is to do something like install a
> reboot_notifier so I can guarantee the chip is back in Read Array mode.
> Where would be a good place to do such a thing, or if this is a bad idea,
> what is a better one? Thanks...
>
>> I'm quite certain that what's happening is the flash chip (intel 640J part,
>> 1x16 arrangement) is not being taken out of Read Array mode, so the
>> bootloader can't fetch instructions. On our StrongARM board at the moment,
>> we don't have nRESET_OUT fed into the flash chip. We're investingating
>> that, but I would like to knoew the root cause.
Frankly, if the hardware doesn't reset the flash chips on reboot, you
have broken hardware and have to deal with it.
A reboot_notifier would work, unless you have a power fail. Not good.
Hacking cfi_cmdset_0001.c to bring the chips back into read mode
whenever possible would work better, breaking only on power fail
during a write or erase operation. Still not good.
So, unless you want to live with the problem, there is no alternative
to fixing the hardware.
Jörn
--
You can't tell where a program is going to spend its time. Bottlenecks
occur in surprising places, so don't try to second guess and put in a
speed hack until you've proven that's where the bottleneck is.
-- Rob Pike
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Restart problems after writing to mtdblock?
2002-11-28 0:57 Restart problems after writing to mtdblock? Paul Nash
@ 2002-11-28 9:44 ` David Woodhouse
0 siblings, 0 replies; 7+ messages in thread
From: David Woodhouse @ 2002-11-28 9:44 UTC (permalink / raw)
To: Paul Nash; +Cc: 'linux-mtd@lists.infradead.org'
paulnash@wildseed.com said:
> On our StrongARM board at the moment, we don't have nRESET_OUT fed
> into the flash chip. We're investingating that, but I would like to
> knoew the root cause.
This kind of thing is usually caused by inappropriate use of drugs on the
part of the hardware designer, AFAICT.
paulnash@wildseed.com said:
> Partially answering my question, it looks like I was partly correct.
> It appears that MTD is setup to lazily delay a reset to read array
> mode until an actual read request comes along. In my case, this is
> fatal.
> I'm wondering if a reasonable solution is to do something like install
> a reboot_notifier so I can guarantee the chip is back in Read Array
> mode. Where would be a good place to do such a thing, or if this is a
> bad idea, what is a better one? Thanks...
It's been discussed before. IIRC the conclusion that it wouldn't be 100%
reliable, and it was better to fix the hardware and confiscate the drugs.
--
dwmw2
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: Restart problems after writing to mtdblock?
@ 2002-11-30 14:46 Paul Nash
2002-11-30 16:22 ` David Woodhouse
0 siblings, 1 reply; 7+ messages in thread
From: Paul Nash @ 2002-11-30 14:46 UTC (permalink / raw)
To: 'Jörn Engel'; +Cc: linux-mtd
Power fail is not a concern -- this only occurs in the case of a software
reboot of the chip without power loss. An external reset is not an issue.
Flash chips don't store state as to their last read mode across power
failure anyway.
-----Original Message-----
From: Jörn Engel [mailto:joern@wohnheim.fh-wedel.de]
Sent: Wednesday, November 27, 2002 11:39 PM
To: Paul Nash
Cc: linux-mtd@lists.infradead.org
Subject: Re: Restart problems after writing to mtdblock?
On Wed, 27 November 2002 18:33:31 -0800, Paul Nash wrote:
>
> Partially answering my question, it looks like I was partly correct.
> It appears that MTD is setup to lazily delay a reset to read array
> mode until an actual read request comes along. In my case, this is
> fatal.
>
Frankly, if the hardware doesn't reset the flash chips on reboot, you have
broken hardware and have to deal with it. A reboot_notifier would work,
unless you have a power fail. Not good.
Hacking cfi_cmdset_0001.c to bring the chips back into read mode whenever
possible would work better, breaking only on power fail during a write or
erase operation. Still not good.
So, unless you want to live with the problem, there is no alternative to
fixing the hardware.
Jörn
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Restart problems after writing to mtdblock?
2002-11-30 14:46 Paul Nash
@ 2002-11-30 16:22 ` David Woodhouse
0 siblings, 0 replies; 7+ messages in thread
From: David Woodhouse @ 2002-11-30 16:22 UTC (permalink / raw)
To: Paul Nash; +Cc: 'Jörn Engel', linux-mtd
paulnash@wildseed.com said:
> Power fail is not a concern -- this only occurs in the case of a
> software reboot of the chip without power loss. An external reset is
> not an issue. Flash chips don't store state as to their last read mode
> across power failure anyway.
I wouldn't swear to that. You could feasibly have a power outage long
enough to reset most of the board, but the flash chips don't draw much
power and could perhaps retain their state.
Unlikely perhaps, but I wouldn't declare it impossible.
--
dwmw2
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: Restart problems after writing to mtdblock?
@ 2002-12-02 9:34 Paul Nash
0 siblings, 0 replies; 7+ messages in thread
From: Paul Nash @ 2002-12-02 9:34 UTC (permalink / raw)
To: 'David Woodhouse'; +Cc: 'Jörn Engel', linux-mtd
A very good point, well taken. In the particular case of our board, a power
supply drop out supervisor will cause a hold-off period and the entire reset
system will likely chain off that, but that's pretty specific to our design.
Anyway, we're pursuing the obvious "right solution" and looking at other
mechanisms for interim fixes. Thanks all...
-----Original Message-----
From: David Woodhouse [mailto:dwmw2@infradead.org]
Sent: Saturday, November 30, 2002 8:23 AM
To: Paul Nash
Cc: 'Jörn Engel'; linux-mtd@lists.infradead.org
Subject: Re: Restart problems after writing to mtdblock?
paulnash@wildseed.com said:
> Power fail is not a concern -- this only occurs in the case of a
> software reboot of the chip without power loss. An external reset is
> not an issue. Flash chips don't store state as to their last read mode
> across power failure anyway.
I wouldn't swear to that. You could feasibly have a power outage long
enough to reset most of the board, but the flash chips don't draw much
power and could perhaps retain their state.
Unlikely perhaps, but I wouldn't declare it impossible.
--
dwmw2
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2002-12-02 9:04 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-28 0:57 Restart problems after writing to mtdblock? Paul Nash
2002-11-28 9:44 ` David Woodhouse
-- strict thread matches above, loose matches on Subject: below --
2002-11-28 2:33 Paul Nash
2002-11-28 7:39 ` Jörn Engel
2002-11-30 14:46 Paul Nash
2002-11-30 16:22 ` David Woodhouse
2002-12-02 9:34 Paul Nash
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox