Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3968227rdb; Thu, 14 Sep 2023 08:05:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFgKlz4MDxXIs8WtgEZ4b1LGtrecQ9OSkLmrgBjmuKKioJ+bMtsvOglHy3ZmDQL7nMIkpx8 X-Received: by 2002:a17:902:c24c:b0:1bf:5df2:8e97 with SMTP id 12-20020a170902c24c00b001bf5df28e97mr5837818plg.4.1694703900724; Thu, 14 Sep 2023 08:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694703900; cv=none; d=google.com; s=arc-20160816; b=qhVpQDhcF7z+ieSyVOov55gKiJz61m/9udCEEp92b7VGO/kalJoY4L8Hcn4vKhB1d5 1CRKS6AG7un1DGeYE78WkC5qrfZurQ9UgPJxCYY7rp68FCmh9Xaqw8KX92RICjnAXy/E nCi+iqHveaVzEPPZoyh0fehfTvNHTyQHVJ/o6QPIum27b9gKSz4i7ZV8pAnpF+dY2AZb r0bK3TonOWZOPMVCusT9ixprL7B47mcihsdzPT3suav4zTjeXbMiecY355UUSTYkWPek C9S9e6cn3o6UrotUJlZNLUsjcZzM+naL2Se00ib2VqyX9kX8HBz27mA5sDlNniLyS45G taQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=2u0bmqOAV7ffa88cWxhSzEjoCrO7v9pRE62/b1S8XpU=; fh=oO43h3w0Gnh1/uzgjBLTRg+oe1Gv6aFHPIod5z8aS5s=; b=uwNS+Ao5+32+mv39Mb/DQoZCk5PdxIN3S070urTeAeKkwfeeRaj/uSZZjb7pUltpYx K5eD1NUsrDvpuEeOI3W/Y4ARkc02ghYbLVqe94hNsJlRoe4kQCUr3Xy3kjUmFEEGgatj 76F1k6BJJLJ5wbk8rABX+YXi0cwVWnObmqybDE+AXjkQeK8g9OdxuU9yBD90ZHaserAu MsIEqCAFlt/73TeCxU4tGlrG6jmMSb7LtdA270QB2BN77G5Y0NkYcXy5JSF/U6/+IVdm MXjENNRMYq81hqmwjVWxCBhJq2cJJSAK0RWYhyALxlP3hMHbBCN06wVJ8CSXJQfo18KV 2mCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id z17-20020a170903019100b001bf0916b665si1923857plg.393.2023.09.14.08.04.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 08:05:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 9E7B3812E02E; Thu, 14 Sep 2023 08:02:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235295AbjINPCc (ORCPT + 99 others); Thu, 14 Sep 2023 11:02:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231567AbjINPCb (ORCPT ); Thu, 14 Sep 2023 11:02:31 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD6101FC2; Thu, 14 Sep 2023 08:02:26 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4RmgWw1VMVz6K5sT; Thu, 14 Sep 2023 23:01:48 +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.31; Thu, 14 Sep 2023 16:02:24 +0100 Date: Thu, 14 Sep 2023 16:02:23 +0100 From: Jonathan Cameron To: James Morse CC: , , , , , , , , , Salil Mehta , Russell King , Jean-Philippe Brucker , , Subject: Re: [RFC PATCH v2 29/35] irqchip/gic-v3: Don't return errors from gic_acpi_match_gicc() Message-ID: <20230914160223.0000782f@Huawei.com> In-Reply-To: <20230913163823.7880-30-james.morse@arm.com> References: <20230913163823.7880-1-james.morse@arm.com> <20230913163823.7880-30-james.morse@arm.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml500006.china.huawei.com (7.191.161.198) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 14 Sep 2023 08:02:34 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email On Wed, 13 Sep 2023 16:38:17 +0000 James Morse wrote: > 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 > --- > 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 72d3cdebdad1..0f54811262eb 100644 > --- a/drivers/irqchip/irq-gic-v3.c > +++ b/drivers/irqchip/irq-gic-v3.c > @@ -2415,21 +2415,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) Going in circles... > 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)