[PATCH] mtd: add documentation about locking context of MTD API

Robert Jarzmik robert.jarzmik at free.fr
Wed Mar 21 16:20:10 EDT 2012


Artem Bityutskiy <dedekind1 at gmail.com> writes:

> On Mon, 2012-03-19 at 23:51 +0100, Robert Jarzmik wrote:
>> Richard Weinberger <richard at nod.at> writes:
>> 
>> > Am 19.03.2012 23:26, schrieb Robert Jarzmik:
>> >> Add a comment to mtd header for MTD drivers writters, so that they
>> >> know that each function in the MTD API, ie. in the mtd_info
>> >> structure, is called in a sleeping context.
>> >> 
>> >
>> > Why do we need this comment?
>> Because I was asked to, in [1].
>
> Well, Richard has a point :-)
Ok ... but I don't get it. I think it's because my previous statement "As a
driver writer, I'm always interested to know whether I can msleep() or not." is
not good enough ... Neither is my USB example (I was thinking of commit id
5e23e90f33888769ffe253663cc5f3ea0bb6da49 btw).

> But I guess you can simply write "may sleep" instead of "sleeping context". Or
> may be even use "may_sleep()" in the wrappers?
may_sleep() doesn't exist AFAIK. might_sleep() does exist, but it's already
mentioned in my patch, and because you're talking about may_sleep() while I used
might_sleep(), I'm confused.

Do you want me to take my patch and do a simple 's/in a sleeping context/and may
sleep/g', or is it more complicated ?

-- 
Robert



More information about the linux-mtd mailing list