lkml.org 
[lkml]   [2011]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [v2 2/4] platform: (TS-5500) add GPIO support
On Tue, Aug 30, 2011 at 02:39:28PM -0400, Vivien Didelot wrote:
> On Mon, 29 Aug 2011 23:11:33 +0100,
> Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
> > On Fri, Aug 26, 2011 at 07:40:25PM -0400, Vivien Didelot wrote:
> > > + bitno = line_to_bit_map[offset];

> > > + mutex_lock(&drvdata->gpio_lock);
> > > + byte = inb(ioaddr);
> > > + mutex_unlock(&drvdata->gpio_lock);

> > Do you really need the lock to do a read?

> Is there any chance for this function to be preempted before reading the
> register, allowing a call to ts5500_gpio_direction_output to occur
> before ts5500_gpio_get is completed?

Yes, but if that happens the mutex isn't going to help at all as you can
also be prempted before taking the mutex or after dropping it (or before
or after the function call itself...).


\
 
 \ /
  Last update: 2011-08-30 20:43    [W:0.093 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site