Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1781813rdb; Wed, 31 Jan 2024 08:54:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IGEr4miHKxY1DKKiQKImb0Z8jHMQDtEILlkyhr9WrqzQKMxNe43K5TgVIMweGdnuuvYxBJz X-Received: by 2002:a50:ed90:0:b0:55e:f024:a327 with SMTP id h16-20020a50ed90000000b0055ef024a327mr1552632edr.31.1706720055498; Wed, 31 Jan 2024 08:54:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706720055; cv=pass; d=google.com; s=arc-20160816; b=IWI1YvX5j4yJaCL4GFjY2NQmCxRJ9UDu9vAidAK6q2QWAy1MZmC81X+B6eU0f5gF0U MkqEzykTImOur8rKt23YoqUyMlbZ9vOSN5AV9HKfXXpU9maqesw36DePsCjpcZ1IAZRH UdYCncO8eRtaIEsS809OU5klrSk23MAs2PRqHfAGJVrD23KjoTxcVj9xwtdSZ2N7nvde Gt98ABJk09xiceBBGR3VdlVVNUU1pMvqzcqJgne8HopFWOqLinpIrBIwUHqU6KGleER8 I1/kVjEyavUvxU19UCy4+TVacbRY9HpNVM9mOt+OD+Wc1wIhQ2GJwKPcao/4ti8xIKBd IKJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:sender:message-id:content-transfer-encoding :content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:subject:cc:to:from:references:in-reply-to :dkim-signature; bh=ggNpMVZKnCA4qTUdSs1tTKgcZqyqwopZRj4HYgCBhpE=; fh=QKv9JaqM5hkLr+OGrhZF8y8yjrSa+v/BiRebw+d2mpw=; b=P5vDJgmZ+IOyQwjqI9KPPlaaBh0sHfqRTZ76lTKoJ82iGDZ3OmMQgDn0Nm+hUaja15 UWZcFy0uCATgThzpIOcMDmce5dfG5gUhdgj+a12gFlCeMyjZwl+41SaGbhkJPYlw5FGX I0msPVDvBbBqAEfzS2L1dvWBnxSSX1zFekVrWYlQ7BSD3RevLkCGihd65DX0HjjOy/AT X8jrJ0SNsYvaEeQMIML5xJOVdD325Pyva2IdH5PHbNPSofUSgRx0LQg6jdbWXqyuPJ/c hcr793lLgo7oXRP15oBjTFHiwesdLuoxbBJwHOGOOaU9RdoJKlkkHhvi01b9bG2Pv2k/ XHFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=eRQOmPST; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-46836-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46836-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk X-Forwarded-Encrypted: i=1; AJvYcCWN72RcvnW2p7wYhuL1Y9GXBLEiOHOTlNxmHOEVkQzeEUnrr8YMaE+pwPKAzsQsLeV/dh/tPNr/KJ1F15VxtfzxPmzBbji4CLH9ez8J8Q== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id w27-20020a50d79b000000b0055ef4c94f85si3390137edi.428.2024.01.31.08.54.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 08:54:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46836-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; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=eRQOmPST; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-46836-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46836-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk 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 181501F22CFC for ; Wed, 31 Jan 2024 16:54:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8531C84A2D; Wed, 31 Jan 2024 16:50:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="eRQOmPST" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 1B1741386B0; Wed, 31 Jan 2024 16:50:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706719844; cv=none; b=qpX+cRuqxCHvkVCCfONX82wSMcMl4nARFi68V3OdLxpmuwnWGBAqMO9phtS2je0kk+DYx4xjjHGii6n9wEajhaOuhMI6ua/2anFCwGhUov3G3nP1D/fa2rty2fdLzThpreS3JVjHaMThEs+KEbGt7zwb9oCEx1ckr3poaAlZ7ig= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706719844; c=relaxed/simple; bh=5LEQoJpu6+PEGYH/lhb3k8QBDqyTbnnUbLwB01EXHtI=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=Zw4yUTyKRNDQbxOjlvSiUHCJo+2vF8RZ5P+OyUk/RIla2tAjjdXAG7VQoKId53dAnS2IuRbMzFL3KmV3b5ng7hNdcu/RZM7k5476KJ6D9vUHZbilJzyEoXblu5olAGdrtW7e+dm5fvXxS9ZGyuniC1LTogmrBjzmSvmykOM1H1o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=eRQOmPST; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ggNpMVZKnCA4qTUdSs1tTKgcZqyqwopZRj4HYgCBhpE=; b=eRQOmPSTq1ZLIHQXa2wUnO5S2U YS1T+Wxe2fqb4L8VLRnsI55TcS6ALkGhMQxBHxyk0HMsfLuyvclo0EQX5eJyiWivU6SLmFPyQ4Het ewI3JVRJwxIn9f8fEhqHW0ReqGzOQ2V3RKpxcY3EsBfqI4XnLTOeefB8byqeb1QT0UHRQHZJauzuJ 5fSazsiGDuM8P5D69pd0gOi+w3zD4Ypw9fLPzYlN9gZoPF1BPwd/e7PovA9TQiTNHHJGxfprYynl8 Djeh2SCfaMEUzHYUdZlaK/7Xq3FUrL8O8mlemaLr4cvipE2nrxHEvml2Xe9VK3cyCw46c7jqBNIGs B/0n6bsQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:36030 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rVDnD-0003VU-16; Wed, 31 Jan 2024 16:50:31 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rVDn9-0027ZB-QN; Wed, 31 Jan 2024 16:50:27 +0000 In-Reply-To: References: From: Russell King (Oracle) To: linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, kvmarm@lists.linux.dev, x86@kernel.org, acpica-devel@lists.linuxfoundation.org, linux-csky@vger.kernel.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org Cc: Salil Mehta , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com, James Morse , Jonathan Cameron , "Rafael J. Wysocki" Subject: [PATCH RFC v4 10/15] irqchip/gic-v3: Don't return errors from gic_acpi_match_gicc() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Wed, 31 Jan 2024 16:50:27 +0000 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) --- Changes since RFC v3 (smaller series): * Move acpi_gicc_is_usable() change in gic_acpi_match_gicc() into following patch so this is only about the error return. * Tweak commit message --- 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 98b0329b7154..8deb671c4ff7 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -2422,19 +2422,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.30.2