All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Hardware Monitoring <linux-hwmon@vger.kernel.org>
Cc: Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Dmitry Osipenko <digetx@gmail.com>
Subject: [PATCH 2/6] hwmon: (lm90) Re-enable interrupts after alert clears
Date: Tue, 11 Jan 2022 08:51:12 -0800	[thread overview]
Message-ID: <20220111165116.1298459-3-linux@roeck-us.net> (raw)
In-Reply-To: <20220111165116.1298459-1-linux@roeck-us.net>

If alert handling is broken, interrupts are disabled after an alert and
re-enabled after the alert clears. However, if there is an interrupt
handler, this does not apply if alerts were originally disabled and enabled
when the driver was loaded. In that case, interrupts will stay disabled
after an alert was handled though the alert handler even after the alert
condition clears. Address the situation by always re-enabling interrupts
after the alert condition clears if there is an interrupt handler.

Fixes: 2abdc357c55d9 ("hwmon: (lm90) Unmask hardware interrupt")
Cc: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/hwmon/lm90.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index cc5e48fe304b..e4ecf3440d7c 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -848,7 +848,7 @@ static int lm90_update_device(struct device *dev)
 		 * Re-enable ALERT# output if it was originally enabled and
 		 * relevant alarms are all clear
 		 */
-		if (!(data->config_orig & 0x80) &&
+		if ((client->irq || !(data->config_orig & 0x80)) &&
 		    !(data->alarms & data->alert_alarms)) {
 			if (data->config & 0x80) {
 				dev_dbg(&client->dev, "Re-enabling ALERT#\n");
-- 
2.33.0


  parent reply	other threads:[~2022-01-11 16:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11 16:51 [PATCH 0/6] hwmon: Fixes for lm90 driver Guenter Roeck
2022-01-11 16:51 ` [PATCH 1/6] hwmon: (lm90) Reduce maximum conversion rate for G781 Guenter Roeck
2022-01-11 16:51 ` Guenter Roeck [this message]
2022-01-15 20:09   ` [PATCH 2/6] hwmon: (lm90) Re-enable interrupts after alert clears Dmitry Osipenko
2022-01-11 16:51 ` [PATCH 3/6] hwmon: (lm90) Mark alert as broken for MAX6654 Guenter Roeck
2022-01-11 16:51 ` [PATCH 4/6] hwmon: (lm90) Mark alert as broken for MAX6680 Guenter Roeck
2022-01-11 16:51 ` [PATCH 5/6] hwmon: (lm90) Mark alert as broken for MAX6646/6647/6649 Guenter Roeck
2022-01-11 16:51 ` [PATCH 6/6] hwmon: (lm90) Fix sysfs and udev notifications Guenter Roeck
2022-01-15 20:33   ` Dmitry Osipenko
2022-01-15 20:41     ` Dmitry Osipenko
2022-01-15 21:11       ` Guenter Roeck
2022-01-16  8:14         ` Dmitry Osipenko
2022-01-16 15:58           ` Guenter Roeck
2022-01-16 18:20             ` Dmitry Osipenko

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=20220111165116.1298459-3-linux@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=digetx@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@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.