[RFC/PATCH] hwmon: fix common race conditions, batch 1

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

 



On Thu, Mar 06, 2008 at 09:06:09AM -0500, Mark M. Hoffman wrote:
> Hi Darrick:
> Notice how encode_temp() above is outside of the locked section.  It is
> instructive for potential reviewers of this patch series to see just how easy
> it is to miss these.

Yep...

> REG_CFG5 (from which temp_twos_complement is updated) is never written.  Do you
> really need to read that during every update?  If you move that one read into
> the init routine, that will instantly kill all the race conditions associated
> with temp_twos_complement (assuming the hardware does not modify this register
> behind our backs).  What do you think?

Correct, the hardware doesn't modify that register at all.  I see your
patch, so I'll have a look through that.

--D




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux