]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (nct6775) Fix platform driver suspend regression
authorZev Weiss <zev@bewilderbeest.net>
Wed, 10 Aug 2022 05:26:46 +0000 (22:26 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 10 Aug 2022 13:37:01 +0000 (06:37 -0700)
commit701f79403211c937e9f0821c7d11effa148726b5
tree97d59bedcf95242153ac19413e82955213bfe979
parent0dc2d277a3dea68fa59e2683b914ec76e6630bd0
hwmon: (nct6775) Fix platform driver suspend regression

Commit cc9732b7db32 ("hwmon: (nct6775) Split core and platform
driver") introduced a slight change in nct6775_suspend() in order to
avoid an otherwise-needless symbol export for nct6775_update_device(),
replacing a call to that function with a simple dev_get_drvdata()
instead.

As it turns out, there is no guarantee that nct6775_update_device()
is ever called prior to suspend. If this happens, the resume function
ends up writing bad data into the various chip registers, which results
in a crash shortly after resume.

To fix the problem, just add the symbol export and return to using
nct6775_update_device() as was employed previously.

Reported-by: Zoltán Kővágó <dirty.ice.hu@gmail.com>
Tested-by: Zoltán Kővágó <dirty.ice.hu@gmail.com>
Fixes: cc9732b7db32 ("hwmon: (nct6775) Split core and platform driver")
Cc: stable@kernel.org
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Link: https://lore.kernel.org/r/20220810052646.13825-1-zev@bewilderbeest.net
[groeck: Updated description]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/nct6775-core.c
drivers/hwmon/nct6775-platform.c
drivers/hwmon/nct6775.h