]> www.infradead.org Git - users/jedix/linux-maple.git/commit
thermal: trip: Use READ_ONCE() for lockless access to trip properties
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 28 May 2024 16:52:13 +0000 (18:52 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 11 Jun 2024 19:06:44 +0000 (21:06 +0200)
commita52641bc6293a24f25956a597e7f32148b0e2bb8
tree4072e64c6d45ca89da601c3904911129ac7a7e2a
parent893bae92237d824334d68d6b67222aaf32e41458
thermal: trip: Use READ_ONCE() for lockless access to trip properties

When accessing trip temperature and hysteresis without locking, it is
better to use READ_ONCE() to prevent compiler optimizations possibly
affecting the read from being applied.

Of course, for the READ_ONCE() to be effective, WRITE_ONCE() needs to
be used when updating their values.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/thermal/thermal_sysfs.c
drivers/thermal/thermal_trip.c