Received: by 2002:a05:7208:b08c:b0:82:bbfa:f723 with SMTP id c12csp378561rbb; Fri, 26 Apr 2024 06:58:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVX5o3EbgyRzdbrW1tC6Ie07WSQ2syudDrJL/Q0uC/Ebi6eZPQjiHRoAGYWlUOaaLSOFGHkarc+2ggT9XH+wyrEb1rHKvVv/si42/iFbg== X-Google-Smtp-Source: AGHT+IE8p99wtJlathrDSvhxTLCm1sCYkIDCHX9yvfWY2c1hwqXd8RvAKaBqRP5aPrl/Kcoj20UF X-Received: by 2002:ac2:410f:0:b0:515:a8c9:6e99 with SMTP id b15-20020ac2410f000000b00515a8c96e99mr2180831lfi.5.1714139915199; Fri, 26 Apr 2024 06:58:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714139915; cv=pass; d=google.com; s=arc-20160816; b=SsnbaVwAM1DdwnJjjko8sYBAOK7yyXVX4Sxht1eYxFwzxirr2tdiN9ZbfqXhhuJZHn 8o1803T0pXtRzuxDF9FxosQo3B39Fg7UPPHE3Ch+ymcO6gGiVWJEylid2SuEf7mXhd6K JandNthBR3JBq/8+cI1F9PnSvhKQv6V98au0+zmb3i+k9jIZnDNVbY2OfZsNZxCxEFUP fvj8dSfzinEuoHRHOThGXbquUzX5QED2D8wgSwZTxsV8ZhJpIRjbip8yy4vyr0jSZMWA SBsuEkCjvgbbwht2S2ENlFdvqFMQfImqgpeoGz0wluwb8gZgURGd5gWbRYyJdqze7Ihs nt1w== 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=KUfmVHrIQ2dXVqcLozL9gf53n8riERCIVkIQ8dmVza0=; fh=QfGN+Nlycv3VEqD8X65neWxvyXXboUCZUO7iSMK6eUk=; b=kYq8tnaMpwpgDL1B+CiGUfJdHZpeB6BVb9wZINUD/WchHyGKn23hcMnnMP7HW4V2T0 I0E9oLjrwyLNe6vO8jkzqH1Pet5GkC8MCobfYDcyGHDNkaZebyKg4jA3+bS2i+o13D5b Jz20zpyUKL+ubwxzItoAoM71E54kqisGcr5iWFcqSP+u1S7BKUlMUp9AqcrpOQBNUxrQ kbu0IL4lTJ6q2sWxCteMdlAYpAC5Tx0rFeNFKcLxYW7HeWAmEJbfI5qd8cNdLAQAT/fq 96UkBNatKei27WkIn5svIMxlI2hsyHJGodrVGclh6vgTgQpFbXuH/jnS6Lv1/CelmBgR 648w==; 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-160111-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160111-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id qa19-20020a170907869300b00a58cdca6f9esi869855ejc.349.2024.04.26.06.58.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 06:58:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160111-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; 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-160111-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160111-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 am.mirrors.kernel.org (Postfix) with ESMTPS id EACCF1F220BB for ; Fri, 26 Apr 2024 13:58:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E540615218A; Fri, 26 Apr 2024 13:56:39 +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 D8884148316; Fri, 26 Apr 2024 13:56:37 +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=1714139799; cv=none; b=ugN3D7JpRqqTtuJfmubnQ+4nSa+7TcTJq2qB0x3s+8hQkfVJboQLdCx19YJ9zvWraT6C3itzm2Wwodzy8BHXMsa7KPWNLCGh/fI7cuLZUwqxKeomDRl9313JWn/ZeVxstG0rbNDKmZkPx+ETkTzLrzQnwNb1O72nyDRwq1MYbZs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714139799; c=relaxed/simple; bh=ecAEB4j+zdSo6qmjhdyk8zjLg1miBwlO+pEoT39Nyzs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=keUSp1/qfsSlw7Xs0ZuG4PmegHRuuj6DaLAB2AWrEafguowMloO7Q3EH7u66rDSv9k5qovje5ozAZwn0/uEVKmU3c7Nz5Uhnec3o2Ed3qFIkPnpAusEfIYNuNcN+h7Fh1rNv6ygLKxOQIc44sL87WJLLwJG9cVfruwzn18cpaeQ= 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 4VQvQc0Dp1z6DBLn; Fri, 26 Apr 2024 21:56:24 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id AC934140B2A; Fri, 26 Apr 2024 21:56:35 +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; Fri, 26 Apr 2024 14:56:34 +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 , Marc Zyngier , Hanjun Guo CC: Ingo Molnar , Borislav Petkov , Dave Hansen , , , , Lorenzo Pieralisi , Sudeep Holla Subject: [PATCH v8 10/16] irqchip/gic-v3: Don't return errors from gic_acpi_match_gicc() Date: Fri, 26 Apr 2024 14:51:20 +0100 Message-ID: <20240426135126.12802-11-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240426135126.12802-1-Jonathan.Cameron@huawei.com> References: <20240426135126.12802-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: lhrpeml500002.china.huawei.com (7.191.160.78) 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 Tested-by: Miguel Luis Signed-off-by: Russell King (Oracle) Reviewed-by: Jonathan Cameron Signed-off-by: Jonathan Cameron --- V8: 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