From: Javier Carrasco <javier.carrasco.cruz@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
Javier Carrasco <javier.carrasco.cruz@gmail.com>,
stable@vger.kernel.org
Subject: [PATCH v2 3/4] hwmon: chipcap2: enable IRQ processing when regulator is already enabled
Date: Sun, 23 Aug 2026 19:59:03 +0200 [thread overview]
Message-ID: <20260823-chipcap2_locks-v2-3-6a26c8e9e2fc@gmail.com> (raw)
In-Reply-To: <20260823-chipcap2_locks-v2-0-6a26c8e9e2fc@gmail.com>
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: 3af350929e75 ("hwmon: Add support for Amphenol ChipCap 2")
Cc: stable@vger.kernel.org
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
drivers/hwmon/chipcap2.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/hwmon/chipcap2.c b/drivers/hwmon/chipcap2.c
index 15630d1dd90a..57d22d65612c 100644
--- a/drivers/hwmon/chipcap2.c
+++ b/drivers/hwmon/chipcap2.c
@@ -119,8 +119,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);
--
2.43.0
next prev parent reply other threads:[~2026-08-23 17:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-23 17:59 [PATCH v2 0/4] hwmon: chipcap2: various bug fixes Javier Carrasco
2026-08-23 17:59 ` [PATCH v2 1/4] hwmon: chipcap2: fix channels in humidity alarm notifications Javier Carrasco
2026-08-23 18:11 ` sashiko-bot
2026-08-23 18:17 ` Javier Carrasco
2026-08-28 15:27 ` Guenter Roeck
2026-08-23 17:59 ` [PATCH v2 2/4] hwmon: chipcap2: fix IRQ teardown ordering Javier Carrasco
2026-08-23 18:12 ` sashiko-bot
2026-08-23 18:22 ` Javier Carrasco
2026-08-23 21:14 ` Javier Carrasco
2026-08-23 17:59 ` Javier Carrasco [this message]
2026-08-23 18:11 ` [PATCH v2 3/4] hwmon: chipcap2: enable IRQ processing when regulator is already enabled sashiko-bot
2026-08-23 19:13 ` Javier Carrasco
2026-08-23 17:59 ` [PATCH v2 4/4] hwmon: chipcap2: serialize access to low/high_alarm indicators Javier Carrasco
2026-08-23 18:06 ` sashiko-bot
2026-08-23 18:16 ` Javier Carrasco
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260823-chipcap2_locks-v2-3-6a26c8e9e2fc@gmail.com \
--to=javier.carrasco.cruz@gmail.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.