2024-05-30 00:53:17

by Samuel Holland

[permalink] [raw]
Subject: [PATCH] irqchip/gic: Use smp_wmb() instead of dmb(ishst)

This is equivalent on ARM, but also works on other architectures.

Signed-off-by: Samuel Holland <[email protected]>
---

drivers/irqchip/irq-gic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 98aa383e39db..dc2e4018a40c 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -839,7 +839,7 @@ static void gic_ipi_send_mask(struct irq_data *d, const struct cpumask *mask)
* Ensure that stores to Normal memory are visible to the
* other CPUs before they observe us issuing the IPI.
*/
- dmb(ishst);
+ smp_wmb();

/* this always happens on GIC0 */
writel_relaxed(map << 16 | d->hwirq, gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT);
--
2.44.1



2024-05-30 09:03:35

by Marc Zyngier

[permalink] [raw]
Subject: Re: [PATCH] irqchip/gic: Use smp_wmb() instead of dmb(ishst)

On Thu, 30 May 2024 01:52:30 +0100,
Samuel Holland <[email protected]> wrote:
>
> This is equivalent on ARM, but also works on other architectures.
>
> Signed-off-by: Samuel Holland <[email protected]>
> ---
>
> drivers/irqchip/irq-gic.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
> index 98aa383e39db..dc2e4018a40c 100644
> --- a/drivers/irqchip/irq-gic.c
> +++ b/drivers/irqchip/irq-gic.c
> @@ -839,7 +839,7 @@ static void gic_ipi_send_mask(struct irq_data *d, const struct cpumask *mask)
> * Ensure that stores to Normal memory are visible to the
> * other CPUs before they observe us issuing the IPI.
> */
> - dmb(ishst);
> + smp_wmb();
>
> /* this always happens on GIC0 */
> writel_relaxed(map << 16 | d->hwirq, gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT);

Equivalent, sure. But what does it gain us, given that the driver is
only compiled on ARM systems?

Additionally, you may also want to address the one in the hip04
driver, which has the same dmb instruction.

Thanks,

M.

--
Without deviation from the norm, progress is not possible.