From patchwork Thu Aug 18 22:41:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 9288727 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EA7C4607FF for ; Thu, 18 Aug 2016 22:44:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDD7B2929C for ; Thu, 18 Aug 2016 22:44:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D22C9292BE; Thu, 18 Aug 2016 22:44:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C83612929C for ; Thu, 18 Aug 2016 22:43:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1baW1F-0003if-8f; Thu, 18 Aug 2016 22:42:37 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1baW19-0003dn-8L for linux-arm-kernel@lists.infradead.org; Thu, 18 Aug 2016 22:42:31 +0000 Received: by mail-pf0-x244.google.com with SMTP id y134so379940pfg.3 for ; Thu, 18 Aug 2016 15:42:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=lhse2zOyfAjOxVd2RsbPYAgLWYvLlBzT25wun92TE8o=; b=vdMUD0U6IRUnIdolKYblWgOs0ggPk5GyKlVDgTLelb0bm7MbQtNF/cZWu/EELvaj3/ vc6pPIaOc2/ERzHZ3cOxCYdB2Ir834gxVc8yjXECePov51MP4KFlU6GLw+jufFbAvOf/ K8Gj8WM1eEurS+2g5rTX7VENI4bbBj+3Q56ig9Vo2AlvYMD515P3nt79UZ6tb6WFiUcY IED8fomUslvNbmUDysuVIxzu0vntBi3B7VVtDIQgzZbui2QTO9Td+tX5txMN+6jUuj/7 vl6llSHiK+ymmqJcZOEb+sSbqzIPpXNLBXNpaJZS9SV0LtBUbBsKbkYl5bxXhW0RcKMf 1JyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=lhse2zOyfAjOxVd2RsbPYAgLWYvLlBzT25wun92TE8o=; b=NENp3widj3wG3DBMplRVXoDX0qQktFq9gBCtuUPanvHMvWQkYq21yoWmcmslOTT765 LzbUMyRyNNwYDNfpT3C2TM9/3NctylGHcD4SjTd2cVYB7/SnbVrTKG6ZcdWAQl5RWjyf UJiAAvelNDW1oI2npCzjwAf45bfFFYimwgGxn9ZkudCE+So1lkJ8l7xMcrQvHv3NATzg GJg+OGs7a/Jb0p70TgMb74P16VVUBeCyzpMTR7Pybk8dHesXH/lYjFWUZNNFqMiD1IPD w6a5QrGEbGMwLEzwlwmK7uH2UiqOXGzae97foo02n1Kz3+TEgk85g+Ydt8f2997AdwXx 1Akw== X-Gm-Message-State: AEkoouuPXZHVSaRA4ZpaWBCKoaGsO9tCZj4LwkomnoQhnG4ygPPEGBA0waoc87JRnXR3Tg== X-Received: by 10.98.86.85 with SMTP id k82mr8306217pfb.82.1471560130190; Thu, 18 Aug 2016 15:42:10 -0700 (PDT) Received: from dl.caveonetworks.com ([50.233.148.156]) by smtp.gmail.com with ESMTPSA id w76sm1142613pfd.69.2016.08.18.15.42.08 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 18 Aug 2016 15:42:08 -0700 (PDT) Received: from dl.caveonetworks.com (localhost.localdomain [127.0.0.1]) by dl.caveonetworks.com (8.14.5/8.14.5) with ESMTP id u7IMg7fE000944; Thu, 18 Aug 2016 15:42:07 -0700 Received: (from ddaney@localhost) by dl.caveonetworks.com (8.14.5/8.14.5/Submit) id u7IMg60C000943; Thu, 18 Aug 2016 15:42:06 -0700 From: David Daney To: linux-kernel@vger.kernel.org, Thomas Gleixner , Jason Cooper , Marc Zyngier Subject: [PATCH] irqchip/gicv3-its: Disable the ITS before initializing it. Date: Thu, 18 Aug 2016 15:41:58 -0700 Message-Id: <1471560118-909-1-git-send-email-ddaney.cavm@gmail.com> X-Mailer: git-send-email 1.7.11.7 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160818_154231_378304_30100100 X-CRM114-Status: GOOD ( 12.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Robert Richter , linux-arm-kernel@lists.infradead.org, David Daney MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: David Daney When starting a kexec/kdump kernel, the GIC ITS will already have been enabled. According to the ARM Generic Interrupt Controller Architecture Specification (GIC architecture Version 3.0 and version 4.0), writing to GITS_BASER or GITS_CBASER is "UNPREDICTABLE" when the ITS is enabled. On Cavium Thunder systems, this prevents the ITS from being initializing in the kexec/kdump kernel, resulting in failure to register/enable interrupts for all devices. The fix is to disable the ITS if it is not already in the disabled state. This allows the ITS to be properly initialized and then re-enabled in the kexec/kdump kernel. Signed-off-by: David Daney Acked-by: Marc Zyngier --- drivers/irqchip/irq-gic-v3-its.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 7ceaba8..36b9c28 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -1545,7 +1545,12 @@ static int its_force_quiescent(void __iomem *base) u32 val; val = readl_relaxed(base + GITS_CTLR); - if (val & GITS_CTLR_QUIESCENT) + /* + * GIC architecture specification requires the ITS to be both + * disabled and quiescent for writes to GITS_BASER or + * GITS_CBASER to not have UNPREDICTABLE results. + */ + if ((val & GITS_CTLR_QUIESCENT) && !(val & GITS_CTLR_ENABLE)) return 0; /* Disable the generation of all interrupts to this ITS */