Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp578298ybz; Wed, 22 Apr 2020 04:05:32 -0700 (PDT) X-Google-Smtp-Source: APiQypLj/M+QQGYZ0r/sncmyNMPaEe0asHxI/9Ro0mXxAg1gA1fZlSQOzSCxJHOycepTbLuEJ3yI X-Received: by 2002:a17:906:130d:: with SMTP id w13mr24983413ejb.253.1587553532366; Wed, 22 Apr 2020 04:05:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587553532; cv=none; d=google.com; s=arc-20160816; b=0M7FLKQ3aRTH/X6V67xz+UzebsbrEGkMotLVbY1pxXTpfJKpjF6CYUhrcAlwNrSoAH N/3KhjWXweRnKvesI1UhgXicbVnP252kZNF/RUdawjQlq0utp9ogQEONtccIZ8jDwF0q 8w+bLT268/Yohao/Mf7CK/AwxYAauzxQRvZ3W3Jzehxg0LbrPSdSvQHK+nWScXnKKTPv AYFI40NiAkYa1xXp/iJ+hO4YxuJqNTiem9owv9N5QwmDEJDZoh5InZGv+MRBG6a21or9 BcpMacxV0BcfTUCtzVB7S5ZyJhD7hePSrQwdRo6MH53mvuI0dF4ltBr3gvNYDbDsSBUm 8qdQ== 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=B4L8hYAzmUBY7pi1EYdeQojlKg2WtBRweUpzX6CiQug=; b=tfTJZ6NLH1QdqtMZnbBq/lEIa8oocvcEjkbP04dlBDZwmIPDR7c+CkseZz2oe1Ws0j LDNUGMqG/uplmjj32ntAQvK7uH4aknpFsBdF5pr5x0WlC66fC0VygimoJRIuTwuMJ5UN ptlGOy4AIlz9gsPw69xP3Zl0ynHA5ud1F/p9tgScG5ml/AVGDtJ2+K0ljltmUTJj8eJl KsGtwFcNbCPysjGLe/xxLphBWB0+kSWcsZWGj0WQtjhdQzCsrkDPPE05EBFrdiWmGKfq a9X1TnsAD1pbWY2Haku/5zFHukesBs/DWKHB+PgKOwLvy1O6NQSVOxLJkNc6zhN8NyWz 03fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UmKD59y7; 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 e16si3367482ejr.309.2020.04.22.04.05.09; Wed, 22 Apr 2020 04:05:32 -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=UmKD59y7; 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 S1726157AbgDVKAN (ORCPT + 99 others); Wed, 22 Apr 2020 06:00:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:46790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726575AbgDVJ7z (ORCPT ); Wed, 22 Apr 2020 05:59:55 -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 4B9B920776; Wed, 22 Apr 2020 09:59:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587549594; bh=uHfJDHSXVBlydjhYSgY2opUgFgAkXRYmYj1mXLjkKrM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UmKD59y79S0mPzQOFcK/t3orv1WKB/j1xN8CSIzvwWcZ7DYqSjJbHVCTBNpHT94JR 0zYBRNmtjaA3AHMHAPzpWIfm9e8Hc+AyBzSJbqzuRDC7JI5SPut5lrGjIeNx60hua3 pnry1aSWh7Oc5GDuaKRVErC2duq7YXyuYIMWXJgw= 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.4 028/100] irqchip/versatile-fpga: Apply clear-mask earlier Date: Wed, 22 Apr 2020 11:55:58 +0200 Message-Id: <20200422095027.905688275@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200422095022.476101261@linuxfoundation.org> References: <20200422095022.476101261@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 @@ -211,6 +211,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) { @@ -225,9 +228,6 @@ int __init fpga_irq_of_init(struct devic fpga_irq_init(base, node->name, 0, parent_irq, valid_mask, node); #endif - 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