Accessing an MTD device from kernel space

Eisenhut, Daniel (MED) Daniel.Eisenhut at
Wed May 26 17:21:20 EDT 2004

To list,

I've successfully setup MTD devices for our NOR flash chips and
everything is working great from userspace.  But I have a need to access
the NOR flash from within kernelspace, such as in a /proc entry.

What is the best way to access the flash from within the kernel?  The
only way I've be able to so far is to just dereference a pointer
pointing to the flash address.  But this creates two issues (that I know

1. A race condition between my proc entry that reads the flash and
another process using the MTD device.

2. The MTD device does not always leave the flash chip in read mode.

Is there anything setup in the current MTD code to allow access from
within the kernel?


More information about the linux-mtd mailing list