linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] iio: humidity: hdc100x: update driver locking
@ 2016-07-10 21:29 Alison Schofield
  2016-07-10 21:30 ` [PATCH 1/2] iio: humidity: hdc100x: move lock on config updates to single function Alison Schofield
  2016-07-10 21:31 ` [PATCH 2/2] iio: humidity: hdc100x: remove lock on heater configuration read Alison Schofield
  0 siblings, 2 replies; 4+ messages in thread
From: Alison Schofield @ 2016-07-10 21:29 UTC (permalink / raw)
  To: jic23; +Cc: mranostay, knaack.h, lars, pmeerw, linux-iio, linux-kernel

This patchset intends to tidy up the driver locking. 

The global data lock needs to to protect writes to the configuration
register and single channel reads which can be of temp or humidity.

First patch moves the config register locking to the config update
function.  This continues to protect updates to heater and integration
times. It puts the lock in one place, right where it needs to occur.

Second patch removes the lock on configuration reads of data stored
in global data.  While the write lock prevents two simultaneous writes
(ie. Heater and int_time) to the register, which could return false
success status, the read doesn't have the same issue.  You get the 
status at the moment, at it's guaranteed for that moment only.
This also aligns with drivers non-locking of other reads of global
data configuration status - ie integration time.
  
I believe these changes stand alone as good cleanups to the locking.
Alas, my ulterior motive is to prep it so that I can cleanly apply
the locks for triggered buffer mode.

 
Alison Schofield (2):
  iio: humidity: hdc100x: move lock on config updates to single function
  iio: humidity: hdc100x: remove lock on heater configuration read

 drivers/iio/humidity/hdc100x.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-16  5:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-10 21:29 [PATCH 0/2] iio: humidity: hdc100x: update driver locking Alison Schofield
2016-07-10 21:30 ` [PATCH 1/2] iio: humidity: hdc100x: move lock on config updates to single function Alison Schofield
2016-07-16  5:23   ` Alison Schofield
2016-07-10 21:31 ` [PATCH 2/2] iio: humidity: hdc100x: remove lock on heater configuration read Alison Schofield

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).