Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1851778ybg; Thu, 4 Jun 2020 22:26:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdoUCymELPwPrrzPxd9nJdk71AapQjp6hCjojrNCLxbR1eKLiV2vZ/wg+XsRjMx8dWlzhT X-Received: by 2002:a17:906:bcfc:: with SMTP id op28mr1690847ejb.237.1591334786861; Thu, 04 Jun 2020 22:26:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591334786; cv=none; d=google.com; s=arc-20160816; b=fqFJajR93zq7XKYwfh5UKUeSzgamUhVhTXTOvxz8yrw7JT6XF7nsosygTLnmzJbljA XdS1SaZyoI5qGo0H/RJKPTsv0Dsek3nYo665YgZFlidr2Ste82jBtZYN0JCmoqn0wgzw QpplaV6nqncDmYLeRQGkouvQooOfIevWMrNT+8aNA3mveuPNBIJ0R4DDuyhQsTzNFjLV PerRBvoM8jbfEOV1nl7myO3Pg6XDZV/53YjebJ6MBPeAqutKGZ9J8o7ZD8ndA7WQn4x7 OrzhHCSPb7tWWsMGRKjYoUelThHIK84iZDlzooI4l8LFIO/haLmWmAfgwWBjBawlTcOq lMtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=DX5cUwaRJf8fzWyA8K3KPTX1jFOE+LvqCjwxNAJgLTo=; b=OIvQjaRLBKkTto6pFdBIkhLnxKNb8fatYmfEuujS7+Ek3i8BjeJoWq2P/ADlzO7iqu 77xIigrlbF4BS7WXHxpYG0SUYgRpygvHZY9UZvLhTN7uy8PjTahxtY/NEL5Brlp6PVFE oAjv+x6783O10t0wD/wUnREm8Ranw+Qz81YsokWhYw41N0x0ezGZf7YNooeMfuG0eMRa 59xHvuiy3QRPPsmsFoEQqNq1Mjbc79H2xN4stwVeE8ziXk8agkGoAMZRSE1SYqcRPvv8 SvaVbygLnQ6EkRPJZDMbMuGyT3wNv0Cof0ZdN/QXx+tIZtLzk9Dpmg0zWE1oQVH08ETp Gcew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn1si3992345ejc.638.2020.06.04.22.26.01; Thu, 04 Jun 2020 22:26:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726024AbgFEFYE (ORCPT + 99 others); Fri, 5 Jun 2020 01:24:04 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:55712 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725280AbgFEFYD (ORCPT ); Fri, 5 Jun 2020 01:24:03 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 440F65EA5DFB85F80713; Fri, 5 Jun 2020 13:24:01 +0800 (CST) Received: from DESKTOP-8RFUVS3.china.huawei.com (10.173.222.27) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Fri, 5 Jun 2020 13:23:51 +0800 From: Zenghui Yu To: , , CC: , , , , , Zenghui Yu Subject: [PATCH] irqchip/gic-v4.1: Use readx_poll_timeout_atomic() to fix sleep in atomic Date: Fri, 5 Jun 2020 13:23:45 +0800 Message-ID: <20200605052345.1494-1-yuzenghui@huawei.com> X-Mailer: git-send-email 2.23.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.173.222.27] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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) -- 2.19.1