From patchwork Mon Dec 14 02:25:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 11971173 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58A42C4361B for ; Mon, 14 Dec 2020 02:29:19 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 E5A5822240 for ; Mon, 14 Dec 2020 02:29:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E5A5822240 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id: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=lNHVA6MIQ6GFPEGJBJ8Ao4o6yfbTDSIrsbOJ02L6n14=; b=qIChloD+85k+3rXFeHaa0ekKL1 0t5Kgc14U2XgTB6HllC06sUNiVu83U/oPqggPUL7CeVGj20mJ0e98ydru8L9f+zTALWXrYW2rjhjV eY6v3/FzCAfLnc6hhLNVl5AHcqJ/OyH0bivk9OKXJPVr6n/I3/qFT4a/Nf6ks0NtCEjZdD1S61jWF qdpVh3OAYvF0+W/UkmasMr7q/DeXTdCSbdpDJsbiUzg1esK0GKfGBFxs+ewW2AzZbf8CorP3tWIKT AzTaoXJ1TSDft9YgS26Szv9OIVG1m6zmv/bjx7sfpHq8b8d+kon8yR17dPzPCDDS2thket5Ug90Tb tT/p832g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kodar-0002Rc-Ea; Mon, 14 Dec 2020 02:28:09 +0000 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kodap-0002R6-7K for linux-arm-kernel@lists.infradead.org; Mon, 14 Dec 2020 02:28:08 +0000 Received: by mail-pj1-x1042.google.com with SMTP id iq13so5405116pjb.3 for ; Sun, 13 Dec 2020 18:28:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mkeZgFrWNtwvlgO0x2SwOEsdL2dSm3JTnIiHUjKwwMw=; b=UuD1lfsbKUeNF+K+/mAE9k6hzwu1neOHzNwXOo1D4wrpysOBWipW4MVcOAgf10zWoD mOu/l0JYXz6SUTn0nOm1j5/dd+ITCbNQG4UO1ZlDatAnnsj6udOMZjPFUZzbm5hoz3Lq 4nf04V0qcWPaj6cXXwrTkmARIZ60wVJNI1uiZq+WyK2CftEMb+J7DM1FqmSdDJN/9TWt UhyfMvsSqij18io4Gd1/8XYQYBv7LeSfDoUJc3EIA64fchHTjsJUIPJSvtEKlzUoUJp1 ylkdTh8kLOHLvSZqg6ewVKhl39H3fA1jssANMlS+6rCEWJ84J2vOfDIaRYUvHQDw/UX+ VSrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mkeZgFrWNtwvlgO0x2SwOEsdL2dSm3JTnIiHUjKwwMw=; b=YmXZszei9suDZp5Nq6euvVpqYfe6fKehM3o6i8c4/8YqOIrafKF+Cu0Pl0cAyYspdG 4A0IH4zC8Ff0v/QuXATqjTZ3BJ4+wZ6vhKkuHJ3FplGm1zw5RajYedemt2/qvJWdG7SO ZCIbHChD3sMBKtbAtza+GrNweY1rd9OHhA+gAqB53NxCuM+w6LZcUBohH/qeo3hA9lYh ugRy+iw5YaJmibuCOhAh2B0A3VnmZSpIJGPahXcBfExHoFn4SJoGFb5CZ8PhPr1e3IV6 WmJ3nrDeJEOlseaWEuXdIwFyS44la6Kz85siaTYrxIq4PHzSAPdAe0LCADcuAVBaGIk6 343g== X-Gm-Message-State: AOAM531QO2S/gynZ1N/9DxtrzsVFnOIyx8+Dr6z0V/NAs0Zk+/s4NCOY 2YSWJ6FdiuEqRek3rH+t3Iv/u7eBc2yioHs= X-Google-Smtp-Source: ABdhPJzsaoZK1g7l+cdQLwS+Z4AhJIjgWzNz5xIQIQGanuGSC1EwBS7UgxJafafz0baw601Y794d5g== X-Received: by 2002:a17:90a:970b:: with SMTP id x11mr23148956pjo.16.1607912884984; Sun, 13 Dec 2020 18:28:04 -0800 (PST) Received: from localhost.localdomain ([111.199.190.168]) by smtp.gmail.com with ESMTPSA id l197sm18118148pfd.97.2020.12.13.18.28.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Dec 2020 18:28:04 -0800 (PST) From: Pingfan Liu To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/3] kernel/irq: __handle_domain_irq() makes irq_enter/exit arch optional Date: Mon, 14 Dec 2020 10:25:50 +0800 Message-Id: <1607912752-12481-1-git-send-email-kernelfans@gmail.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201213_212807_327125_85D821DD X-CRM114-Status: GOOD ( 13.78 ) 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: Mark Rutland , Julien Thierry , Catalin Marinas , Pingfan Liu , Marc Zyngier , Will Deacon MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Arches may implement their own counterpart of irq_enter/exit in the frontend. Hence make the pair in __handle_domain_irq() arch optional Signed-off-by: Pingfan Liu Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Marc Zyngier Cc: Julien Thierry To: linux-arm-kernel@lists.infradead.org --- kernel/irq/Kconfig | 4 ++++ kernel/irq/irqdesc.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/kernel/irq/Kconfig b/kernel/irq/Kconfig index 164a031cfdb6..f17a9c8771c1 100644 --- a/kernel/irq/Kconfig +++ b/kernel/irq/Kconfig @@ -100,6 +100,10 @@ config IRQ_MSI_IOMMU config HANDLE_DOMAIN_IRQ bool +config ARCH_HAS_IRQENTRY_ENTER + bool + select HANDLE_DOMAIN_IRQ + config IRQ_TIMINGS bool diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 1a7723604399..77819e489f9b 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -669,7 +669,9 @@ int __handle_domain_irq(struct irq_domain *domain, unsigned int hwirq, unsigned int irq = hwirq; int ret = 0; +#ifndef CONFIG_ARCH_HAS_IRQENTRY_ENTER irq_enter(); +#endif #ifdef CONFIG_IRQ_DOMAIN if (lookup) @@ -687,7 +689,9 @@ int __handle_domain_irq(struct irq_domain *domain, unsigned int hwirq, generic_handle_irq(irq); } +#ifndef CONFIG_ARCH_HAS_IRQENTRY_ENTER irq_exit(); +#endif set_irq_regs(old_regs); return ret; }