Search Linux Wireless

Re: [PATCH 2/2] enhance sysfs rfkill interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 12, 2010 at 09:57:43PM +0100, Florian Mickler wrote:
> On Fri, 12 Mar 2010 10:22:09 -0800
> Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx> wrote:
> 
> > On Fri, Mar 12, 2010 at 07:03:08PM +0100, florian@xxxxxxxxxxx wrote:
> > >  
> > > +static ssize_t rfkill_hard_show(struct device *dev,
> > > +				 struct device_attribute *attr,
> > > +				 char *buf)
> > > +{
> > > +	struct rfkill *rfkill = to_rfkill(dev);
> > > +	unsigned long flags;
> > > +	u32 state;
> > > +
> > > +	spin_lock_irqsave(&rfkill->lock, flags);
> > > +	state = rfkill->state;
> > > +	spin_unlock_irqrestore(&rfkill->lock, flags);
> > 
> > Why exactly is this lock needed?
> 
> The rfkill state is updated from multiple contexts... Am I overlooking
> smth obvious here?
> 

You are not updating but reading... Are you concerned about seeing
a partial write to u32? It does not happen.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux