lkml.org 
[lkml]   [2012]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [NEW DRIVER V1 5/7] DA9058 GPIO driver
On Mon, Aug 06, 2012 at 03:15:17PM +0000, Opensource [Anthony Olech] wrote:

> I do realize that REGMAP does locking on individual register accesses,
> however, the each GPIO line is controlled by 4-bits in a register, with
> the meaning of the most significant bit depending on the GPIO direction,
> so it is essential that the register be read first before do an update, thus
> two sequential register accesses must be protected by a mutex to
> prevent another process changing the register (and hence the meaning
> of the most-significant bit) in the middle of the two accesses.

> I hope this explains to your satisfaction why a driver mutex is required
> in addition to the regmap's register access mutex

This seems a bit excessive and complicated - I'd be inclined to either
just say that the caller is responsible for avoiding confusion here
(obviously if you're changing the direction there's a race anyway) or
store the data in a variable locally rather than having to do I/O on the
device under lock every time it's interacted with.


\
 
 \ /
  Last update: 2012-08-07 20:02    [W:0.079 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site