Received: by 10.192.165.156 with SMTP id m28csp27479imm; Tue, 10 Apr 2018 15:41:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx49ucwk90qzAYVZK82ZtVLD8HdplTT7ki9U9znJmGLABJ5rHVv4hVkbqSzIrW08bSFt0cjyz X-Received: by 2002:a17:902:3041:: with SMTP id u59-v6mr2274760plb.208.1523400072772; Tue, 10 Apr 2018 15:41:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523400072; cv=none; d=google.com; s=arc-20160816; b=lFbBdOQwlzSwNzBVwFpWfOfbvKYIJni51hmjU4K6z3424gI1IkAFNNpjvpHUw/RnGg F9UrdH7qIFhQLOAh6nJKTsnG+ySvzf0sEbvlILH7dg2LexoP9r2Yhj9HC/q324IEOTY0 jZGYZkukXGckbEt6ZVOqw2LV2yTZFUROuX8l1hqzpyVsYFxbpGjK7gY77kscYYIRRqpe nRXSWDp8Tj9AK3FfI/eRnNI3v3GUw+eZSCO16VJfVsrFL2G5NKouaXF9o4Q/tSxDnmle 7Q/pfAvZ5ahXqAxNnYnL2Lk2TajFdsfGtToyBoLaW/8IWrLxtAzrz2kyu7qwt6FFTH3y lEcw== 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=Uqw24XpheCK1FWmTfojJKoGgyAA/4Co8JXDmWhEJlIs=; b=AEVqKfdmXz+o3zq4uxvG/Hnl2voGuBV2q9zdkZALnBjkXfWm+d/j4dul2IwgLaPAWk VseGAUwa66yG5BwpfilbUF6iFOf1EP2GWRmmLf9RlT31/GvDRCeU2DwhZoEV+uXRfiMA BfwNzT3MlCr7M6Wfn1fVvyXSLjw2twRIhD1+13J+OrcrSOOsyJLzSALa2KsymAw3mTHt ifsju2Bzsnw2N1Wsh5Yr9mt2+FfhaMUvpGZEKfOtyGts5WpCDkWLmhqU7gWIQldC7UZr Bhse6a5DWeImcVeSHQetEkrIF6HxThGnloycCQfsUYfHQdHwK9nMopXgDW7f4fw0L84h Ynsw== 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 a17si2709683pff.43.2018.04.10.15.40.36; Tue, 10 Apr 2018 15:41: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 S932327AbeDJWfw (ORCPT + 99 others); Tue, 10 Apr 2018 18:35:52 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42272 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932294AbeDJWfs (ORCPT ); Tue, 10 Apr 2018 18:35:48 -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 ADB71D66; Tue, 10 Apr 2018 22:35:47 +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.14 032/138] irqchip/gic-v3: Fix the driver probe() fail due to disabled GICC entry Date: Wed, 11 Apr 2018 00:23:42 +0200 Message-Id: <20180410212905.839237092@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212902.121524696@linuxfoundation.org> References: <20180410212902.121524696@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.14-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 @@ -1297,6 +1297,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; @@ -1346,6 +1350,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; }