Received: by 2002:ab2:68d2:0:b0:1f5:ff5f:8f32 with SMTP id e18csp116017lqp; Thu, 18 Apr 2024 07:00:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX7yKIptje/gVPgjEemF/Eqtrhdj5U7OYFT1jHzsvKwJ9ToMZY/qze17VVMPPDYoUQ2+SFNur+2UJIONKAwbCVnJfpjY5+R6ZeSTrc46A== X-Google-Smtp-Source: AGHT+IE3owQCbbdqHaLzhAQKviMP+h2dr92wKfZ9oZNwCRqD5nt/M5rTudfAarQl2IVd+ts+wBNs X-Received: by 2002:a05:6a00:982:b0:6e7:117:c5d5 with SMTP id u2-20020a056a00098200b006e70117c5d5mr3429850pfg.23.1713448810074; Thu, 18 Apr 2024 07:00:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713448810; cv=pass; d=google.com; s=arc-20160816; b=aMm2NAgsoq6bpCdfGZ4WDQOAxmvWT+sXa6EPAaihs3ipVwYnG8suclDyRWeOzXcRU5 rbB1+6tdjdTRDFL9ilmdbqQgyl3H1UAgCG+1IbEm/qz93KB17QRSkDZrxkLj74izXdpZ 8ekCJ+9tJBz6wK9EM0pOZqmm5ERKXEXgiHUBwtZhs+XgK/665+1rglFOccrOqp7JLZjr mDP53JCYTV/c1xvwXdWYw9DanODKvRE+HkOvrDsb8fArcIFuIHGW58hIhEChlle6Vn1x fGtrCAUKp+ja27oPR/pQnWZNjskwSZA/p0dSI+L9ihCFsPLKTCMvtPIKw1IqMrvFnDYh AjHQ== ARC-Message-Signature: i=2; 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:references:in-reply-to:message-id :date:subject:cc:to:from; bh=CDMynU6puXI9K0PMow1AsZIDXIevqkaB2ZPIMEO5ac0=; fh=wmH6eZgtoFCyes/zVTYi+VaxxdPmNW9hqdNd8ZTZ4XU=; b=DbXG0jN3sBFsPytdidL0lhw0JjC3aEMAh6prh5MmBCthD+RMa43cmBb361Vcu2WEJe E5f2OEjI7zJ97GpmJ1KfBp1k1Nh7PAapRGy3XflLejoIUnm3ElM5YY09Kji5QWklGaYv Effr5egLXqtsA58/hPXqss672iMA1pn8lFuWCVbyHj5WdV7kVgUZ9V+oTYbV/vi8ACBm KlR9dEKIlTpsaXp30CYS6NX/bHM/suSfWHZgLAaa8uLyL3j2ED2VssHIXF9aA5RTznVL KdciCbaEcet0ucTkO1YjtzmIt8H1aOIETJ9i5JVRVQzXxovw0atfB878TGupdl+lyghV TGlA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-150227-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150227-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 gu22-20020a056a004e5600b006e6b77f6aabsi1498381pfb.263.2024.04.18.07.00.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 07:00:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150227-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; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-150227-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150227-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 B297928159A for ; Thu, 18 Apr 2024 14:00:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1592D165FA4; Thu, 18 Apr 2024 13:59:26 +0000 (UTC) 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 0D2AD165FA5; Thu, 18 Apr 2024 13:59:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713448765; cv=none; b=J80+yiGeyCCUiWp0ewwUVnvn2k2EK6Uqtz0+cIw0FzpRndl77RnRn9X7Dm+px5MYnlU/ost76aPDUhKwZ1/nXq8BXVRH1UaYwcj6PCzEaUOPPwoYmyIOtv6BjxWC2WA6e/CLiAUkzPu0e5w4WhRdl24DIvAgAGD6lvRf26yLJRQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713448765; c=relaxed/simple; bh=Zx4LtaK/cORjchbA6pFt7wlqKzyx1DGqbsJf0x8mQb0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gBviXqv/QtV2T48ti2YesGQyDS45zuQ+MIJOg2HHopXDVbMMD/OhS/3TgbZQ0ULKMIqRgSsVtwGm3/UIpRU0PBsPcmyiJ1/l2ROjUXXGA8uPGXD7L19G8W7mBPVvTA7IbworeeYbEZmYjbbGgubpXLkd7t1mIHTyL/WLyzXLy/w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 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 4VKzqL42Xqz6K5r4; Thu, 18 Apr 2024 21:57:18 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id D7AEE1406AC; Thu, 18 Apr 2024 21:59:21 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.247.231) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 18 Apr 2024 14:59:21 +0100 From: Jonathan Cameron To: Thomas Gleixner , Peter Zijlstra , , , , , , , , , Russell King , "Rafael J . Wysocki" , Miguel Luis , James Morse , Salil Mehta , Jean-Philippe Brucker , Catalin Marinas , Will Deacon CC: Ingo Molnar , Borislav Petkov , Dave Hansen , , , Subject: [PATCH v7 10/16] irqchip/gic-v3: Don't return errors from gic_acpi_match_gicc() Date: Thu, 18 Apr 2024 14:54:06 +0100 Message-ID: <20240418135412.14730-11-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240418135412.14730-1-Jonathan.Cameron@huawei.com> References: <20240418135412.14730-1-Jonathan.Cameron@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: lhrpeml100002.china.huawei.com (7.191.160.241) To lhrpeml500005.china.huawei.com (7.191.163.240) 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 will complicate 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 Signed-off-by: Russell King (Oracle) Reviewed-by: Jonathan Cameron Signed-off-by: Jonathan Cameron --- v7: No change --- drivers/irqchip/irq-gic-v3.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 6fb276504bcc..10af15f93d4d 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -2415,19 +2415,10 @@ 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 */ - if (acpi_gicc_is_usable(gicc) && gicc->gicr_base_address) { + if (acpi_gicc_is_usable(gicc) && gicc->gicr_base_address) 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) -- 2.39.2