diff options
author | Guenter Roeck <linux@roeck-us.net> | 2025-06-05 16:23:57 -0700 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2025-09-08 06:24:50 -0700 |
commit | 3ad2a7b9b15d5072139a20be84adb36776eb6c9b (patch) | |
tree | 1d73ea66f97741465d49c16bfc61213e2b9e00ea /rust/helpers/helpers.c | |
parent | 90bad684e9ac5ae435c2715fab36f6799849e800 (diff) |
hwmon: Serialize accesses in hwmon core
Implement locking in the hardware monitoring core for drivers using
the _with_info() API functions.
Most hardware monitoring drivers need to support locking to protect
against parallel accesses from userspace. With older API functions, such
locking had to be implemented in the driver code since sysfs attributes
were created by the driver. However, the _with_info() API creates sysfs
attributes in the hardware monitoring core. This makes it easy to move
the locking primitives into that code. This has the benefit of simplifying
driver code while at the same time reducing the risk of incomplete of bad
locking implementations in hardware monitoring drivers.
While this means that all accesses are forced to be synchronized, this
has little if any practical impact since accesses are expected to be low
frequency and are typically synchronized from userspace anyway since
only a single process is accessing the data. On top of that, many drivers
use regmap, which also has its own locking scheme and already serializes
accesses.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions