Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1824770ybb; Sat, 21 Mar 2020 06:41:38 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvd96kB9bMm9plpBsgVxz+XjWRH3kxHTyqp+EmzXQ5pvoNjfjTydmdbRFLRv/wWebAOFLZk X-Received: by 2002:a54:4094:: with SMTP id i20mr761675oii.141.1584798098138; Sat, 21 Mar 2020 06:41:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584798098; cv=none; d=google.com; s=arc-20160816; b=NaAcXDu5FE4bPOq1/0lXafb+K9RGq41cMdPgME9C2E2gmez/ViGS0s0qPrjwreP4b3 MsgsE38jTaPfY6ZyTnjt4Wpkk7OOb94fJgz+xtc30ukFILbIehem7MLpfxesIwCYmGZ8 uyJqWFEGR2STfQZkSBal5HP+bA/MWC4LaKz4V7tLacGRfWOffgae13F7wMouULBHHAlB ZEcrt1DkpVZReWSLpAFUb0oFddh62WgrurPThIqZg8D05/I3Z4cvKnkI4bf/Z1pbhHzj Kqu6aqxIkfikOxxCV3bFHlzYAMnJfs1nGSX4+J/2wnewIgTDOWFNAgPWV6DIwcB4kg3e Wj6g== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=6gUTnyBd+wF4DcNE7R2+NzsCS2Cnj7qei4GbwrUoBsU=; b=rufaJ8J7ZYaM8roEWT67XXjgTa+Vvq3F2NXoybOa4+X9+b8mFFg3TSDEpwA5HLCDlY YvVK3m+gV4SwaOft9T6gIP50+iaSIFTx6cZ3LqfPszgXnPtk4lnoSzMlryOp5w82Xtgw 9X36lwfKUZ7/z4dpv2KBuL02AN4NmU/jipw68LgURJ6pffU0/G/7usu2njlNeqbKSZRK Y+ZPYCmWbZNpSrnDpoe2gF+kPJEfd5fxQEn8zZtsD+PfhKrLMX17qnn9IjST5K/cxgUX 9GpQL73IGdUeaaSvaAX6G2aZ3V9mndRIeJ6QJHFjEkMAwQgTt4Q/DNpzxhYuK3I2saBn ME6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gorani.run header.s=MBO0001 header.b=Wp7XIFjG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gorani.run Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w31si4486355otb.59.2020.03.21.06.41.26; Sat, 21 Mar 2020 06:41:38 -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; dkim=pass header.i=@gorani.run header.s=MBO0001 header.b=Wp7XIFjG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gorani.run Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727462AbgCUNkj (ORCPT + 99 others); Sat, 21 Mar 2020 09:40:39 -0400 Received: from mout-u-107.mailbox.org ([91.198.250.252]:25472 "EHLO mout-u-107.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727039AbgCUNki (ORCPT ); Sat, 21 Mar 2020 09:40:38 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 48l1xJ4ySSzKpBh; Sat, 21 Mar 2020 14:40:36 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gorani.run; s=MBO0001; t=1584798035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=6gUTnyBd+wF4DcNE7R2+NzsCS2Cnj7qei4GbwrUoBsU=; b=Wp7XIFjG6vsHM2RFsi/R75ByN0PxJkmTChTRZvcA+95nlBCKmnP4g7OSuMA+ZS2VpR+ISZ 7Atuz113Kb5RaHrkzhR61DmpN+ggZqWjOdqQZdgV7ChSvSJCaao6aWwFLXWBSQLt5WL9yX gBV+5eHxP880JVPNiKZqrJ05hmDGThEySDr/3gRb9RQABUoqYt9FMZB5uneBp//M2o5SUg OGI+qnmtISB7gtviyrw37VajKO7QRZgjsf2e7TkOv0zsfphv4E/+4HGsW7rvenPcSqIbg8 iEffaHuAVBQMe6o7j+iDeT5+PcvCKryZAAOEvSY1YxqFy9j+btbl7H1FzQjrNQ== Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id Gpg7pxJw-UWe; Sat, 21 Mar 2020 14:40:33 +0100 (CET) From: Sungbo Eo To: linux-oxnas@groups.io, Linus Walleij , Thomas Gleixner , Jason Cooper , Marc Zyngier , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Sungbo Eo , Neil Armstrong , Daniel Golle Subject: [PATCH] irqchip/versatile-fpga: Apply clear-mask earlier Date: Sat, 21 Mar 2020 22:38:42 +0900 Message-Id: <20200321133842.2408823-1-mans0n@gorani.run> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Neil Armstrong Cc: Daniel Golle --- drivers/irqchip/irq-versatile-fpga.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-versatile-fpga.c b/drivers/irqchip/irq-versatile-fpga.c index 70e2cfff8175..f1386733d3bc 100644 --- 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 device_node *node, 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 device_node *node, 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 -- 2.25.2