MTD API locking and concurrency

Artem Bityutskiy dedekind1 at
Tue Mar 13 08:41:11 EDT 2012

On Tue, 2012-03-13 at 06:45 +0100, Robert Jarzmik wrote:
> Hi,
> I came across a concurrent usage of my MTD driver by UBIFS by doing
> an IOC_UBI_UPVOL. As my chip doesn't support multiple requests at a time, I need
> to protect the access to chip registers.
> I wonder if mtd api function can be called in interrupt context.

No, this is not explicitely documented and you are welcome to send a
patch which adds a comment to mtd.h, but all the MTD API functions are
supposed to be called from sleeping context. IOW, the caller should keep
in mind that these functions may sleep.

Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the linux-mtd mailing list