[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4a9822bd-0362-7ffe-6e56-3f05a7816d9e@huawei.com>
Date: Wed, 10 Jun 2020 21:59:17 +0800
From: Zenghui Yu <yuzenghui@...wei.com>
To: <maz@...nel.org>
CC: <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<kvmarm@...ts.cs.columbia.edu>, <tglx@...utronix.de>,
<jason@...edaemon.net>, <wanghaibin.wang@...wei.com>,
<wangjingyi11@...wei.com>
Subject: Re: [PATCH] irqchip/gic-v4.1: Use readx_poll_timeout_atomic() to fix
sleep in atomic
Hi Marc,
Sorry to ping you in the merge window, but ...
On 2020/6/5 13:23, Zenghui Yu wrote:
> 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.
this seems like an urgent thing to me. Without this patch, CPUs are
easily to get stuck on my board with GICv4.1 enabled. So it'd be good if
you can have a look and take this as a fix (if it is correct).
Thanks,
Zenghui
>
> 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@...wei.com>
> ---
> 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 cd685f521c77..6a5a87fc4601 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)
>
Powered by blists - more mailing lists