mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Alexey Charkov" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Alexey Charkov <alchark@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: irq/drivers] irqchip/irq-vt8500: Split up ack/mask functions
Date: Tue, 06 May 2025 14:04:27 -0000	[thread overview]
Message-ID: <174654026763.406.1381391833665407399.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20250506-vt8500-intc-updates-v2-1-a3a0606cf92d@gmail.com>

The following commit has been merged into the irq/drivers branch of tip:

Commit-ID:     22111fdf11666e4ff2bb80481a874a6b958323f2
Gitweb:        https://git.kernel.org/tip/22111fdf11666e4ff2bb80481a874a6b958323f2
Author:        Alexey Charkov <alchark@gmail.com>
AuthorDate:    Tue, 06 May 2025 16:46:14 +04:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Tue, 06 May 2025 15:58:26 +02:00

irqchip/irq-vt8500: Split up ack/mask functions

vt8500_irq_mask() really does the ACK for edge triggered interrupts and the
MASK for level triggered interrupts.  Edge triggered interrupts never
really are masked as a result, and there is unnecessary reading of the
status register before the ACK even though it's write-one-to-clear.

Split it up into a proper standalone vt8500_irq_ack() and an unconditional
vt8500_irq_mask().

No Fixes tag added, as it has survived this way for 15 years and nobody
complained, so apparently nothing really used edge triggered interrupts
anyway.

[ tglx: Tabularize the irqchip struct initializer ]

Signed-off-by: Alexey Charkov <alchark@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250506-vt8500-intc-updates-v2-1-a3a0606cf92d@gmail.com
---
 drivers/irqchip/irq-vt8500.c | 40 +++++++++++++++++------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/irqchip/irq-vt8500.c b/drivers/irqchip/irq-vt8500.c
index e17dd3a..9fb9d37 100644
--- a/drivers/irqchip/irq-vt8500.c
+++ b/drivers/irqchip/irq-vt8500.c
@@ -67,25 +67,25 @@ struct vt8500_irq_data {
 static struct vt8500_irq_data intc[VT8500_INTC_MAX];
 static u32 active_cnt = 0;
 
-static void vt8500_irq_mask(struct irq_data *d)
+static void vt8500_irq_ack(struct irq_data *d)
 {
 	struct vt8500_irq_data *priv = d->domain->host_data;
 	void __iomem *base = priv->base;
 	void __iomem *stat_reg = base + VT8500_ICIS + (d->hwirq < 32 ? 0 : 4);
-	u8 edge, dctr;
-	u32 status;
-
-	edge = readb(base + VT8500_ICDC + d->hwirq) & VT8500_EDGE;
-	if (edge) {
-		status = readl(stat_reg);
-
-		status |= (1 << (d->hwirq & 0x1f));
-		writel(status, stat_reg);
-	} else {
-		dctr = readb(base + VT8500_ICDC + d->hwirq);
-		dctr &= ~VT8500_INT_ENABLE;
-		writeb(dctr, base + VT8500_ICDC + d->hwirq);
-	}
+	u32 status = (1 << (d->hwirq & 0x1f));
+
+	writel(status, stat_reg);
+}
+
+static void vt8500_irq_mask(struct irq_data *d)
+{
+	struct vt8500_irq_data *priv = d->domain->host_data;
+	void __iomem *base = priv->base;
+	u8 dctr;
+
+	dctr = readb(base + VT8500_ICDC + d->hwirq);
+	dctr &= ~VT8500_INT_ENABLE;
+	writeb(dctr, base + VT8500_ICDC + d->hwirq);
 }
 
 static void vt8500_irq_unmask(struct irq_data *d)
@@ -130,11 +130,11 @@ static int vt8500_irq_set_type(struct irq_data *d, unsigned int flow_type)
 }
 
 static struct irq_chip vt8500_irq_chip = {
-	.name = "vt8500",
-	.irq_ack = vt8500_irq_mask,
-	.irq_mask = vt8500_irq_mask,
-	.irq_unmask = vt8500_irq_unmask,
-	.irq_set_type = vt8500_irq_set_type,
+	.name		= "vt8500",
+	.irq_ack	= vt8500_irq_ack,
+	.irq_mask	= vt8500_irq_mask,
+	.irq_unmask	= vt8500_irq_unmask,
+	.irq_set_type	= vt8500_irq_set_type,
 };
 
 static void __init vt8500_init_irq_hw(void __iomem *base)

  reply	other threads:[~2025-05-06 14:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-06 12:46 [PATCH v2 0/5] irqchip/irq-vt8500: Cleanups and fixes for the irq-vt8500 driver Alexey Charkov
2025-05-06 12:46 ` [PATCH v2 1/5] irqchip/irq-vt8500: Split up ack/mask functions Alexey Charkov
2025-05-06 14:04   ` tip-bot2 for Alexey Charkov [this message]
2025-05-06 12:46 ` [PATCH v2 2/5] irqchip/irq-vt8500: Drop redundant copy of the device node pointer Alexey Charkov
2025-05-06 14:04   ` [tip: irq/drivers] " tip-bot2 for Alexey Charkov
2025-05-06 12:46 ` [PATCH v2 3/5] irqchip/irq-vt8500: Don't require 8 interrupts from a chained controller Alexey Charkov
2025-05-06 14:04   ` [tip: irq/drivers] " tip-bot2 for Alexey Charkov
2025-05-06 12:46 ` [PATCH v2 4/5] irqchip/irq-vt8500: Use a dedicated chained handler function Alexey Charkov
2025-05-06 14:04   ` [tip: irq/drivers] " tip-bot2 for Alexey Charkov
2025-05-06 12:46 ` [PATCH v2 5/5] irqchip/irq-vt8500: Use fewer global variables and add error handling Alexey Charkov
2025-05-06 14:04   ` [tip: irq/drivers] " tip-bot2 for Alexey Charkov

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=174654026763.406.1381391833665407399.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=alchark@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@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 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®