Re: [PATCH 2/2] serdev: Add minimal bus locking API

From: Andrey Smirnov
Date: Thu Mar 16 2017 - 10:45:54 EST


On Tue, Mar 14, 2017 at 4:20 PM, Andy Shevchenko
<andy.shevchenko@xxxxxxxxx> wrote:
> On Tue, Mar 14, 2017 at 3:48 PM, Andrey Smirnov
> <andrew.smirnov@xxxxxxxxx> wrote:
>> Add minimal bus locking API which is useful for serial devices that
>> implement request-reply protocol
>
> Can you put an example here?
>
> I'm not sure mutex is needed at all.

My use case is a "supervisory" microcontroller connected to SoC via
UART various aspects of which are exposed via MFD. I saw this kind of
"device design pattern" a number of times in my career, so I thought
and abstraction to help dealing with cases like that might be useful.

However, since Rob mentioned that API's expectation is that any such
locking is driver's responsibility, I'll drop this patch.

Thanks,
Andrey Smirnov