mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
hwmon: chipcap2: enable IRQ processing when regulator is already enabled
cc2_enable() returns early when the regulator is already enabled.
This can happen if a previous regulator_disable() failed or if the
regulator was configured as always-on.
In this case, process_irqs remains false, causing the ready interrupt
to be ignored. Subsequent operations waiting for the ready completion
then time out.
Set process_irqs before returning when the regulator is already
enabled, so that the driver continues to process ready interrupts.
Fixes: 3af350929e ("hwmon: Add support for Amphenol ChipCap 2")
Cc: stable@vger.kernel.org
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20261014-chipcap2_locks-v3-7-27ebfc2c5b9e@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
4724ac5556
commit
d1ce827a9c
|
|
@ -120,8 +120,10 @@ static int cc2_enable(struct cc2_data *data)
|
|||
int ret;
|
||||
|
||||
/* exclusive regulator, check in case a disable failed */
|
||||
if (regulator_is_enabled(data->regulator))
|
||||
if (regulator_is_enabled(data->regulator)) {
|
||||
data->process_irqs = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* clear any pending completion */
|
||||
try_wait_for_completion(&data->complete);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user