public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* mtd permission denied
@ 2005-03-21 17:22 Mike Lee
  2005-03-22  2:49 ` mike
  2005-03-22  6:43 ` Aras Vaichas
  0 siblings, 2 replies; 4+ messages in thread
From: Mike Lee @ 2005-03-21 17:22 UTC (permalink / raw)
  To: linux-mtd

Hi all
  i tried to flash_erase and other flash_* tools to my mtd device, the
return value is permission denied, but i am already root login. I have
selected MTD_CHAR and MTD_BLOCK in kernel.  Do i miss somethings?

    My kernel version is 2.6.10, with cvs mtd patched.

Mike,Lee

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

* Re: mtd permission denied
  2005-03-21 17:22 mtd permission denied Mike Lee
@ 2005-03-22  2:49 ` mike
  2005-03-22  6:43 ` Aras Vaichas
  1 sibling, 0 replies; 4+ messages in thread
From: mike @ 2005-03-22  2:49 UTC (permalink / raw)
  To: linux-mtd

Hi all
    Also when i use jffs2 for data storage, i got these msg when 
mounting mtd. i have tried to erase and unlock the mtd , i got similar msg.

Erase at 0x00080000 failed immediately: -EROFS. Is the sector locked?
Erase at 0x00070000 failed immediately: -EROFS. Is the sector locked?
Erase at 0x00060000 failed immediately: -EROFS. Is the sector locked?
Erase at 0x00050000 failed immediately: -EROFS. Is the sector locked?
Erase at 0x00040000 failed immediately: -EROFS. Is the sector locked?
Erase at 0x00030000 failed immediately: -EROFS. Is the sector locked?
Erase at 0x00020000 failed immediately: -EROFS. Is the sector locked?
Erase at 0x00010000 failed immediately: -EROFS. Is the sector locked?
Erase at 0x000f0000 failed immediately: -EROFS. Is the sector locked?
Erase at 0x000e0000 failed immediately: -EROFS. Is the sector locked?
Erase at 0x000d0000 failed immediately: -EROFS. Is the sector locked?
Erase at 0x000c0000 failed immediately: -EROFS. Is the sector locked?
Erase at 0x000b0000 failed immediately: -EROFS. Is the sector locked?
Erase at 0x000a0000 failed immediately: -EROFS. Is the sector locked?
Erase at 0x00090000 failed immediately: -EROFS. Is the sector locked?

~ # flash_eraseall /dev/mtd4
flash_eraseall: /dev/mtd4: Permission denied
~ # flash_unlock /dev/mtd4
Could not open mtd device: /dev/mtd4
~ # mtd_debug info /dev/mtd4
mtd.type = MTD_NORFLASH
mtd.flags = MTD_ERASEABLE
mtd.size = 1048576 (1M)
mtd.erasesize = 65536 (64K)
mtd.oobblock = 0
mtd.oobsize = 0
mtd.ecctype = MTD_ECC_NONE
regions = 0

Thanks for helping
Mike,Lee


Mike Lee wrote:

>Hi all
>  i tried to flash_erase and other flash_* tools to my mtd device, the
>return value is permission denied, but i am already root login. I have
>selected MTD_CHAR and MTD_BLOCK in kernel.  Do i miss somethings?
>
>    My kernel version is 2.6.10, with cvs mtd patched.
>
>Mike,Lee
>
>______________________________________________________
>Linux MTD discussion mailing list
>http://lists.infradead.org/mailman/listinfo/linux-mtd/
>
>  
>

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

* Re: mtd permission denied
  2005-03-21 17:22 mtd permission denied Mike Lee
  2005-03-22  2:49 ` mike
@ 2005-03-22  6:43 ` Aras Vaichas
  2005-03-22 23:23   ` Aras Vaichas
  1 sibling, 1 reply; 4+ messages in thread
From: Aras Vaichas @ 2005-03-22  6:43 UTC (permalink / raw)
  To: linux-mtd

Mike Lee wrote:
> Hi all
>   i tried to flash_erase and other flash_* tools to my mtd device, the
> return value is permission denied, but i am already root login. I have
> selected MTD_CHAR and MTD_BLOCK in kernel.  Do i miss somethings?
> 
>     My kernel version is 2.6.10, with cvs mtd patched.
> 
> Mike,Lee

This is spookey, I just got the exact same problem at the same time(!)

I'm trying to write data to my Dataflash device, but I get a "permission 
denied" error whenever I try to fopen the file "/dev/mtd/2" to write the data 
into it. I can read data from it with no problems.

I have tried "mtd_debug write" and "flashcp" and they return permission denied 
as well. Am I missing something?

I am using 2.4.27-vrs1 with cvs mtd patched.

/root # mtd_debug info /dev/mtd/2
mtd.type = MTD_NORFLASH
mtd.flags = MTD_ERASEABLE
mtd.size = 786432 (768K)
mtd.erasesize = 1056 (1K)
mtd.oobblock = 0
mtd.oobsize = 0
mtd.ecctype = MTD_ECC_NONE
regions = 0

regards,

Aras Vaichas

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

* Re: mtd permission denied
  2005-03-22  6:43 ` Aras Vaichas
@ 2005-03-22 23:23   ` Aras Vaichas
  0 siblings, 0 replies; 4+ messages in thread
From: Aras Vaichas @ 2005-03-22 23:23 UTC (permalink / raw)
  To: linux-mtd

Aras Vaichas wrote:
> Mike Lee wrote:
> 
>> Hi all
>>   i tried to flash_erase and other flash_* tools to my mtd device, the
>> return value is permission denied, but i am already root login. I have
>> selected MTD_CHAR and MTD_BLOCK in kernel.  Do i miss somethings?
> This is spookey, I just got the exact same problem at the same time(!)
> 
> I'm trying to write data to my Dataflash device, but I get a "permission 
> denied" error whenever I try to fopen the file "/dev/mtd/2" to write the 
> data into it. I can read data from it with no problems.

Sorry to answer my owns post ... but Mike gave me a hint as to what the problem 
was.

Mike had MTD_WRITEABLE set in the mask_flags for his partitions, so they were 
read-only.

My "permission denied" was caused because I'd left the default Dataflash 
partition settings in at91_dataflash.c from the MTD backporting work I did last 
year. The default settings don't honour erase block boundaries and thus the 
partitions were being mounted "read only". Silly me didn't look at dmesg ...


regards,

Aras

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

end of thread, other threads:[~2005-03-22 23:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-21 17:22 mtd permission denied Mike Lee
2005-03-22  2:49 ` mike
2005-03-22  6:43 ` Aras Vaichas
2005-03-22 23:23   ` Aras Vaichas

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