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

Currently, there are no barriers before or after the ipi_clear()
device callback which forces ipi_clear() device callback to always
use non-relaxed MMIO writes.

Instead of above, we use wmb() in after the ipi_clear() device
callback which pairs with the wmb() done before the ipi_send()
device callback. This also allows device ipi_clear() callback
to use relaxed MMIO writes.

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 15:52:17 +05:30
committed by Anup Patel
parent f520256d03
commit b70d6285f0
2 changed files with 15 additions and 3 deletions

View File

@@ -61,7 +61,7 @@ static void mswi_ipi_clear(u32 hart_index)
/* Clear ACLINT IPI */
msip = (void *)mswi->addr;
writel(0, &msip[sbi_hartindex_to_hartid(hart_index) -
writel_relaxed(0, &msip[sbi_hartindex_to_hartid(hart_index) -
mswi->first_hartid]);
}