Re: [PATCH v2 06/12] iio: st_sensors: Stop abusing mlock to ensure internal coherency

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

 



Hi Jonathan,

jic23@xxxxxxxxxx wrote on Sun, 6 Feb 2022 15:45:33 +0000:

> On Wed,  2 Feb 2022 15:02:02 +0100
> Miquel Raynal <miquel.raynal@xxxxxxxxxxx> wrote:
> 
> > An odr_lock has been introduced to protect local accesses to the odr
> > internal cache and ensure the cached value always reflected the actual
> > value. Using the mlock() for this purpose is no longer needed, so let's
> > drop these extra mutex_lock/unlock() calls.
> > 
> > Suggested-by: Jonathan Cameron <jic23@xxxxxxxxxx>
> > Cc: Denis Ciocca <denis.ciocca@xxxxxx>
> > Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>  
> 
> Obviously a different issue but all the write_raw() functions should
> use the pattern used in st_pressure_core.c and do early
> returns seeing as there doesn't seem to be any cleanup to do.

I honestly hesitated when dropping the mlocks there. I've done it in
v3, so that we don't hurt our eyes on this anymore :)

> 
> We can tidy that up in a follow up patch as I'm sure there are other
> areas in these drivers where direct returns would be nicer than
> what is there currently!

Thanks,
Miquèl




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux