MTD API locking and concurrency

Robert Jarzmik robert.jarzmik at free.fr
Tue Mar 13 01:45:24 EDT 2012


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. My wish would
be to use mutexes, but I have to be sure there is no interrupt path I have not
seen. The only thing I'm certain is that my MTD drivers doesn't handle
interrupts, so the interrupt won't come from him.

Is there a guarantee that mtd api functions are called with !in_interrupt() ?

Cheers.

-- 
Robert



More information about the linux-mtd mailing list