[tip: irq/urgent] irqchip/gic-v4.1: Use readx_poll_timeout_atomic() to fix sleep in atomic

From: tip-bot2 for Zenghui Yu
Date: Tue Jun 30 2020 - 06:12:05 EST


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

Commit-ID: 31dbb6b1d025506b3b8b8b74e9b697df47b9f696
Gitweb: https://git.kernel.org/tip/31dbb6b1d025506b3b8b8b74e9b697df47b9f696
Author: Zenghui Yu <yuzenghui@xxxxxxxxxx>
AuthorDate: Fri, 05 Jun 2020 13:23:45 +08:00
Committer: Marc Zyngier <maz@xxxxxxxxxx>
CommitterDate: Sun, 21 Jun 2020 15:13:11 +01:00

irqchip/gic-v4.1: Use readx_poll_timeout_atomic() to fix sleep in atomic

readx_poll_timeout() can sleep if @sleep_us is specified by the caller,
and is therefore unsafe to be used inside the atomic context, which is
this case when we use it to poll the GICR_VPENDBASER.Dirty bit in
irq_set_vcpu_affinity() callback.

Let's convert to its atomic version instead which helps to get the v4.1
board back to life!

Fixes: 96806229ca03 ("irqchip/gic-v4.1: Add support for VPENDBASER's Dirty+Valid signaling")
Signed-off-by: Zenghui Yu <yuzenghui@xxxxxxxxxx>
Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx>
Link: https://lore.kernel.org/r/20200605052345.1494-1-yuzenghui@xxxxxxxxxx
---
drivers/irqchip/irq-gic-v3-its.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index cd685f5..6a5a87f 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -3797,10 +3797,10 @@ static void its_wait_vpt_parse_complete(void)
if (!gic_rdists->has_vpend_valid_dirty)
return;

- WARN_ON_ONCE(readq_relaxed_poll_timeout(vlpi_base + GICR_VPENDBASER,
- val,
- !(val & GICR_VPENDBASER_Dirty),
- 10, 500));
+ WARN_ON_ONCE(readq_relaxed_poll_timeout_atomic(vlpi_base + GICR_VPENDBASER,
+ val,
+ !(val & GICR_VPENDBASER_Dirty),
+ 10, 500));
}

static void its_vpe_schedule(struct its_vpe *vpe)