From patchwork Wed Mar 18 17:09:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sungbo Eo X-Patchwork-Id: 11445813 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E93441820 for ; Wed, 18 Mar 2020 17:58:19 +0000 (UTC) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A24E520768 for ; Wed, 18 Mar 2020 17:58:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=groups.io header.i=@groups.io header.b="iBae6rnr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A24E520768 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gorani.run Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=bounce+16102+63+925526+2090324@groups.io X-Received: by 127.0.0.2 with SMTP id vNgtYY926861x0OvocBwxXN; Wed, 18 Mar 2020 10:58:19 -0700 X-Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [91.198.250.253]) by mx.groups.io with SMTP id smtpd.web11.20549.1584551479300433691 for ; Wed, 18 Mar 2020 10:11:19 -0700 X-Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 48jGln33z3zQlFx; Wed, 18 Mar 2020 18:11:17 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de X-Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id dDnmRVvElgnL; Wed, 18 Mar 2020 18:11:14 +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 Subject: [linux-oxnas] [PATCH] irqchip/versatile-fpga: Handle chained IRQs properly Date: Thu, 19 Mar 2020 02:09:04 +0900 Message-Id: <20200318170904.1461278-1-mans0n@gorani.run> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: linux-oxnas@groups.io List-Id: Mailing-List: list linux-oxnas@groups.io; contact linux-oxnas+owner@groups.io Delivered-To: mailing list linux-oxnas@groups.io Reply-To: linux-oxnas@groups.io,mans0n@gorani.run X-Gm-Message-State: kfgTufnOPmFD7fpGuLgDLyBwx925526AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1584554299; bh=dSDctTWKzXfHqVXP42tHo0lr1i9lNXMsFRU2HHyPxSU=; h=Cc:Date:From:Reply-To:Subject:To; b=iBae6rnr3eLQOTMuXajMfQ72gXpxSBhEmXO8MZqUCBEepn0ody963RuEf1iweUqeG3U gqSfP0ny077otov7g4EQz+Uhcut3FBQxeQXyWbwY4AENKtv++V76J1FuNsbGy41Cc5SS6 bTZjrmbzdlfMlaR0pt00/brECHwKYhAsopg= Enclose the chained handler with chained_irq_{enter,exit}(), so that the muxed interrupts get properly acked. This patch also fixes a reboot bug on OX820 SoC, where the jiffies timer interrupt is never acked. The kernel waits a clock tick forever in calibrate_delay_converge(), which leads to a boot hang. Signed-off-by: Sungbo Eo Cc: Neil Armstrong --- drivers/irqchip/irq-versatile-fpga.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-versatile-fpga.c b/drivers/irqchip/irq-versatile-fpga.c index 928858dada75..08faab2fec3e 100644 --- a/drivers/irqchip/irq-versatile-fpga.c +++ b/drivers/irqchip/irq-versatile-fpga.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -68,12 +69,15 @@ static void fpga_irq_unmask(struct irq_data *d) static void fpga_irq_handle(struct irq_desc *desc) { + struct irq_chip *chip = irq_desc_get_chip(desc); struct fpga_irq_data *f = irq_desc_get_handler_data(desc); u32 status = readl(f->base + IRQ_STATUS); + chained_irq_enter(chip, desc); + if (status == 0) { do_bad_IRQ(desc); - return; + goto out; } do { @@ -82,6 +86,9 @@ static void fpga_irq_handle(struct irq_desc *desc) status &= ~(1 << irq); generic_handle_irq(irq_find_mapping(f->domain, irq)); } while (status); + +out: + chained_irq_exit(chip, desc); } /*