From: a0282524688@gmail.com
To: lee@kernel.org, Ming Yu <tmyu0@nuvoton.com>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Clark Williams <clrkwllms@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ming Yu <a0282524688@gmail.com>,
mfd@lists.linux.dev, linux-rt-devel@lists.linux.dev
Subject: [PATCH v10 05/13] mfd: nct6694: Drop the unused IRQ enable mask
Date: Wed, 18 Nov 2026 16:16:16 +0800 [thread overview]
Message-ID: <20261118081625.2399247-6-a0282524688@gmail.com> (raw)
In-Reply-To: <20261118081625.2399247-1-a0282524688@gmail.com>
From: Ming Yu <a0282524688@gmail.com>
The .irq_enable and .irq_disable callbacks only update the irq_enable
bitmask under irq_lock, which is a spinlock_t. Nothing ever reads that
bitmask, so the callbacks do not mask anything. They also take irq_lock
while the IRQ core holds desc->lock, a raw spinlock. On PREEMPT_RT this
is an invalid wait context.
Remove both callbacks, along with irq_enable and irq_lock, and keep
IRQCHIP_SKIP_SET_WAKE. Without .irq_disable, the IRQ core falls back to
lazy disable, and handle_simple_irq() keeps a disabled interrupt pending
instead of calling its handler. The behaviour is therefore unchanged.
Fixes: 51dad33ede63 ("mfd: Add core driver for Nuvoton NCT6694")
Signed-off-by: Ming Yu <a0282524688@gmail.com>
---
Changes in v10:
- New patch. Drop the .irq_enable/.irq_disable callbacks, which only
update a bitmask that is never read and take a spinlock_t while the
IRQ core holds the raw desc->lock (reported by Sashiko on v9 06/12
and 09/12).
drivers/mfd/nct6694.c | 25 -------------------------
include/linux/mfd/nct6694.h | 2 --
2 files changed, 27 deletions(-)
diff --git a/drivers/mfd/nct6694.c b/drivers/mfd/nct6694.c
index 6b8b951f0166..27e9effd68a7 100644
--- a/drivers/mfd/nct6694.c
+++ b/drivers/mfd/nct6694.c
@@ -19,7 +19,6 @@
#include <linux/mfd/nct6694.h>
#include <linux/module.h>
#include <linux/slab.h>
-#include <linux/spinlock.h>
#include <linux/usb.h>
static const struct mfd_cell nct6694_devs[] = {
@@ -250,31 +249,9 @@ static void usb_int_callback(struct urb *urb)
dev_warn(nct6694->dev, "Failed to resubmit urb, status %pe", ERR_PTR(ret));
}
-static void nct6694_irq_enable(struct irq_data *data)
-{
- struct nct6694 *nct6694 = irq_data_get_irq_chip_data(data);
- irq_hw_number_t hwirq = irqd_to_hwirq(data);
-
- guard(spinlock_irqsave)(&nct6694->irq_lock);
-
- nct6694->irq_enable |= BIT(hwirq);
-}
-
-static void nct6694_irq_disable(struct irq_data *data)
-{
- struct nct6694 *nct6694 = irq_data_get_irq_chip_data(data);
- irq_hw_number_t hwirq = irqd_to_hwirq(data);
-
- guard(spinlock_irqsave)(&nct6694->irq_lock);
-
- nct6694->irq_enable &= ~BIT(hwirq);
-}
-
static const struct irq_chip nct6694_irq_chip = {
.name = "nct6694-irq",
.flags = IRQCHIP_SKIP_SET_WAKE,
- .irq_enable = nct6694_irq_enable,
- .irq_disable = nct6694_irq_disable,
};
static int nct6694_irq_domain_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw)
@@ -356,8 +333,6 @@ static int nct6694_usb_probe(struct usb_interface *iface,
ida_init(&nct6694->canfd_ida);
ida_init(&nct6694->wdt_ida);
- spin_lock_init(&nct6694->irq_lock);
-
ret = devm_mutex_init(dev, &nct6694->access_lock);
if (ret)
goto err_ida;
diff --git a/include/linux/mfd/nct6694.h b/include/linux/mfd/nct6694.h
index 69e4652cf16c..2022b8fcc096 100644
--- a/include/linux/mfd/nct6694.h
+++ b/include/linux/mfd/nct6694.h
@@ -91,13 +91,11 @@ struct nct6694 {
struct ida wdt_ida;
struct irq_domain *domain;
struct mutex access_lock;
- spinlock_t irq_lock;
struct urb *int_in_urb;
struct usb_device *udev;
union nct6694_usb_msg *usb_msg;
void *data_buf;
__le32 *int_buffer;
- unsigned int irq_enable;
};
int nct6694_read_msg(struct nct6694 *nct6694, const struct nct6694_cmd_header *cmd_hd, void *buf);
--
2.34.1
next prev parent reply other threads:[~2026-11-18 8:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 8:16 [PATCH v10 00/13] mfd: nct6694: Refactor transport layer and add HIF (eSPI) support a0282524688
2026-11-18 8:16 ` [PATCH v10 01/13] mfd: nct6694: Validate the USB endpoints a0282524688
2026-11-18 8:16 ` [PATCH v10 02/13] mfd: nct6694: Check the length of received USB packets a0282524688
2026-11-18 8:16 ` [PATCH v10 03/13] mfd: nct6694: Ignore interrupts without a mapping a0282524688
2026-11-18 8:16 ` [PATCH v10 04/13] mfd: nct6694: Transfer data packets via a dedicated buffer a0282524688
2026-11-18 8:16 ` a0282524688 [this message]
2026-11-18 8:16 ` [PATCH v10 06/13] mfd: nct6694: Move module type macros to shared header a0282524688
2026-11-18 8:16 ` [PATCH v10 07/13] mfd: nct6694: Refactor USB-specific data into nct6694_usb_data a0282524688
2026-11-18 8:16 ` [PATCH v10 08/13] mfd: nct6694: Rename USB transport functions with _usb_ prefix a0282524688
2026-11-18 8:16 ` [PATCH v10 09/13] mfd: nct6694: Rename driver to nct6694-usb a0282524688
2026-11-18 8:16 ` [PATCH v10 10/13] mfd: nct6694: Extract core device management into a separate module a0282524688
2026-11-18 8:16 ` [PATCH v10 11/13] mfd: nct6694: Introduce regmap-based transport abstraction a0282524688
2026-11-18 8:16 ` [PATCH v10 12/13] mfd: nct6694: Add a Kconfig symbol for the USB transport a0282524688
2026-11-18 8:16 ` [PATCH v10 13/13] mfd: nct6694: Add Host Interface (HIF) eSPI transport driver a0282524688
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=20261118081625.2399247-6-a0282524688@gmail.com \
--to=a0282524688@gmail.com \
--cc=bigeasy@linutronix.de \
--cc=clrkwllms@kernel.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=mfd@lists.linux.dev \
--cc=rostedt@goodmis.org \
--cc=tmyu0@nuvoton.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
all inboxes | Powered by JetHome®