Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6502436ybe; Wed, 18 Sep 2019 04:43:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzenh5x+s1ekegbeMwACpnVfRbrA2ICQhbhm5kDFUQBiSPLXHJup0N8+xvdzxgKkmu8pq6V X-Received: by 2002:a17:906:f259:: with SMTP id gy25mr9293652ejb.2.1568807037445; Wed, 18 Sep 2019 04:43:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568807037; cv=none; d=google.com; s=arc-20160816; b=As06xYMzKd+RQMledQAgRWDHpFsQn0rxdAkwwGOCrbnSpdkhYIok0U2o20JzVEpxME 1Qu08M2qG6Mai9mpnF7GdDmqOHphd5doEWPb6X2VBBoyExZETh3x2q5xLbzoq7EeG8xG IYoTmz30QLR0vXAQ5FpNdEVdwH0vVz2dG4m8mKE3w5JQIuv/VMtnWsctsbgTHtWcyyDj uVuh1URS5UcCYzmbvOFy9V5RyKvmA7kBGQwL3PZl5D4eJDLcp91FaozJy3MdYt1AWWhu LNpktY3Z5ytH1JOVBtxCszv6qyNUxJVyIGShFZg50pNOL4oqJp1u/UeRSGRDAed/npf8 W2bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=tWdHtV4Gq2pDws7fpa9noIsctLO4f6YDNPxEo1cUkCc=; b=wkXe9OmV1gF1ZqNZ3JuDP5OZ+ggzdzA1EuQA7MMUNLbK3VQyK7i5KBWp7zAeBnYzVT kW6AeVW7QZn/ignuS87qnE9EwEz1I3GA73EF5vQvDAEYz8/ICPi2YKN0+ZqfqJBcTRpW hUPcyu40z//ZSseUIM9bM+NylSMsA5jGIn3lqOauuIPEvZS6MthpLjgwWM14vpV1ndui E+XcBa8yiL1nGBAPPkwWV269P4WEouKkCQRjf+b3JyA6VaXS/UCTRhjqCIDEoMMbBHPj EfPxj945f6AxrnSDuv9IgMrgflPOaR4bNPpfXl4x3hE3N6rkOIZvofxdSXAv16TQg7ZU iI1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y9si386768edv.405.2019.09.18.04.43.20; Wed, 18 Sep 2019 04:43:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727989AbfIRHBB (ORCPT + 99 others); Wed, 18 Sep 2019 03:01:01 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:35062 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726382AbfIRHBA (ORCPT ); Wed, 18 Sep 2019 03:01:00 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B6B8A44CFCDE8B773C2F; Wed, 18 Sep 2019 15:00:58 +0800 (CST) Received: from HGHY2Y004646261.china.huawei.com (10.184.12.158) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.439.0; Wed, 18 Sep 2019 15:00:51 +0800 From: Zenghui Yu To: CC: , , , , , Zenghui Yu Subject: [PATCH] irqchip/gic-v3: Fix GIC_LINE_NR accessor Date: Wed, 18 Sep 2019 06:57:30 +0000 Message-ID: <1568789850-14080-1-git-send-email-yuzenghui@huawei.com> X-Mailer: git-send-email 2.6.4.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.184.12.158] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As per GIC spec, ITLinesNumber indicates the maximum SPI INTID that the GIC implementation supports. And the maximum SPI INTID an implementation might support is 1019 (field value 11111). max(GICD_TYPER_SPIS(...), 1020) is not what we actually want for GIC_LINE_NR. Fix it to min(GICD_TYPER_SPIS(...), 1020). Signed-off-by: Zenghui Yu --- Hi Marc, I still see "GICv3: 992 SPIs implemented" on the host. I go back to https://patchwork.kernel.org/patch/11078623/ and it seems that we failed to make the GIC_LINE_NR correct at that time. drivers/irqchip/irq-gic-v3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 7b0c96b9e02f..f4a49aef5ca4 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -59,7 +59,7 @@ static struct gic_chip_data gic_data __read_mostly; static DEFINE_STATIC_KEY_TRUE(supports_deactivate_key); #define GIC_ID_NR (1U << GICD_TYPER_ID_BITS(gic_data.rdists.gicd_typer)) -#define GIC_LINE_NR max(GICD_TYPER_SPIS(gic_data.rdists.gicd_typer), 1020U) +#define GIC_LINE_NR min(GICD_TYPER_SPIS(gic_data.rdists.gicd_typer), 1020U) #define GIC_ESPI_NR GICD_TYPER_ESPIS(gic_data.rdists.gicd_typer) /* -- 2.19.1