Re: [PATCH v2 1/2] remgap: Fix possible sleep-in-atomic in regmap_bulk_write()

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

 



At Tue, 18 Mar 2014 13:04:26 +0000,
Mark Brown wrote:
> 
> On Tue, Mar 18, 2014 at 01:57:22PM +0100, Takashi Iwai wrote:
> > Mark Brown wrote:
> > > On Tue, Mar 18, 2014 at 12:58:33PM +0100, Takashi Iwai wrote:
> 
> > > > +		map->lock(map->lock_arg);
> > > >  		for (i = 0; i < val_count * val_bytes; i += val_bytes)
> > > >  			map->format.parse_inplace(wval + i);
> > > >  
> > > >  		ret = _regmap_raw_write(map, reg, wval, val_bytes * val_count);
> > > > +		map->unlock(map->lock_arg);
> 
> > > If we're reducing the locking region here then we should take the lock
> > > after doing the parse_inplace() to reduce the locked region.  Nothing
> > > else can be referring to the data since we only just allocated it.  I'll
> > > fix that by hand and apply.
> 
> > I thought of that, too, but didn't take it because covering the lock
> > there doesn't change the fact that it's still fundamentally racy.
> 
> I'm not sure what you mean here - what do you mean yb "covering the
> lock"?

I meant covering memcpy() and parse_inplace() & co in the lock.


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




[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux