Skip to contentSkip to conversation

irq-gic-v3-its: fix access width for gicr_syncr

PATCH Applied Heyi Guo 3 participants 3 messages Feb 25, 2020 – Mar 29, 2020

Subsystems (2)
lore
Share & tools
lore

Heyi Guo

author
#0 lore raw

PATCH 1/1 irq-gic-v3-its: fix access width for gicr_syncr

GICR_SYNCR is a 32bit register, so it is better to access it with 32bit access width, though we have not seen any real problem.

---
Cc: Marc Zyngier <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Jason Cooper <[email protected]>

---
 drivers/irqchip/irq-gic-v3-its.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-v3-its.c +1 -1
index 65a11257d220..5c6790e3bfbf 100644
@@ -1321,7 +1321,7 @@ static void lpi_write_config(struct irq_data *d, u8 clr, u8 set)
 
 static void wait_for_syncr(void __iomem *rdbase)
 {
-	while (gic_read_lpir(rdbase + GICR_SYNCR) & 1)
+	while (readl_relaxed(rdbase + GICR_SYNCR) & 1)
 		cpu_relax();
 }
 
Signature · 1 line
2.19.1
maintainer
#1 lore raw
Quoted 18 lines · Heyi Guo

GICR_SYNCR is a 32bit register, so it is better to access it with 32bit access width, though we have not seen any real problem.

---
Cc: Marc Zyngier <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Jason Cooper <[email protected]>

---
 drivers/irqchip/irq-gic-v3-its.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-v3-its.c +0 -0
index 65a11257d220..5c6790e3bfbf 100644

drivers/irqchip/irq-gic-v3-its.c static void lpi_write_config(struct irq_data *d, · line 1327

Quoted 8 lines
drivers/irqchip/irq-gic-v3-its.c +1 -1
@@ -1321,7 +1321,7 @@ static void lpi_write_config(struct irq_data *d,
 u8 clr, u8 set)
 
 static void wait_for_syncr(void __iomem *rdbase)
 {
-	while (gic_read_lpir(rdbase + GICR_SYNCR) & 1)
+	while (readl_relaxed(rdbase + GICR_SYNCR) & 1)
 		cpu_relax();
 }

Yup, nice catch. Looks like no implementation really cares about it, but still worth fixing.

I'll take it for 5.7.

Thanks,

        M.
Signature · 1 line
Jazz is not dead. It just smells funny...
merge bot Applied
#2 lore raw

[tip: irq/core] irqchip/gic-v3-its: Fix access width for gicr_syncr

In reply to Heyi Guo
The following commit has been merged into the irq/core branch of tip:

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

Commit-ID:     04d80dbe858d801efbecf3e5172b31b0a3757308
Gitweb:        https://git.kernel.org/tip/04d80dbe858d801efbecf3e5172b31b0a3757308
Author:        Heyi Guo <[email protected]>
AuthorDate:    Tue, 25 Feb 2020 17:00:23 +08:00
Committer:     Marc Zyngier <[email protected]>
CommitterDate: Sun, 08 Mar 2020 14:25:46 

irqchip/gic-v3-its: Fix access width for gicr_syncr

GICR_SYNCR is a 32bit register, so it is better to access it with 32bit access width, though we have not seen any real problem.

---
 drivers/irqchip/irq-gic-v3-its.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-v3-its.c +1 -1
index 83b1186..6bb2bea 100644
@@ -1321,7 +1321,7 @@ static void lpi_write_config(struct irq_data *d, u8 clr, u8 set)
 
 static void wait_for_syncr(void __iomem *rdbase)
 {
-	while (gic_read_lpir(rdbase + GICR_SYNCR) & 1)
+	while (readl_relaxed(rdbase + GICR_SYNCR) & 1)
 		cpu_relax();
 }