diff options
author | Adam Wujek <dev_public@wujek.eu> | 2022-04-20 17:51:25 +0300 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2022-04-25 19:15:20 +0300 |
commit | 75d2b2b06bd8407d03a3f126bc8b95eb356906c7 (patch) | |
tree | 445fbf5e68b97a77275990fafa6213c3fcc88116 /Documentation/devicetree/bindings/hwmon | |
parent | 4aaaaf0f279836f06d3b9d0ffeec7a1e1a04ceef (diff) | |
download | linux-75d2b2b06bd8407d03a3f126bc8b95eb356906c7.tar.xz |
hwmon: (pmbus) disable PEC if not enabled
Explicitly disable PEC when the client does not support it.
The problematic scenario is the following. A device with enabled PEC
support is up and running and a kernel driver is loaded.
Then the driver is unloaded (or device unbound), the HW device
is reconfigured externally (e.g. by i2cset) to advertise itself as not
supporting PEC. Without a new code, at the second load of the driver
(or bind) the "flags" variable is not updated to avoid PEC usage. As a
consequence the further communication with the device is done with
the PEC enabled, which is wrong and may fail.
The implementation first disable the I2C_CLIENT_PEC flag, then the old
code enable it if needed.
Fixes: 4e5418f787ec ("hwmon: (pmbus_core) Check adapter PEC support")
Signed-off-by: Adam Wujek <dev_public@wujek.eu>
Link: https://lore.kernel.org/r/20220420145059.431061-1-dev_public@wujek.eu
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'Documentation/devicetree/bindings/hwmon')
0 files changed, 0 insertions, 0 deletions