aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtish Patra <atish.patra@wdc.com>2019-01-21 17:54:00 -0800
committerAnup Patel <anup@brainfault.org>2019-01-22 10:03:49 +0530
commitbc545539d2f2842c12c8b16d898a21113ce70417 (patch)
tree8eb68c3b49d9bc27d4ea43fedbc96b05df254d77
parentb9c517f5593716d11013bef5fa25f037734327b7 (diff)
lib: Allow sending IPI to self.
S-mode software may send IPI to self. For example, tlbflush may be executed for the same hart. Let the hart send IPI to itself. It's an overhead but doesn't break anything. However, if we don't allow it, it breaks if S-mode keep sending IPIs. Signed-off-by: Atish Patra <atish.patra@wdc.com>
-rw-r--r--lib/sbi_ipi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sbi_ipi.c b/lib/sbi_ipi.c
index 1b74070..a612027 100644
--- a/lib/sbi_ipi.c
+++ b/lib/sbi_ipi.c
@@ -31,7 +31,7 @@ int sbi_ipi_send_many(struct sbi_scratch *scratch,
/* send IPIs to everyone */
for (i = 0, m = mask; m; i++, m >>= 1) {
- if ((m & 1) && (i != hartid) && !sbi_platform_hart_disabled(plat, hartid)) {
+ if ((m & 1) && !sbi_platform_hart_disabled(plat, hartid)) {
oth = sbi_hart_id_to_scratch(scratch, i);
atomic_raw_set_bit(event, &oth->ipi_type);
mb();