From patchwork Wed Feb 12 08:39:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 11377905 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 0DD0E138D for ; Wed, 12 Feb 2020 08:40:14 +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 DF44520661 for ; Wed, 12 Feb 2020 08:40:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ghg7gxVu"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="NKQ8YuiP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF44520661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com 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:References:In-Reply-To: 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: List-Owner; bh=K6eyxpp9QgeUCFG4UY7qzFnq6PGT0fLM3A02lV1SoK0=; b=ghg7gxVu5vSnL6 Aj+pSE2kaXtg0GXP4uDp38Dch83Q/Y4ZkMEavjMtaiKXUQx5JvkfGrAMK3XDQfVu+rw692JKmqS13 9my44xsuHQ3BTuAWEr+RVOXGZiMWkPWU0IQ+RLL92XUgoq33H3fkjQczEr1R8ZzmXxTIOKdj1V6On 6kSw+9KKQxrnpQi+pb5Cyag/7rkvI5McqtXx5Ud1/iHvg9pNk5UXAmnoupMbiopqFgWnTyMHmOukO WYiuDqpcRDjxxze/e0bTAO/OGLTied9mQo50tlNKQiV+48/odiOqbSskC/bvbLoX3iWz9K4q0yDih reoEIqsn1alBCxaI0bCw==; 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 1j1nZ2-0006DP-0O; Wed, 12 Feb 2020 08:40:08 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1nYy-0005W9-3C for linux-arm-kernel@lists.infradead.org; Wed, 12 Feb 2020 08:40:05 +0000 Received: by mail-wr1-x444.google.com with SMTP id y17so1121624wrh.5 for ; Wed, 12 Feb 2020 00:40:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vlGsrurND/ABJQemtdqIOhR0buTYuD6gWRyYKODN9Xk=; b=NKQ8YuiPPz9uuqFcO4gqQlpy0FIsB00vju+5ElEyGiLsREmxv4Jo0jIew6PG4ycqk+ czj+eYDQUsi/kK6LtoxCJYRrpaNptaf8vhLIUWTh8ctATPy5DayO8eVAz6jqOz4nXPMk 3psY2+K8n4v3pEpXY66d7wMVgx7TE2Gy9W60ajwfbWTOkuDTzsv+lfP7qNmrCx5SQqvv FKET5k/88hDeYjqa+NPiX716k+qae0OUGNZjoxGITKkoEW8rgUzyNOOKaAWonnLNUei3 00QtZuMW6d60b9nO1J0XsegienKIjeT22Ke4PCaET7ESyrcLW1m/VYLxfZwyPZtr9fZk F2fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=vlGsrurND/ABJQemtdqIOhR0buTYuD6gWRyYKODN9Xk=; b=YWEv/Qsxofwt1854NgohqBVPrUxbV7htThTN/ED89j5ukqDWEosMZebB+sAg+mR5L8 OcEmC1lXpvCWy5ffvR3Xu3H9kHeaiOI8Em/Lpf/cJzx3z6BDblCy8ziCijxV8vMI1LhT 6ALPQUbS85oEDMp722Oku8/b37NRpRAqMu5D5f6kwwptgUx3Yi9laNBaMTLX0LQvDT5C 9JiDsNDcMLMP69iCbxSO8HobWUy9C0kfy1byeN1K1ym+NNJZjr5zlxLs/tDuFcm3wlBe HhcKVXEmKRiq9iHO9nff3VHXVi4jx+HS0ALvsu32QTNieiycfotKjGJgyJEstnpBOdpT KW2A== X-Gm-Message-State: APjAAAWuIbgLoh6yfp7oyI1SwiAeUqN4xa27AZjX0ZPsxzYFBH3j/4EJ ilVrqRSg/rrtkcdgq5WbhQ9/mw== X-Google-Smtp-Source: APXvYqwd4NGHpkAia9MPc9TqBch3g3lddR5bKtlF0IABbXo2wYaC1n9u3QQSEPORyd4SI6qM5hPp1g== X-Received: by 2002:a5d:55d2:: with SMTP id i18mr13399003wrw.287.1581496802074; Wed, 12 Feb 2020 00:40:02 -0800 (PST) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id r6sm8849640wrq.92.2020.02.12.00.40.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Feb 2020 00:40:01 -0800 (PST) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu, michal.simek@xilinx.com, git@xilinx.com Subject: [PATCH 1/3] irqchip: xilinx: Fill error code when irq domain registration fails Date: Wed, 12 Feb 2020 09:39:56 +0100 Message-Id: <08b652db487686d816d71b3447a3b9f612d0fab4.1581496793.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200212_004004_154133_43A42906 X-CRM114-Status: GOOD ( 11.22 ) 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 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: Stefan Asserhall , Marc Zyngier , Thomas Gleixner , Jason Cooper , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org There is no ret filled in case of irq_domain_add_linear() failure. Signed-off-by: Michal Simek Reviewed-by: Stefan Asserhall --- drivers/irqchip/irq-xilinx-intc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/irqchip/irq-xilinx-intc.c b/drivers/irqchip/irq-xilinx-intc.c index 51f461d2934f..cf1bb470d7b5 100644 --- a/drivers/irqchip/irq-xilinx-intc.c +++ b/drivers/irqchip/irq-xilinx-intc.c @@ -230,6 +230,7 @@ static int __init xilinx_intc_of_init(struct device_node *intc, &xintc_irq_domain_ops, irqc); if (!irqc->root_domain) { pr_err("irq-xilinx: Unable to create IRQ domain\n"); + ret = -EINVAL; goto error; } From patchwork Wed Feb 12 08:39:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 11377907 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 9A8BA921 for ; Wed, 12 Feb 2020 08:40:23 +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 783E120661 for ; Wed, 12 Feb 2020 08:40:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YwoC+WdK"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="nRwmkoER" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 783E120661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com 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:References:In-Reply-To: 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: List-Owner; bh=n5hyHHV64MZsDAy40FiT9S2H68ExefFU/d6TFdQFnfo=; b=YwoC+WdKP6cQLJ zFfGatD1ouN1mjEjKBSKCTDeSt07LRg7j0ha4+p8DiuL8q8L4jTGUlonYzwCkfmTA1B/EdnskBE3t 11WcOoj/cLod4CbrmFj57caVoMayGaDgoCKaXncWc0LQhjFu+Dwi59iSt9+n7h41AuJJLJi2Zl6zZ rajLFPZNE3crZYikJe4Fo+8itXiilRA+lSNNi0pBQII1p9jJwlCRzEDmmZL1bqbU/B6zoE4xhRnP8 3ozJ+pS6fkItTIXdFm0KJNDiwJ5GgHaD+Ce8BNwbP0j6qZ8Bcimp2frCrr3ooe8aQY0NDA95+Sw3s 21kWdBHUGKl+5FkzocmQ==; 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 1j1nZC-0006s2-AA; Wed, 12 Feb 2020 08:40:18 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1nZ1-0005lP-6A for linux-arm-kernel@lists.infradead.org; Wed, 12 Feb 2020 08:40:08 +0000 Received: by mail-wr1-x442.google.com with SMTP id t2so1133701wrr.1 for ; Wed, 12 Feb 2020 00:40:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9jZicbKMFy+RIS6pl/MmIhoSGk5p/0+4DIwC/EbIzH0=; b=nRwmkoERZHKD5J0eRNErsC0qWHU+FzbYU0vgIsyfoP7Yq59ubCNPkfeypsq2+oj30z NRQRm30wf81aaDSqMEj/KYIet+TaG3ovZcIV6M4xngNYju2oQZx4pgIaaWexR1vA4Iif cbu+tf3KenFBcaj8F8TVYUGbCNG1p44UbwcD66pg2vCAjRApis4H7pbSlK5coG6UCIsL NVDIg7T3voBRYNjlbwHX94QfqzFeEbXCtqE+ECpFHAYOLhh/2CARDT6tiPzUxOhwqIaC g1giMe/54wBtaE5QAr282YOnUesamiePZLkFCGHnDU3ijzS4uwOoMuQag98JFwW5lzeW MOHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=9jZicbKMFy+RIS6pl/MmIhoSGk5p/0+4DIwC/EbIzH0=; b=OB8zuD/0OeOpmphSNOPvUVYix7QEAkhfQr5yxIkm6hRoo+JGiEsduJl2Nb2qR9w1rj UxRl8UB8DJ12FWq5ZfMPrlpGzUijx+LmS2rqjAob8X+XuajPE1v/coRlKRyRNRuQHt8Y kiTvzosGjxK23qeE+sG7XEur734ZjQTiLOW013DqISRA/FQGsN0walynnQmm0qESUZUq Mk28OJoqbRYfoi/ZScxqFJc/LdAzLqMulZoB6TcfeRklPT5nV+B7wyTZWLgsg/XFC/l2 Eqjgcmb1OmgAW4TynHKNOY1LvSC3V2HfKw+Yywo8zgLU2N7g+ydgvhepbNph2X7VgG39 6m3Q== X-Gm-Message-State: APjAAAU06YVXRZjBNIq7Zc1VSNb4faXIRrTGGauRB3aUrkjx04EA/shK /HxzQId2ieh1pUvp3pjBGJymkg== X-Google-Smtp-Source: APXvYqyfmlPZwTZvsJkBok9IupLxCmiaAM77FpRfWZ4v9639Z6veM2fVq7Avk5yeySjlmJjbT6HuQA== X-Received: by 2002:adf:dd4d:: with SMTP id u13mr14814581wrm.394.1581496803679; Wed, 12 Feb 2020 00:40:03 -0800 (PST) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id g15sm8928688wro.65.2020.02.12.00.40.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Feb 2020 00:40:03 -0800 (PST) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu, michal.simek@xilinx.com, git@xilinx.com Subject: [PATCH 2/3] irqchip: xilinx: Enable generic irq multi handler Date: Wed, 12 Feb 2020 09:39:57 +0100 Message-Id: <5813deafd27acf07b936ef7a2ac029b7a95ee7be.1581496793.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200212_004007_249175_5FE1F886 X-CRM114-Status: GOOD ( 14.45 ) 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 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: Stefan Asserhall , Jason Cooper , Marc Zyngier , linux-arm-kernel@lists.infradead.org, Thomas Gleixner , Mubin Sayyed Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Register default arch handler via driver instead of directly pointing to xilinx intc controller. This patch makes architecture code more generic. Signed-off-by: Michal Simek Reviewed-by: Stefan Asserhall --- arch/microblaze/Kconfig | 1 + arch/microblaze/include/asm/irq.h | 3 --- arch/microblaze/kernel/irq.c | 16 +--------------- drivers/irqchip/irq-xilinx-intc.c | 22 +++++++++++++++++++++- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index 6a331bd57ea8..3a314aa2efa1 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -47,6 +47,7 @@ config MICROBLAZE select CPU_NO_EFFICIENT_FFS select MMU_GATHER_NO_RANGE if MMU select SPARSE_IRQ + select GENERIC_IRQ_MULTI_HANDLER # Endianness selection choice diff --git a/arch/microblaze/include/asm/irq.h b/arch/microblaze/include/asm/irq.h index eac2fb4b3fb9..5166f0893e2b 100644 --- a/arch/microblaze/include/asm/irq.h +++ b/arch/microblaze/include/asm/irq.h @@ -14,7 +14,4 @@ struct pt_regs; extern void do_IRQ(struct pt_regs *regs); -/* should be defined in each interrupt controller driver */ -extern unsigned int xintc_get_irq(void); - #endif /* _ASM_MICROBLAZE_IRQ_H */ diff --git a/arch/microblaze/kernel/irq.c b/arch/microblaze/kernel/irq.c index 903dad822fad..1f8cb4c4f74f 100644 --- a/arch/microblaze/kernel/irq.c +++ b/arch/microblaze/kernel/irq.c @@ -20,27 +20,13 @@ #include #include -static u32 concurrent_irq; - void __irq_entry do_IRQ(struct pt_regs *regs) { - unsigned int irq; struct pt_regs *old_regs = set_irq_regs(regs); trace_hardirqs_off(); irq_enter(); - irq = xintc_get_irq(); -next_irq: - BUG_ON(!irq); - generic_handle_irq(irq); - - irq = xintc_get_irq(); - if (irq != -1U) { - pr_debug("next irq: %d\n", irq); - ++concurrent_irq; - goto next_irq; - } - + handle_arch_irq(regs); irq_exit(); set_irq_regs(old_regs); trace_hardirqs_on(); diff --git a/drivers/irqchip/irq-xilinx-intc.c b/drivers/irqchip/irq-xilinx-intc.c index cf1bb470d7b5..ad9e678c24ac 100644 --- a/drivers/irqchip/irq-xilinx-intc.c +++ b/drivers/irqchip/irq-xilinx-intc.c @@ -125,7 +125,7 @@ static unsigned int xintc_get_irq_local(struct xintc_irq_chip *irqc) return irq; } -unsigned int xintc_get_irq(void) +static unsigned int xintc_get_irq(void) { u32 hwirq; unsigned int irq = -1; @@ -178,6 +178,25 @@ static void xil_intc_irq_handler(struct irq_desc *desc) chained_irq_exit(chip, desc); } +static u32 concurrent_irq; + +static void xil_intc_handle_irq(struct pt_regs *regs) +{ + unsigned int irq; + + irq = xintc_get_irq(); +next_irq: + BUG_ON(!irq); + generic_handle_irq(irq); + + irq = xintc_get_irq(); + if (irq != -1U) { + pr_debug("next irq: %d\n", irq); + ++concurrent_irq; + goto next_irq; + } +} + static int __init xilinx_intc_of_init(struct device_node *intc, struct device_node *parent) { @@ -248,6 +267,7 @@ static int __init xilinx_intc_of_init(struct device_node *intc, } else { primary_intc = irqc; irq_set_default_host(primary_intc->root_domain); + set_handle_irq(xil_intc_handle_irq); } return 0; From patchwork Wed Feb 12 08:39:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 11377909 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 997C7138D for ; Wed, 12 Feb 2020 08:40:30 +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 6AF8B20661 for ; Wed, 12 Feb 2020 08:40:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="reK5BpQd"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="OOx3LgAY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6AF8B20661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com 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:References:In-Reply-To: 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: List-Owner; bh=eUkzfPGa6tcQyYk/gftoAlg5IEV32AUiAtscdW+7D/w=; b=reK5BpQduRKHAS uvEK1eg2BLlI45ZkI0RhUTxP7xtp05x0eJMqsuDm2YDySSfbvOkXjvfGyT/C9wPeTJmLtpmQL9R4b cxFrLJeG9pgqXuusy9ib/Hsj2HV68ekq6zp6CpYv/TI50U/Mn21Ro6XiJ+xHnkMzU+0mFfmOL5wCT FodMpLHT0KugapOkKitcW5duIaaCeLX2fykRvDt98prHAjCOMCmk1bhY+++8aPjfllbXJM9XvI4/V wM+K3IXeKLPFbIrvosMY72wIBNn5tOS1jZRzuZ4DQBUF3Hkfr7jGJxx4LHJC2xzy/liX6B8PQh9H0 lwHanuPlrO8rFTMc4Ktg==; 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 1j1nZN-00075r-OM; Wed, 12 Feb 2020 08:40:29 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1nZ2-0005zr-46 for linux-arm-kernel@lists.infradead.org; Wed, 12 Feb 2020 08:40:09 +0000 Received: by mail-wr1-x443.google.com with SMTP id z7so1090039wrl.13 for ; Wed, 12 Feb 2020 00:40:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9DJl9GCcO4mEWyRrTF90UKga2x2vqBOpYU34Ub2CR2M=; b=OOx3LgAYagkCcZOvOZgg3jnVlIP+iInKjA/8vzzVtNSD79JwDxv0JtKc6caJJ0mOkN 1o4XdekgdN3815BeioyAkXqvWsE94aQpaA4SAM+T7fOaY/j1enWukajmAa1tBFq51/C4 ksoCjUHiQx62twnK2bwXRN2pLOxGETiQUGzZfblDU7y75NSqvwwaOGB6/W0Xz24jFr/V M//DPJc4ONqEkBC7QTYrVCNyea9T45dC7Vaoxyi3IJ63QzMG4yXo0jrfMVM5YWJ1r4Sp 2F9t5RenTsB/TMBjGsfx5g5vNU4qFwwCh2wYive8PRYdnb0Argtjdn/KChsBLJF1cYsj eqoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=9DJl9GCcO4mEWyRrTF90UKga2x2vqBOpYU34Ub2CR2M=; b=WP6MNwIx5sNsc2ptS+0BOUz2JrbOwpN6cJ8JaTnR3tlWr0YmJ8//MyOzgU7MJOCYp6 NmVf3cCGvQiqf2NU2JQfGhvfm9+CyT/MNkWZ8hG0gCWFTvF4aVhibGy5eVxJMsJ+fn3S sV/ZqNmB8biOLAXZHRdA3OwKbgCt09sTyyhUzk83oydEQbpGgzmwTZhpXfCEFsdhQPb/ UEHP6iVgzbQ2qqDM67KtM01umFC7AAwye5psZyz0VeyxQ+Tmd9fA9ZozgeOjU/eDqkYz x5AeoyJaK/6pW25xIXwlqRWGs6+Oc0gSjZBhw72uqr0z3OqlQLPjqvUmDkSXPKdDK3as gPkA== X-Gm-Message-State: APjAAAX198pECxUV++cDgwyP9I+2wHod0TOfsvNAGwWoD0SLCNpNtxKh D3qkoXFYKQcjCev9/lcfQNM1LQ== X-Google-Smtp-Source: APXvYqzp2ys9j1IYE4oAaX1GOLnq/T+bZWI4c4aFjaPILm75tmPRqP+VgxZi6KvFiZ8hLir/kSZqTg== X-Received: by 2002:adf:aadb:: with SMTP id i27mr14785757wrc.105.1581496805371; Wed, 12 Feb 2020 00:40:05 -0800 (PST) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id a22sm7414139wmd.20.2020.02.12.00.40.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Feb 2020 00:40:04 -0800 (PST) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu, michal.simek@xilinx.com, git@xilinx.com Subject: [PATCH 3/3] irqchip: xilinx: Use handle_domain_irq() Date: Wed, 12 Feb 2020 09:39:58 +0100 Message-Id: <49c5a093d7ba1f20930c7433ed632e7c9bc7a2cb.1581496793.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200212_004008_218699_5C9099B3 X-CRM114-Status: GOOD ( 15.16 ) 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 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:443 listed in] [list.dnswl.org] 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: Stefan Asserhall , Marc Zyngier , Thomas Gleixner , Jason Cooper , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Call generic domain specific irq handler which does the most of things self. Also get rid of concurrent_irq counting which hasn't been exported anywhere. Based on this loop was also optimized by using do/while loop instead of goto loop. Signed-off-by: Michal Simek Reviewed-by: Stefan Asserhall --- arch/microblaze/Kconfig | 1 + arch/microblaze/kernel/irq.c | 5 ---- drivers/irqchip/irq-xilinx-intc.c | 44 +++++++++++-------------------- 3 files changed, 16 insertions(+), 34 deletions(-) diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index 3a314aa2efa1..242f58ec086b 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -48,6 +48,7 @@ config MICROBLAZE select MMU_GATHER_NO_RANGE if MMU select SPARSE_IRQ select GENERIC_IRQ_MULTI_HANDLER + select HANDLE_DOMAIN_IRQ # Endianness selection choice diff --git a/arch/microblaze/kernel/irq.c b/arch/microblaze/kernel/irq.c index 1f8cb4c4f74f..0b37dde60a1e 100644 --- a/arch/microblaze/kernel/irq.c +++ b/arch/microblaze/kernel/irq.c @@ -22,13 +22,8 @@ void __irq_entry do_IRQ(struct pt_regs *regs) { - struct pt_regs *old_regs = set_irq_regs(regs); trace_hardirqs_off(); - - irq_enter(); handle_arch_irq(regs); - irq_exit(); - set_irq_regs(old_regs); trace_hardirqs_on(); } diff --git a/drivers/irqchip/irq-xilinx-intc.c b/drivers/irqchip/irq-xilinx-intc.c index ad9e678c24ac..fa468e618762 100644 --- a/drivers/irqchip/irq-xilinx-intc.c +++ b/drivers/irqchip/irq-xilinx-intc.c @@ -125,20 +125,6 @@ static unsigned int xintc_get_irq_local(struct xintc_irq_chip *irqc) return irq; } -static unsigned int xintc_get_irq(void) -{ - u32 hwirq; - unsigned int irq = -1; - - hwirq = xintc_read(primary_intc, IVR); - if (hwirq != -1U) - irq = irq_find_mapping(primary_intc->root_domain, hwirq); - - pr_debug("irq-xilinx: hwirq=%d, irq=%d\n", hwirq, irq); - - return irq; -} - static int xintc_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw) { struct xintc_irq_chip *irqc = d->host_data; @@ -178,23 +164,23 @@ static void xil_intc_irq_handler(struct irq_desc *desc) chained_irq_exit(chip, desc); } -static u32 concurrent_irq; - static void xil_intc_handle_irq(struct pt_regs *regs) { - unsigned int irq; - - irq = xintc_get_irq(); -next_irq: - BUG_ON(!irq); - generic_handle_irq(irq); - - irq = xintc_get_irq(); - if (irq != -1U) { - pr_debug("next irq: %d\n", irq); - ++concurrent_irq; - goto next_irq; - } + u32 hwirq; + struct xintc_irq_chip *irqc = primary_intc; + + do { + hwirq = xintc_read(irqc, IVR); + if (hwirq != -1U) { + int ret; + + ret = handle_domain_irq(irqc->root_domain, hwirq, regs); + WARN_ONCE(ret, "Unhandled HWIRQ %d\n", hwirq); + continue; + } + + break; + } while (1); } static int __init xilinx_intc_of_init(struct device_node *intc,