Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1633728ybz; Thu, 16 Apr 2020 12:40:06 -0700 (PDT) X-Google-Smtp-Source: APiQypI3CYy2MLW3wWkTwE0WZ1/NXGjwwLCN1Pmpfo6AK8rvtMpHwusPL8P0w+cOLOgm3GUIoabD X-Received: by 2002:a17:906:4cd8:: with SMTP id q24mr10459572ejt.84.1587066006705; Thu, 16 Apr 2020 12:40:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587066006; cv=none; d=google.com; s=arc-20160816; b=YQl16rMZlqs5jfT8Its0Ev1oXg6jvQn5uXIM7M8g2qNohJ7X8cT2RvK0RhjhiX2Fs7 5omDhNMqtYu2bofvWG1x5Lygn/0lSCBAmc+4JATI2hAjd22+Qy0qd1MviXqLlnHMfwzg VbizIaNLkd+7Xohd56ZtpJIcObZQZanvVBWuIvxQTS9sjgGbY4U0Y+az+TgwNiGut0jh 2CNXkeeKvO5mSUo60rgFlgf/sL9OvR5Kzo4I2GrSjlziBSSkfhSzN1s6OW7mShgH3q8m s0TsEUGdMITd5kMIH03dxe9mB0qRQbfTFaJdjMfy8kZ42++IFp3rbTl+HNrP1f0hHdO/ hKCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=U1FYYwYCt3Lp/TzgQR2nXudHLNxBN+mZIlXu+NTLqlg=; b=eJugueVBWHXR2qR0/g8JIyn4g0WIueFePah82X0529krzG+buMx50eaqyo29cVatzx Thc3FuqT5gN4ptUT85bPD25yhzYk7xcc9GVcgD3u4+n6JCKCqFX3usf4rg5KYuPeZ+21 dHpBgT/oKv72UWiSOEB8CMMxIuHbPPzKHmW2uoFwNwADmNE4DZKDsVeh4+vPvBzvzSDI 69KifK0CuJes3mQKRmgF6vEalDr/bL9OkVgdcn9G/F4MB8urZW9ZpldIIWLqA1RrMYWp qaeW6N4wxsGwhjChc4uBDWKPJCRk1aEKfEUXKtpKz9TVd6gh1Y6zYIBHSm7YRiCAemKr ZBnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qr6KS+Nv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id de14si920044edb.283.2020.04.16.12.39.44; Thu, 16 Apr 2020 12:40:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qr6KS+Nv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2896737AbgDPNdk (ORCPT + 99 others); Thu, 16 Apr 2020 09:33:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:37942 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2895845AbgDPN2p (ORCPT ); Thu, 16 Apr 2020 09:28:45 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 76C92217D8; Thu, 16 Apr 2020 13:28:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587043724; bh=EK/Cuxjn3w46ZMpO2v2XOHxAZrlG7GWtQElkScPysAM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qr6KS+NvrPDNaSZCAPlZBuuq4FPmXjnFkDhd6KdDyHwkuE1aY56/M5Bv14MP3nEw4 /q0vyij04FyTESPL9BcKKW4XSuFmYlHPBzOjhunLlqjggo9/Ihj2cElByckj6eeVRx EqkxVZE4b21SUfc35IWzogl8w+hUbDLx/b3rCSfM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sungbo Eo , Marc Zyngier , Linus Walleij Subject: [PATCH 4.19 072/146] irqchip/versatile-fpga: Apply clear-mask earlier Date: Thu, 16 Apr 2020 15:23:33 +0200 Message-Id: <20200416131252.793253379@linuxfoundation.org> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200416131242.353444678@linuxfoundation.org> References: <20200416131242.353444678@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sungbo Eo commit 6a214a28132f19ace3d835a6d8f6422ec80ad200 upstream. Clear its own IRQs before the parent IRQ get enabled, so that the remaining IRQs do not accidentally interrupt the parent IRQ controller. This patch also fixes a reboot bug on OX820 SoC, where the remaining rps-timer IRQ raises a GIC interrupt that is left pending. After that, the rps-timer IRQ is cleared during driver initialization, and there's no IRQ left in rps-irq when local_irq_enable() is called, which evokes an error message "unexpected IRQ trap". Fixes: bdd272cbb97a ("irqchip: versatile FPGA: support cascaded interrupts from DT") Signed-off-by: Sungbo Eo Signed-off-by: Marc Zyngier Reviewed-by: Linus Walleij Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200321133842.2408823-1-mans0n@gorani.run Signed-off-by: Greg Kroah-Hartman --- drivers/irqchip/irq-versatile-fpga.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/irqchip/irq-versatile-fpga.c +++ b/drivers/irqchip/irq-versatile-fpga.c @@ -212,6 +212,9 @@ int __init fpga_irq_of_init(struct devic if (of_property_read_u32(node, "valid-mask", &valid_mask)) valid_mask = 0; + writel(clear_mask, base + IRQ_ENABLE_CLEAR); + writel(clear_mask, base + FIQ_ENABLE_CLEAR); + /* Some chips are cascaded from a parent IRQ */ parent_irq = irq_of_parse_and_map(node, 0); if (!parent_irq) { @@ -221,9 +224,6 @@ int __init fpga_irq_of_init(struct devic fpga_irq_init(base, node->name, 0, parent_irq, valid_mask, node); - writel(clear_mask, base + IRQ_ENABLE_CLEAR); - writel(clear_mask, base + FIQ_ENABLE_CLEAR); - /* * On Versatile AB/PB, some secondary interrupts have a direct * pass-thru to the primary controller for IRQs 20 and 22-31 which need