Received: by 10.192.165.156 with SMTP id m28csp72871imm; Tue, 10 Apr 2018 16:42:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+2R6p4Rgderup1DDHb4LwATVQQLG1QaPlw2FF8TVl7D71lUEEXup4JOxtowmICV7w25QPb X-Received: by 10.99.184.1 with SMTP id p1mr516532pge.250.1523403732258; Tue, 10 Apr 2018 16:42:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523403732; cv=none; d=google.com; s=arc-20160816; b=AGH20/Mt57XinV10gD0aa7z4imfitDABxphA3KI3RINtiVJCLIbu0pVYO0gwE704Cm eUxiT8rfB7D7mH5IFaivx6Rmm/HnKOkfoORiJMX795RE45MX3QaUrdxhngBhHuEi6edI vZsTLv53+I/TJ/2tL5Ir5YCKWwRJqeRwoYh7Be42Q+krRaPVwcOgfs+2rfX7zUvOo83S MrJdMRJlZ41ig2amOTEW18GlmmIjjCN+tLtHih0XTh6VdbiZU8XTqbWna62rkwXHPNsl YazzNmbOuNS+8/g0CQrgz3xikmMsBP360tvoUmx08Rb+JzMpiGHOtFx+hyVYJj6A1/+w H8+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=caqqlZU2HlF4vMdWnFozd9tNO8SeYFlfNLTSdsLWeOY=; b=bb0pX1fqxLyREAtmSeXlfVw/ucoXWLoHAJelmxBTJHmisCzj0kPJ4CD1d6oQ6JI01u pD6nJ5A8Z7IMqPBe2dN6vu+IvZm6PB3HxXrHwtWQktABsiZOmLyQ5393B16LKHta8bLe gqlxULzMFVWlRExjpyYfPWMb6Zc3mI99h+8htWgznXKwWLgk4o/R/UIGBOs5xnsL09vW hENIf+VxOLJ2MDxzOCFTk+liEojpag+u+Xww5HuSCjQ0TG7SBYs14moGHfi9Jq4BiaqE xwqXK/U92etf0Gx05BByhk3PsSOSq/u0USqj3UcVVh6BnEzilS+YPrpBVfr/1q86JQzf A1gg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e34-v6si3524134plb.281.2018.04.10.16.41.35; Tue, 10 Apr 2018 16:42:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753775AbeDJW1j (ORCPT + 99 others); Tue, 10 Apr 2018 18:27:39 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37922 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753713AbeDJW1h (ORCPT ); Tue, 10 Apr 2018 18:27:37 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A37D5C03; Tue, 10 Apr 2018 22:27:36 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shanker Donthineni , Marc Zyngier , Sasha Levin Subject: [PATCH 4.15 043/168] irqchip/gic-v3: Fix the driver probe() fail due to disabled GICC entry Date: Wed, 11 Apr 2018 00:23:05 +0200 Message-Id: <20180410212802.033860276@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212800.144079021@linuxfoundation.org> References: <20180410212800.144079021@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shanker Donthineni [ Upstream commit ebe2f8718007d5a1238bb3cb8141b5bb2b4d5773 ] The ACPI specification says OS shouldn't attempt to use GICC configuration parameters if the flag ACPI_MADT_ENABLED is cleared. The ARM64-SMP code skips the disabled GICC entries but not causing any issue. However the current GICv3 driver probe bails out causing kernel panic() instead of skipping the disabled GICC interfaces. This issue happens on systems where redistributor regions are not in the always-on power domain and one of GICC interface marked with ACPI_MADT_ENABLED=0. This patch does the two things to fix the panic. - Don't return an error in gic_acpi_match_gicc() for disabled GICC entry. - No need to keep GICR region information for disabled GICC entry. Observed kernel crash on QDF2400 platform GICC entry is disabled. Kernel crash traces: Kernel panic - not syncing: No interrupt controller found. CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.13.5 #26 [] dump_backtrace+0x0/0x218 [] show_stack+0x14/0x20 [] dump_stack+0x98/0xb8 [] panic+0x118/0x26c [] init_IRQ+0x24/0x2c [] start_kernel+0x230/0x394 [] __primary_switched+0x64/0x6c ---[ end Kernel panic - not syncing: No interrupt controller found. Disabled GICC subtable example: Subtable Type : 0B [Generic Interrupt Controller] Length : 50 Reserved : 0000 CPU Interface Number : 0000003D Processor UID : 0000003D Flags (decoded below) : 00000000 Processor Enabled : 0 Performance Interrupt Trig Mode : 0 Virtual GIC Interrupt Trig Mode : 0 Parking Protocol Version : 00000000 Performance Interrupt : 00000017 Parked Address : 0000000000000000 Base Address : 0000000000000000 Virtual GIC Base Address : 0000000000000000 Hypervisor GIC Base Address : 0000000000000000 Virtual GIC Interrupt : 00000019 Redistributor Base Address : 0000FFFF88F40000 ARM MPIDR : 000000000000000D Efficiency Class : 00 Reserved : 000000 Signed-off-by: Shanker Donthineni Signed-off-by: Marc Zyngier Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/irqchip/irq-gic-v3.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -1331,6 +1331,10 @@ gic_acpi_parse_madt_gicc(struct acpi_sub u32 size = reg == GIC_PIDR2_ARCH_GICv4 ? SZ_64K * 4 : SZ_64K * 2; void __iomem *redist_base; + /* GICC entry which has !ACPI_MADT_ENABLED is not unusable so skip */ + if (!(gicc->flags & ACPI_MADT_ENABLED)) + return 0; + redist_base = ioremap(gicc->gicr_base_address, size); if (!redist_base) return -ENOMEM; @@ -1380,6 +1384,13 @@ static int __init gic_acpi_match_gicc(st if ((gicc->flags & ACPI_MADT_ENABLED) && gicc->gicr_base_address) 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 (!(gicc->flags & ACPI_MADT_ENABLED)) + return 0; + return -ENODEV; }