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: 11445757 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 2149613B1 for ; Wed, 18 Mar 2020 17:11:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F34072071C for ; Wed, 18 Mar 2020 17:11:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LPj5burE"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gorani.run header.i=@gorani.run header.b="xESSd49P" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F34072071C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gorani.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ROrxLa4LBEzYmQINbh0yAiP/QqfFV1x7pCAGGFLy1pk=; b=LPj5burEqtfZvJ FqxK3N6MWwslnNeXiuYpHGNAsPb00ZcD4dNXu1Jphe0c7prP/Lf3a1fl5HWh77ogno6ToYLCNtu5E XRXIKgh0/fcH8V8nv/ocZ32Krq+5YOcFNRAhe/Kqz8VaOTHj4Bf+nl1PJ5u0T/fmFqvCd/SM4vMec 054914WKQpjAH61qdd6zv88SBDlwVIHEGjwMyMy86KhIFKYtEZbaRoWELVsBIepyY3vBEveZTq9G7 P2a4zm+QuBqQgP+FuYMS5oXTVHtEyEMg1reeSU05s+Kpx/O8SwBiwqSWpD7sFkgniMpvCEB8Ce9m+ C616vC99keCluAo/mQcA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jEcE4-0001xk-C2; Wed, 18 Mar 2020 17:11:28 +0000 Received: from mout-u-204.mailbox.org ([2001:67c:2050:1::465:204]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jEcE1-0001x7-Kb for linux-arm-kernel@lists.infradead.org; Wed, 18 Mar 2020 17:11:27 +0000 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gorani.run; s=MBO0001; t=1584551476; 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=rjeQJtst2T6i2m2bmZKswd/k9BXvMflb7UrV/wjEqqA=; b=xESSd49PLCdfXlqlQWuJ+m4wfH0gYPY4nAy0F2G3ZYImoo0HugUoRXJVig5pRYeeeqrvhc PxKCJ6Z1g05HxUHMF6Vjh1rx9JtYgEQ6zAOqZwtqtyPhHhZ1QiNWpD2nt76YGR9HjZnc7D 4XtPN0QmKyRe/gMmVy5m9F07e5iU/I0iqD6DaFyJJgNZf59AjByqNn+rLr5Rwneuubcp99 Rw3S9SIaMhEAk68OmLaj5W4fHr69yhOLSVFKaTTNFJCyB0jJT9aAhUBOrkt35fFqXrvunZ 5lPXEbqeIVegUx10nJlGqZwthV7sOP0Y1wfGnGzpX2VmT+xbiqseuVPWCOcaHQ== 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 Subject: [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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200318_101125_850048_FD75B6F0 X-CRM114-Status: GOOD ( 13.17 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sungbo Eo , Neil Armstrong Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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); } /*