linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: linux-hwmon@vger.kernel.org
Cc: Guenter Roeck <linux@roeck-us.net>,
	kernel test robot <lkp@intel.com>,
	Patrick Rudolph <patrick.rudolph@9elements.com>,
	Naresh Solanki <Naresh.Solanki@9elements.com>
Subject: [PATCH] hwmon: (pmbus/core) Request threaded interrupt with IRQF_ONESHOT
Date: Wed, 12 Apr 2023 11:22:12 -0700	[thread overview]
Message-ID: <20230412182212.2672455-1-linux@roeck-us.net> (raw)

0-day rightfully complains:

drivers/hwmon/pmbus/pmbus_core.c:3164:7-32: WARNING:
	Threaded IRQ with no primary handler requested without IRQF_ONESHOT
	(unless it is nested IRQ)

Without IRQF_ONESHOT, the primary interrupt may end up in a loop,
and the threaded interrupt handler may never execute. Request interrupt
with IRQF_ONESHOT and assume that the interrupt will cleared and re-enabled
by clearing the fault condition in the threaded interrupt handler.

Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/linux-hwmon/6436efbb.08+e+yEDqvRxvHDP%25lkp@intel.com/T/#u
Cc: Patrick Rudolph <patrick.rudolph@9elements.com>
Cc: Naresh Solanki <Naresh.Solanki@9elements.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
Patrick, Naresh: please let me know if this is the correct fix, or suggest
an alternative.

Thanks,
Guenter

 drivers/hwmon/pmbus/pmbus_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index 86cc8001a788..bf561277c430 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -3246,8 +3246,8 @@ static int pmbus_irq_setup(struct i2c_client *client, struct pmbus_data *data)
 	}
 
 	/* Register notifiers */
-	err = devm_request_threaded_irq(dev, client->irq, NULL, pmbus_fault_handler, 0,
-					"pmbus-irq", data);
+	err = devm_request_threaded_irq(dev, client->irq, NULL, pmbus_fault_handler,
+					IRQF_ONESHOT, "pmbus-irq", data);
 	if (err) {
 		dev_err(dev, "failed to request an irq %d\n", err);
 		return err;
-- 
2.39.2


                 reply	other threads:[~2023-04-12 18:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230412182212.2672455-1-linux@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=Naresh.Solanki@9elements.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=patrick.rudolph@9elements.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).