* MTD API locking and concurrency
@ 2012-03-13 5:45 Robert Jarzmik
2012-03-13 12:41 ` Artem Bityutskiy
2012-03-13 17:17 ` Mike Dunn
0 siblings, 2 replies; 3+ messages in thread
From: Robert Jarzmik @ 2012-03-13 5:45 UTC (permalink / raw)
To: Linux mtd
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: MTD API locking and concurrency
2012-03-13 5:45 MTD API locking and concurrency Robert Jarzmik
@ 2012-03-13 12:41 ` Artem Bityutskiy
2012-03-13 17:17 ` Mike Dunn
1 sibling, 0 replies; 3+ messages in thread
From: Artem Bityutskiy @ 2012-03-13 12:41 UTC (permalink / raw)
To: Robert Jarzmik; +Cc: Linux mtd
[-- Attachment #1: Type: text/plain, Size: 639 bytes --]
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
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: MTD API locking and concurrency
2012-03-13 5:45 MTD API locking and concurrency Robert Jarzmik
2012-03-13 12:41 ` Artem Bityutskiy
@ 2012-03-13 17:17 ` Mike Dunn
1 sibling, 0 replies; 3+ messages in thread
From: Mike Dunn @ 2012-03-13 17:17 UTC (permalink / raw)
To: linux-mtd
On 03/12/2012 10:45 PM, 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.
FYI, the nand infrastructure code handles this for its devices; see
nand_base.c::nand_get_device()
Mike
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-03-13 18:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-13 5:45 MTD API locking and concurrency Robert Jarzmik
2012-03-13 12:41 ` Artem Bityutskiy
2012-03-13 17:17 ` Mike Dunn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox