Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp624089lqb; Wed, 17 Apr 2024 06:38:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX2qT+O7B8hQhw4nkApydbn/wS7zeyCgmk/gj30/N9A5pGQWQKgAcHEMDVuCl7AaWNWAZfKIeGQJt2M+FLg/0k7/AJO5Yk+dIn1cwEXxQ== X-Google-Smtp-Source: AGHT+IHxmsM+3b9Q5INTY43AaU8a9RLCUdz5l1oqaCGK+sq32aAlJB7njyGE+OJ0cMum3dl3W7Tq X-Received: by 2002:aa7:8888:0:b0:6ea:8b0c:584 with SMTP id z8-20020aa78888000000b006ea8b0c0584mr21880281pfe.9.1713361088141; Wed, 17 Apr 2024 06:38:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713361088; cv=pass; d=google.com; s=arc-20160816; b=MfkkFeE7v0plJrDWLDrK0zsS6k25JngxJfUDOc8hoIIjEzFZx/kmBT6q5P4BdqRxk6 qC0022lODUdzkzZftqgS5hjp+hMWp4OEp5tLx8ZhcyC4CVN2unQlQuHGZw4zWHmEgh+U b1I4ou98b7kaFblPGlp1nfgUZEZyT2IdiI7GkLlODMq6YPjCMkvkSdwcM43Ce8gxqPJn wtGAGc7h1GoFRcCLLUgDh7zsJ/l2QC6ykcrv0YSaDDgP9sfgQJJ/TN98RCQ/DvcbiiWc Hol77nWBthnYMNefK3hHxGL9yFzwvhWSXUvbTR7ikFMui5np8tw+XgMfKvTU4X5dClrC FBjQ== 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=LxVC8eAEj5227/hrFq867w/Ucx+VJjdjb+BncO88uVQ=; fh=wmH6eZgtoFCyes/zVTYi+VaxxdPmNW9hqdNd8ZTZ4XU=; b=ijzNzZSOTf6GbOskT9SLUNKidkZCUQSiemyNNAmJB7XuZG2bYqKR2PjW1duq/M7Wi6 /LGnXimSHD6VENkfhtfx4x56c+oQjqhh2mfI5Fae0f0qxh/k0dDkHbAVD0l1reZAzHJu idfHc2bqUwwUKdrMdMQW6LKIFJ5lg6FsBesQauqKFarDPxj3XVkfbmGGypDWiEHTgrNs s5pTtHyboToA0r66++phKY4D2LhRBu3y8FT+4VJ0y0Fj84FG8a2qThpvnF9GpF5Xp3vS KJrEHH85ERrx946jm+A2tJOGXh9nENcfFIVcYZJ+pvw7gGuWy3exPPWc7bAr2aDCj9Q3 qoyg==; 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-148559-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148559-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id x27-20020a056a00271b00b006ed41e29c19si11601513pfv.55.2024.04.17.06.38.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 06:38:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148559-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; 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-148559-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148559-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 400F8B2703B for ; Wed, 17 Apr 2024 13:25:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C43AF140386; Wed, 17 Apr 2024 13:24:21 +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 C710613C910; Wed, 17 Apr 2024 13:24:19 +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=1713360261; cv=none; b=AeipUeiCZIcDKBiL7BueHGNrdpqYjnSODlXcujaRdz/lIbWurR1yv/2KS1ThW2rrYEOQd5fbG0R8DQgzU6VsQrZ+L5jZwTKuUXqFlu/PYEIhUa6z48GSBmdp0vKO1hZ6q/e+FlAekUICoFIqAAPIhyx1b/lg0jmCneuseDEmvCE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713360261; c=relaxed/simple; bh=dmhJWSD9xv9dYuU9/FWuiIHdAi7HU4yHvwTLrzYdN34=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jljGsNs9GZzf2UzbJ65/IagiF1y3+gXO4yFZdAHYNJDzcbimZfmB7ICSM5VWxFhOO12vo1z8E2iWGYftezuN7+QJuO+qYSzBSxRBwC+KLVTim03TH95Go8zrvmpJ5zt4c11WTMYAj4qVvgnlFx8Q7bKiusCWd+3vrfRU0ZCAM4k= 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.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4VKM2009D3z6K8qc; Wed, 17 Apr 2024 21:19:20 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id A2378140A46; Wed, 17 Apr 2024 21:24:17 +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; Wed, 17 Apr 2024 14:24:17 +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 v6 10/16] irqchip/gic-v3: Don't return errors from gic_acpi_match_gicc() Date: Wed, 17 Apr 2024 14:19:03 +0100 Message-ID: <20240417131909.7925-11-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240417131909.7925-1-Jonathan.Cameron@huawei.com> References: <20240417131909.7925-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: lhrpeml500001.china.huawei.com (7.191.163.213) 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 --- v5: 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