* Read only forced on jffs2 by mtd layer?
@ 2006-03-10 13:54 Adam Ward
2006-03-10 15:29 ` Nicolas Pitre
0 siblings, 1 reply; 12+ messages in thread
From: Adam Ward @ 2006-03-10 13:54 UTC (permalink / raw)
To: linux-mtd
Hi,
I'm working on a Sandgate2-P board on 2.6.15-4 kernel.
I was a little confused by the existence of mtd
initialisation code in /arch/arm/mach-pax/mainstone.c
which when duplicated for SG2-P failed to work.
So I realised that there was also
/devices/mtd/maps/mainstone-flash.c (and I had played
with this under 2.6.9 when it was pxa27x-flash.c)
which I again duplicated and have had some success
with.
But only to read!
My jffs2 image will mount as ro.
If I do 'mount / -o remount,rw' it appears to be
happy, but I soon get told 'Read-only file system' if
I try anything too presumptuous!
As running mount still declares it as read/write, I am
assuming the error is with the mtd block driver
refusing to co-operate.
Is there anything you guys can suggest that I should
pay closer attention to?
--
Adam
___________________________________________________________
NEW Yahoo! Cars - sell your car and browse thousands of new and used cars online! http://uk.cars.yahoo.com/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Read only forced on jffs2 by mtd layer?
2006-03-10 13:54 Read only forced on jffs2 by mtd layer? Adam Ward
@ 2006-03-10 15:29 ` Nicolas Pitre
2006-03-10 15:35 ` Josh Boyer
0 siblings, 1 reply; 12+ messages in thread
From: Nicolas Pitre @ 2006-03-10 15:29 UTC (permalink / raw)
To: Adam Ward; +Cc: linux-mtd
On Fri, 10 Mar 2006, Adam Ward wrote:
> My jffs2 image will mount as ro.
> If I do 'mount / -o remount,rw' it appears to be
> happy, but I soon get told 'Read-only file system' if
> I try anything too presumptuous!
>
> As running mount still declares it as read/write, I am
> assuming the error is with the mtd block driver
> refusing to co-operate.
>
> Is there anything you guys can suggest that I should
> pay closer attention to?
Did you unlock the flash partition with the flash_unlock tool?
Some NOR flash parts initialize themselves with all sectors locked by
default.
Nicolas
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Read only forced on jffs2 by mtd layer?
2006-03-10 15:29 ` Nicolas Pitre
@ 2006-03-10 15:35 ` Josh Boyer
2006-03-10 15:43 ` Artem B. Bityutskiy
2006-03-11 1:39 ` Adam Ward
0 siblings, 2 replies; 12+ messages in thread
From: Josh Boyer @ 2006-03-10 15:35 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: linux-mtd, Adam Ward
On 3/10/06, Nicolas Pitre <nico@cam.org> wrote:
> On Fri, 10 Mar 2006, Adam Ward wrote:
>
> > My jffs2 image will mount as ro.
> > If I do 'mount / -o remount,rw' it appears to be
> > happy, but I soon get told 'Read-only file system' if
> > I try anything too presumptuous!
> >
> > As running mount still declares it as read/write, I am
> > assuming the error is with the mtd block driver
> > refusing to co-operate.
> >
> > Is there anything you guys can suggest that I should
> > pay closer attention to?
>
> Did you unlock the flash partition with the flash_unlock tool?
> Some NOR flash parts initialize themselves with all sectors locked by
> default.
Also, does your JFFS2 filesystem have free space available? If a
minimum amount of free eraseblocks are not present, JFFS2 will mark
itself as read-only no matter what you do.
josh
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Read only forced on jffs2 by mtd layer?
2006-03-10 15:35 ` Josh Boyer
@ 2006-03-10 15:43 ` Artem B. Bityutskiy
2006-03-10 15:53 ` Josh Boyer
2006-03-11 1:39 ` Adam Ward
1 sibling, 1 reply; 12+ messages in thread
From: Artem B. Bityutskiy @ 2006-03-10 15:43 UTC (permalink / raw)
To: Josh Boyer; +Cc: linux-mtd, Nicolas Pitre, Adam Ward
Josh Boyer wrote:
> Also, does your JFFS2 filesystem have free space available? If a
> minimum amount of free eraseblocks are not present, JFFS2 will mark
> itself as read-only no matter what you do.
>
Hmm, is this sane behaviour?
--
Best Regards,
Artem B. Bityutskiy,
St.-Petersburg, Russia.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Read only forced on jffs2 by mtd layer?
2006-03-10 15:43 ` Artem B. Bityutskiy
@ 2006-03-10 15:53 ` Josh Boyer
2006-03-10 16:05 ` Artem B. Bityutskiy
0 siblings, 1 reply; 12+ messages in thread
From: Josh Boyer @ 2006-03-10 15:53 UTC (permalink / raw)
To: Artem B. Bityutskiy; +Cc: linux-mtd, Nicolas Pitre, Adam Ward
On 3/10/06, Artem B. Bityutskiy <dedekind@yandex.ru> wrote:
> Josh Boyer wrote:
> > Also, does your JFFS2 filesystem have free space available? If a
> > minimum amount of free eraseblocks are not present, JFFS2 will mark
> > itself as read-only no matter what you do.
> >
> Hmm, is this sane behaviour?
Sorta. If there isn't enough physical space to write nodes out, then
you can't really have a writeable filesystem. It'll actually just
return -ENOSPC for everything instead of -EROFS, but the effect is the
same.
Take a look at jffs2_calc_trigger_levels in build.c.
c->resv_blocks_deletion is the number of blocks needed to delete
something. c->resv_blocks_write is the number of blocks needed to
write something.
josh
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Read only forced on jffs2 by mtd layer?
2006-03-10 15:53 ` Josh Boyer
@ 2006-03-10 16:05 ` Artem B. Bityutskiy
2006-03-10 16:21 ` Josh Boyer
0 siblings, 1 reply; 12+ messages in thread
From: Artem B. Bityutskiy @ 2006-03-10 16:05 UTC (permalink / raw)
To: Josh Boyer; +Cc: linux-mtd, Adam Ward
Josh Boyer wrote:
> Sorta. If there isn't enough physical space to write nodes out, then
> you can't really have a writeable filesystem. It'll actually just
> return -ENOSPC for everything instead of -EROFS, but the effect is the
> same.
I mean, if I ask to mount read-write, but end-up with RO, this is bad.
Shouldn't I explicitely request RO mount?
> Take a look at jffs2_calc_trigger_levels in build.c.
> c->resv_blocks_deletion is the number of blocks needed to delete
> something. c->resv_blocks_write is the number of blocks needed to
> write something.
Ok, but where is the code that switches it to RO mode in case of lack of
eraseblocks?
--
Best Regards,
Artem B. Bityutskiy,
St.-Petersburg, Russia.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Read only forced on jffs2 by mtd layer?
2006-03-10 16:05 ` Artem B. Bityutskiy
@ 2006-03-10 16:21 ` Josh Boyer
2006-03-10 16:28 ` Artem B. Bityutskiy
2006-03-10 16:40 ` Nicolas Pitre
0 siblings, 2 replies; 12+ messages in thread
From: Josh Boyer @ 2006-03-10 16:21 UTC (permalink / raw)
To: Artem B. Bityutskiy; +Cc: linux-mtd, Adam Ward
On 3/10/06, Artem B. Bityutskiy <dedekind@yandex.ru> wrote:
> Josh Boyer wrote:
> > Sorta. If there isn't enough physical space to write nodes out, then
> > you can't really have a writeable filesystem. It'll actually just
> > return -ENOSPC for everything instead of -EROFS, but the effect is the
> > same.
> I mean, if I ask to mount read-write, but end-up with RO, this is bad.
> Shouldn't I explicitely request RO mount?
Oh, the mount will still show it as being RW from what I recall. But
you won't actually be able to write anything. Which is also
confusing. Especially in the case where it won't even let you
_delete_ things.
> > Take a look at jffs2_calc_trigger_levels in build.c.
> > c->resv_blocks_deletion is the number of blocks needed to delete
> > something. c->resv_blocks_write is the number of blocks needed to
> > write something.
> Ok, but where is the code that switches it to RO mode in case of lack of
> eraseblocks?
It doesn't do that. It just returns -ENOSPC. Sorry if I've confused anyone.
josh
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Read only forced on jffs2 by mtd layer?
2006-03-10 16:21 ` Josh Boyer
@ 2006-03-10 16:28 ` Artem B. Bityutskiy
2006-03-10 16:40 ` Nicolas Pitre
1 sibling, 0 replies; 12+ messages in thread
From: Artem B. Bityutskiy @ 2006-03-10 16:28 UTC (permalink / raw)
To: Josh Boyer; +Cc: Artem B. Bityutskiy, linux-mtd, Adam Ward
On Fri, 2006-03-10 at 10:21 -0600, Josh Boyer wrote:
> It doesn't do that. It just returns -ENOSPC. Sorry if I've confused anyone.
I have a feeling that it used to behave this way, not sure. Well, it
doesn't matter now.
--
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Read only forced on jffs2 by mtd layer?
2006-03-10 16:21 ` Josh Boyer
2006-03-10 16:28 ` Artem B. Bityutskiy
@ 2006-03-10 16:40 ` Nicolas Pitre
1 sibling, 0 replies; 12+ messages in thread
From: Nicolas Pitre @ 2006-03-10 16:40 UTC (permalink / raw)
To: Josh Boyer; +Cc: Artem B. Bityutskiy, linux-mtd, Adam Ward
On Fri, 10 Mar 2006, Josh Boyer wrote:
> On 3/10/06, Artem B. Bityutskiy <dedekind@yandex.ru> wrote:
> > Josh Boyer wrote:
> > > Sorta. If there isn't enough physical space to write nodes out, then
> > > you can't really have a writeable filesystem. It'll actually just
> > > return -ENOSPC for everything instead of -EROFS, but the effect is the
> > > same.
> > I mean, if I ask to mount read-write, but end-up with RO, this is bad.
> > Shouldn't I explicitely request RO mount?
>
> Oh, the mount will still show it as being RW from what I recall. But
> you won't actually be able to write anything. Which is also
> confusing. Especially in the case where it won't even let you
> _delete_ things.
Sure, but what is important here is the exact error returned, be it
-ENOSPC or -EROFS.
Nicolas
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Read only forced on jffs2 by mtd layer?
2006-03-10 15:35 ` Josh Boyer
2006-03-10 15:43 ` Artem B. Bityutskiy
@ 2006-03-11 1:39 ` Adam Ward
2006-03-11 6:37 ` Todd Poynor
1 sibling, 1 reply; 12+ messages in thread
From: Adam Ward @ 2006-03-11 1:39 UTC (permalink / raw)
To: Josh Boyer, Nicolas Pitre; +Cc: linux-mtd, Adam Ward
Not doing anything beyond what is there for the
Mainstone... I don't know enough about this!
Also, there is enough free space, I do not have any
problem under the 2.6.9 kernel.
There shouldn't be anything special about the hardware
, it uses a stacked SDRAM/flash part (RD38F4470LLYBH0)
but the flash is 2 * 28F256L18B - only difference
being it's 2 * 28F128L18B parts on the Mainstone. (I
think that's on C5 revision processor cards?)
Is anyone having better results with 2.6.15-4 on a
Mainstone?
I am wondering if the movement of configuration from
drivers/mtd/maps/mainstone-flash.c into
arch/arm/mach-pxa/mainstone.c being incomplete is
indicative of deeper changes that break the former,
but are not far enough to enable the later.
--- Josh Boyer <jwboyer@gmail.com> wrote:
> On 3/10/06, Nicolas Pitre <nico@cam.org> wrote:
> > On Fri, 10 Mar 2006, Adam Ward wrote:
> >
> > > My jffs2 image will mount as ro.
> > > If I do 'mount / -o remount,rw' it appears to be
> > > happy, but I soon get told 'Read-only file
> system' if
> > > I try anything too presumptuous!
> > >
> > > As running mount still declares it as
> read/write, I am
> > > assuming the error is with the mtd block driver
> > > refusing to co-operate.
> > >
> > > Is there anything you guys can suggest that I
> should
> > > pay closer attention to?
> >
> > Did you unlock the flash partition with the
> flash_unlock tool?
> > Some NOR flash parts initialize themselves with
> all sectors locked by
> > default.
>
> Also, does your JFFS2 filesystem have free space
> available? If a
> minimum amount of free eraseblocks are not present,
> JFFS2 will mark
> itself as read-only no matter what you do.
>
> josh
>
___________________________________________________________
Yahoo! Photos NEW, now offering a quality print service from just 8p a photo http://uk.photos.yahoo.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Read only forced on jffs2 by mtd layer?
2006-03-11 1:39 ` Adam Ward
@ 2006-03-11 6:37 ` Todd Poynor
2006-03-15 17:47 ` Adam Ward
0 siblings, 1 reply; 12+ messages in thread
From: Todd Poynor @ 2006-03-11 6:37 UTC (permalink / raw)
To: Adam Ward; +Cc: linux-mtd, Josh Boyer, Nicolas Pitre
Adam Ward wrote:
...
> but the flash is 2 * 28F256L18B - only difference
> being it's 2 * 28F128L18B parts on the Mainstone. (I
> think that's on C5 revision processor cards?)
The L18 StrataFlash chips featured on some Mainstone II boards do power
up with all blocks locked. Run flash_unlock on writeable partitions
prior to mounting.
--
Todd
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Read only forced on jffs2 by mtd layer?
2006-03-11 6:37 ` Todd Poynor
@ 2006-03-15 17:47 ` Adam Ward
0 siblings, 0 replies; 12+ messages in thread
From: Adam Ward @ 2006-03-15 17:47 UTC (permalink / raw)
To: Todd Poynor; +Cc: linux-mtd, Josh Boyer, Nicolas Pitre
Thanks for your help, that did the trick so I put in
some code to do the unlock, in the kernel map file.
I still had to do a remount, but a quick fiddle with
/etc/fstab and it's all how it should be.
Cheers guys,
Adam
--- Todd Poynor <tpoynor@mvista.com> wrote:
> Adam Ward wrote:
> ...
> > but the flash is 2 * 28F256L18B - only difference
> > being it's 2 * 28F128L18B parts on the Mainstone.
> (I
> > think that's on C5 revision processor cards?)
>
> The L18 StrataFlash chips featured on some Mainstone
> II boards do power
> up with all blocks locked. Run flash_unlock on
> writeable partitions
> prior to mounting.
>
> --
> Todd
>
___________________________________________________________
Yahoo! Photos NEW, now offering a quality print service from just 8p a photo http://uk.photos.yahoo.com
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2006-03-15 17:54 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-10 13:54 Read only forced on jffs2 by mtd layer? Adam Ward
2006-03-10 15:29 ` Nicolas Pitre
2006-03-10 15:35 ` Josh Boyer
2006-03-10 15:43 ` Artem B. Bityutskiy
2006-03-10 15:53 ` Josh Boyer
2006-03-10 16:05 ` Artem B. Bityutskiy
2006-03-10 16:21 ` Josh Boyer
2006-03-10 16:28 ` Artem B. Bityutskiy
2006-03-10 16:40 ` Nicolas Pitre
2006-03-11 1:39 ` Adam Ward
2006-03-11 6:37 ` Todd Poynor
2006-03-15 17:47 ` Adam Ward
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox