Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6798122rdb; Fri, 15 Dec 2023 08:33:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IExANQyrnPqTU1HtnY891TeJDa48LSCEnRhlhyaq3Y3ggJP1WPcf7rsmUpd1LJ+8X+iBVqD X-Received: by 2002:a05:6a20:7d8e:b0:18c:110e:c34e with SMTP id v14-20020a056a207d8e00b0018c110ec34emr7703710pzj.34.1702658038449; Fri, 15 Dec 2023 08:33:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702658038; cv=none; d=google.com; s=arc-20160816; b=a1ZSIYFgtKLdIGg6t7w+TJOtOGVY0Yle4sThEvIsEJHQK7XL0owlODfJGbcbZJmVZA AelwVeFYo64tdA9t13c6NTumz3kEvOHGf6ULcKYpa8B19MzRCqJxu2QiwK0IrWq/iENY R8YYb3WzELWG9i4ex6+83OXeRzlfkxZ5alnnejmtbl4E526pSu1VYGjmEuqbwMi2Epp4 Rz7I7DHhvhssc/ATByH7GlfNFmdE7E2lYYjcr/SMhQxiYSroQVVcA2baHN6MqE7Sx+9V tWXD1a2ZrWTZQDkQKY/s3i/qn80cyUyfCYWFTQWVZx+aRE6A4uSdfN+iK2eJqsC91GLA GTxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date; bh=z4IYxr745E/ZWNnxJt7tYn5z0Sm55A7ShK14bEo1iZo=; fh=4iHbZ733mqZc4Bx83AV0konbWC9aXbRvmPAEmCiuGYk=; b=XaK0Ku8OLIDuMAf0NL17kycHgiU4jFUzRY2GudEXNB5ey05TuDK61MXFSW7S3kfcH4 3HwIPHokUXwaAdY6DZzTUmMkRT/UdO5cPN2OUvEoaJ1MgAi9mSpmWcUVIedMJ2OLe+Pu wTZiSuWIUixV1nIw3APZNX9w68PbPEJhgmZ+R87fbmiOIUIT9Ri8jWJ3vIu0v0feRyGS 7Ks8I2imMgFpGurDg4+I+yhCz+eZttj2U4QtOq2uMd+V80N9f3lEuVyuqmB4LabkoeYA Sr+4sO4oPZMhQT8CIH6czJQw/dRskI3ajdOlyhTRnYPiV9MVxfquYOjUPaoXaKIlFmRV Ky2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1306-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1306-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h20-20020a056a00231400b006cef68cfbdbsi11081007pfh.189.2023.12.15.08.33.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 08:33:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1306-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1306-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1306-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EF50428930D for ; Fri, 15 Dec 2023 16:33:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D8F83F8E1; Fri, 15 Dec 2023 16:33:09 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37ADF3FE45; Fri, 15 Dec 2023 16:33:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4SsF9T2nGtz6J9hQ; Sat, 16 Dec 2023 00:31:57 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 20C23140390; Sat, 16 Dec 2023 00:33:03 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 15 Dec 2023 16:33:02 +0000 Date: Fri, 15 Dec 2023 16:33:01 +0000 From: Jonathan Cameron To: "Russell King (Oracle)" CC: , , , , , , , , , , , , , , Salil Mehta , Jean-Philippe Brucker , , , James Morse Subject: Re: [PATCH RFC v3 14/21] irqchip/gic-v3: Don't return errors from gic_acpi_match_gicc() Message-ID: <20231215163301.0000183a@Huawei.com> In-Reply-To: References: Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml100001.china.huawei.com (7.191.160.183) To lhrpeml500005.china.huawei.com (7.191.163.240) On Wed, 13 Dec 2023 12:50:23 +0000 Russell King (Oracle) wrote: > From: James Morse > > gic_acpi_match_gicc() is only called via gic_acpi_count_gicr_regions(). > It should only count the number of enabled redistributors, but it > also tries to sanity check the GICC entry, currently returning an > error if the Enabled bit is set, but the gicr_base_address is zero. > > Adding support for the online-capable bit to the sanity check > complicates it, for no benefit. The existing check implicitly > depends on gic_acpi_count_gicr_regions() previous failing to find > any GICR regions (as it is valid to have gicr_base_address of zero if > the redistributors are described via a GICR entry). > > Instead of complicating the check, remove it. Failures that happen > at this point cause the irqchip not to register, meaning no irqs > can be requested. The kernel grinds to a panic() pretty quickly. > > Without the check, MADT tables that exhibit this problem are still > caught by gic_populate_rdist(), which helpfully also prints what > went wrong: > | CPU4: mpidr 100 has no re-distributor! > > Signed-off-by: James Morse > Reviewed-by: Gavin Shan > Tested-by: Miguel Luis > Tested-by: Vishnu Pajjuri > Tested-by: Jianyong Wu > Signed-off-by: Russell King (Oracle) > --- > drivers/irqchip/irq-gic-v3.c | 18 ++++++------------ > 1 file changed, 6 insertions(+), 12 deletions(-) > > diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c > index 98b0329b7154..ebecd4546830 100644 > --- a/drivers/irqchip/irq-gic-v3.c > +++ b/drivers/irqchip/irq-gic-v3.c > @@ -2420,21 +2420,15 @@ static int __init gic_acpi_match_gicc(union acpi_subtable_headers *header, > > /* > * If GICC is enabled and has valid gicr base address, then it means > - * GICR base is presented via GICC > + * GICR base is presented via GICC. The redistributor is only known to > + * be accessible if the GICC is marked as enabled. If this bit is not > + * set, we'd need to add the redistributor at runtime, which isn't > + * supported. > */ > - if (acpi_gicc_is_usable(gicc) && gicc->gicr_base_address) { > + if (gicc->flags & ACPI_MADT_ENABLED && gicc->gicr_base_address) I was very vague in previous review. I think the reasons you are switching from acpi_gicc_is_useable(gicc) to the gicc->flags & ACPI_MADT_ENABLED needs calling out as I'm fairly sure that this point in the series at least acpi_gicc_is_usable is same as current upstream: static inline bool acpi_gicc_is_usable(struct acpi_madt_generic_interrupt *gicc) { return gicc->flags & ACPI_MADT_ENABLED; } > acpi_data.enabled_rdists++; > - return 0; > - } > > - /* > - * It's perfectly valid firmware can pass disabled GICC entry, driver > - * should not treat as errors, skip the entry instead of probe fail. > - */ > - if (!acpi_gicc_is_usable(gicc)) > - return 0; > - > - return -ENODEV; > + return 0; > } > > static int __init gic_acpi_count_gicr_regions(void)