lib: sbi: Allow relaxed MMIO writes in device ipi_send() callback

Currently, we have a smp_wmb() between atomic_raw_set_bit() and
ipi_send() device callback whereas the MMIO writes done by the
device ipi_send() callback will also include a barrier.

We can avoid unnecessary/redundant barriers described above by
allowing relaxed MMIO writes in device ipi_send() callback. To
achieve this, we simply use  wmb() instead of smp_wmb() before
calling device ipi_send().

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reported-by: Bo Gan <ganboing@gmail.com>
This commit is contained in:
Anup Patel
2023-11-21 14:49:42 +05:30
committed by Anup Patel
parent 791704cd09
commit f520256d03
3 changed files with 14 additions and 7 deletions

View File

@@ -186,8 +186,8 @@ static void imsic_ipi_send(u32 hart_index)
}
if (regs->size && (reloff < regs->size))
writel(IMSIC_IPI_ID,
(void *)(regs->addr + reloff + IMSIC_MMIO_PAGE_LE));
writel_relaxed(IMSIC_IPI_ID,
(void *)(regs->addr + reloff + IMSIC_MMIO_PAGE_LE));
}
static struct sbi_ipi_device imsic_ipi_device = {