From patchwork Sun Oct 11 17:57:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thermal-bot for Julien Panis X-Patchwork-Id: 270403 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3719C433DF for ; Sun, 11 Oct 2020 17:58:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5C76F207EA for ; Sun, 11 Oct 2020 17:58:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="rEM8akXb"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="KmCVLgmS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730322AbgJKR6b (ORCPT ); Sun, 11 Oct 2020 13:58:31 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:40228 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388512AbgJKR5r (ORCPT ); Sun, 11 Oct 2020 13:57:47 -0400 Date: Sun, 11 Oct 2020 17:57:44 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1602439065; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BF0Ze4dvqMf0pTwdJ5HFaX1ph4Dhew8fG0GpRsWS0N8=; b=rEM8akXbI0/FmpUMJcoK7tv3l1aZC1d8K4qfKlKnKPT9pZIiUcHKCAGsBCLXHJteIEbcNT n1wotxb3G+ZJ4rq2GGWDeXijneTwWS/dVAQvNaqcZOdUlhIiB9sqqMZcPzZCbDkDUuUbA3 uEMFKoP80re4FHBjnEemth+F300NsFj1DDjBO6bm3RPXQ6a5uEf6Mjca44TRzVzWR3xOcA x70C3uOtCZ6PvcdDn5SgwBR+e/09hFzpX7QS2kTS5nxfNPy1t2oGj3s3thEV89LhHO/q9E 0dlExkTn9PwQOsLahLnRYn6EdBWL1THncgteRr8X+v8Qudu44JTM/yv5jjAOGA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1602439065; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BF0Ze4dvqMf0pTwdJ5HFaX1ph4Dhew8fG0GpRsWS0N8=; b=KmCVLgmSBO/DAYwKRzSoSFsD7gcUwUOExUCGmN+XjzhF1UE/pwB2CH1SnL2zXNKUr07RvZ rUYV8ybE5Z2+3fCQ== From: "tip-bot2 for Huacai Chen" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/core] irqchip/loongson-htvec: Fix initial interrupt clearing Cc: Huacai Chen , Marc Zyngier , stable@vger.kernel.org, x86 , LKML In-Reply-To: <1599819978-13999-2-git-send-email-chenhc@lemote.com> References: <1599819978-13999-2-git-send-email-chenhc@lemote.com> MIME-Version: 1.0 Message-ID: <160243906476.7002.12870041209542641118.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The following commit has been merged into the irq/core branch of tip: Commit-ID: 1d1e5630de78f7253ac24b92cee6427c3ff04d56 Gitweb: https://git.kernel.org/tip/1d1e5630de78f7253ac24b92cee6427c3ff04d56 Author: Huacai Chen AuthorDate: Fri, 11 Sep 2020 18:26:18 +08:00 Committer: Marc Zyngier CommitterDate: Sun, 13 Sep 2020 15:30:11 +01:00 irqchip/loongson-htvec: Fix initial interrupt clearing In htvec_reset() only the first group of initial interrupts is cleared. This sometimes causes spurious interrupts, so let's clear all groups. While at it, fix the nearby comment that to match the reality of what the driver does. Fixes: 818e915fbac518e8c78e1877 ("irqchip: Add Loongson HyperTransport Vector support") Signed-off-by: Huacai Chen Signed-off-by: Marc Zyngier Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/1599819978-13999-2-git-send-email-chenhc@lemote.com --- drivers/irqchip/irq-loongson-htvec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-loongson-htvec.c b/drivers/irqchip/irq-loongson-htvec.c index 13e6016..6392aaf 100644 --- a/drivers/irqchip/irq-loongson-htvec.c +++ b/drivers/irqchip/irq-loongson-htvec.c @@ -151,7 +151,7 @@ static void htvec_reset(struct htvec *priv) /* Clear IRQ cause registers, mask all interrupts */ for (idx = 0; idx < priv->num_parents; idx++) { writel_relaxed(0x0, priv->base + HTVEC_EN_OFF + 4 * idx); - writel_relaxed(0xFFFFFFFF, priv->base); + writel_relaxed(0xFFFFFFFF, priv->base + 4 * idx); } } @@ -172,7 +172,7 @@ static int htvec_of_init(struct device_node *node, goto free_priv; } - /* Interrupt may come from any of the 4 interrupt line */ + /* Interrupt may come from any of the 8 interrupt lines */ for (i = 0; i < HTVEC_MAX_PARENT_IRQ; i++) { parent_irq[i] = irq_of_parse_and_map(node, i); if (parent_irq[i] <= 0) From patchwork Fri Sep 11 10:26:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huacai Chen X-Patchwork-Id: 309850 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B761BC43461 for ; Fri, 11 Sep 2020 10:27:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 859F7221F1 for ; Fri, 11 Sep 2020 10:27:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uUcpqUl4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725812AbgIKK1c (ORCPT ); Fri, 11 Sep 2020 06:27:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725710AbgIKK13 (ORCPT ); Fri, 11 Sep 2020 06:27:29 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 789DCC061573; Fri, 11 Sep 2020 03:27:29 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id v14so168031pjd.4; Fri, 11 Sep 2020 03:27:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=lQt4U1iP+l97io+9Y7fL8PAkQ11+CExjcyqCQ8vCFRA=; b=uUcpqUl4J+axBPi2cfKLPmynySnRMfC5EpBgmWLEzxFSXrPj5+nKQLDVyX9VOCxhdk BdOEZS137xO92s4BG/U92Vhk3woMyqnpbzLRJag/igi73YRR5kpQf7OxO/BZga6KVbfA 3P18XJDE1rWaKurScyWaFhWoa2ZSNFL04aR1j/iSzcKDd8plYusp8uyyrjAdX8kg/kvL W+WQddK1Vz4qFOAwvG0Y9FvaWrEdtVAHrmNZfnc0Bi2Bt7Gi31QQrKTCzI1CMvGpapkH Jf0665tj8Xuuyhx6VRKYmY4kQzY9C1f97PLS35ZdhA/XLaX5IJ6q+vZ0lrIKzmRaU13W 8zKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=lQt4U1iP+l97io+9Y7fL8PAkQ11+CExjcyqCQ8vCFRA=; b=QKIcj5uI0SUECDi+/nTmVXMcxD/gYQPuPxBJgnATJQl73Pwu3jB61ILTNT698Qi3Kc SNOUyhU5JuQUcHGoVzVoAWo9us0EvIbM9DSpoA5Iccna/PdPogvfBDTY8Sn4E60axU6G bzOk+3xnzFeYLBVsZDSiN8b1tGQEdmrh41E6gPGpSqA9sKFm/YTldlD9OZk4EoRBWzwU 1/pVCnDtXWP7C79XVWDLUu2+mbZXnmwEPyk8QbuYdav5b+7UjBKEvszKCBBa+1rXVa7f Fjx670XJY5JARgIw51/Z1+AtKMZPMJAlXN5SKRXbHt7iHlLW6/OLBZoY8SPuRdDbr7/c RzqA== X-Gm-Message-State: AOAM531nUCXeNL32FJqva0OqZC5RgcPPX+UJb/4Cmn05Z1rB6xfmh65W EUbzJdvaeLma0CMe9wsbJRA= X-Google-Smtp-Source: ABdhPJwcUR55ZC7FLF5EZfwaI9zLqj9zqxA7mzSfvZKiNBvZaiLTovujelILqFDHwGe/+eBswzad+A== X-Received: by 2002:a17:90b:715:: with SMTP id s21mr1549243pjz.113.1599820049108; Fri, 11 Sep 2020 03:27:29 -0700 (PDT) Received: from software.domain.org ([45.77.13.216]) by smtp.gmail.com with ESMTPSA id j24sm1612727pjy.35.2020.09.11.03.27.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Sep 2020 03:27:28 -0700 (PDT) From: Huacai Chen To: Thomas Bogendoerfer , Thomas Gleixner , Jason Cooper , Marc Zyngier Cc: linux-mips@vger.kernel.org, Fuxin Zhang , Huacai Chen , Jiaxun Yang , Huacai Chen , stable@vger.kernel.org Subject: [PATCH V2 2/2] irqchip/loongson-htvec: Fix initial interrupts clearing Date: Fri, 11 Sep 2020 18:26:18 +0800 Message-Id: <1599819978-13999-2-git-send-email-chenhc@lemote.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1599819978-13999-1-git-send-email-chenhc@lemote.com> References: <1599819978-13999-1-git-send-email-chenhc@lemote.com> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org In htvec_reset() only the first group of initial interrupts is cleared. This sometimes causes spurious interrupts, so let's clear all groups. BTW, commit c47e388cfc648421bd821f ("irqchip/loongson-htvec: Support 8 groups of HT vectors") increase interrupt lines from 4 to 8, so update comments as well. Cc: stable@vger.kernel.org Fixes: 818e915fbac518e8c78e1877 ("irqchip: Add Loongson HyperTransport Vector support") Signed-off-by: Huacai Chen --- drivers/irqchip/irq-loongson-htvec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-loongson-htvec.c b/drivers/irqchip/irq-loongson-htvec.c index 13e6016..6392aaf 100644 --- a/drivers/irqchip/irq-loongson-htvec.c +++ b/drivers/irqchip/irq-loongson-htvec.c @@ -151,7 +151,7 @@ static void htvec_reset(struct htvec *priv) /* Clear IRQ cause registers, mask all interrupts */ for (idx = 0; idx < priv->num_parents; idx++) { writel_relaxed(0x0, priv->base + HTVEC_EN_OFF + 4 * idx); - writel_relaxed(0xFFFFFFFF, priv->base); + writel_relaxed(0xFFFFFFFF, priv->base + 4 * idx); } } @@ -172,7 +172,7 @@ static int htvec_of_init(struct device_node *node, goto free_priv; } - /* Interrupt may come from any of the 4 interrupt line */ + /* Interrupt may come from any of the 8 interrupt lines */ for (i = 0; i < HTVEC_MAX_PARENT_IRQ; i++) { parent_irq[i] = irq_of_parse_and_map(node, i); if (parent_irq[i] <= 0)