Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp53034pxu; Thu, 10 Dec 2020 18:04:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXk3VNktK0ejRd9EFOifCiOfPT79n0EZCXP2KHCTrdr4JtpaGb5tmy2co0KFq2StFGavw6 X-Received: by 2002:a05:6402:100c:: with SMTP id c12mr10026055edu.356.1607652262396; Thu, 10 Dec 2020 18:04:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607652262; cv=none; d=google.com; s=arc-20160816; b=N11hvJH+4FuJIa8rplCB7eTrGp/cvkp4EZfGUPl+VxWHZA/nxUunA5VNZvnABfu/nz WAukjJk5GVazbiKopA/n5ALn+xlRJpwewJOUQZZ0TIK7UI9CgjYxjXaF+rnvlVbA4rYE 8zQSrd2dlhChvtOkkQQXgUtg8FaRnGu7t9UHGw40vPmvq65iIQynif/p1X/KlSGaLYbJ Nrq4IrIXSHRepCwO1JPeilPrug1ZMPLin1OvQPzBI778Xqok3Tvz+W1jYIFqnDjzyNv+ NThGtCQllMgP5EsPg6wymtxSG+IobqcLH+s3duuNgAGHXf1rYxv9chOp4dfml7Gxj+/8 cCIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from :dkim-signature:date; bh=akNM7fKKHpP5Kq9Ulj0Vtnigdx2jA2rylFdWFMQ85Bo=; b=dgACA6tAfGf5h449QbFCyGz94nkwBUfO0p67UgujmKGTj6v7+3nafy/NFYshLDnU34 TG+rv/SLD/nWtmKEpnTJHCQlgHwBlMEKTggOgv+0cLFsauHy1iiLqXh1e72Cgdp97Gkp /EFjlsJwRn7w1T96FRTNUNm8/XNxdwFHMbZOg51yh5z9DshsElTeP+H6k3kNE0ZscyxF B9A4P8u32yxCO/uMRWp7RQ7JrYpy6KqQ9WK2RP/1Kn4RtY0uvqjCdmnclsLEat7vzcH8 DuiIU1Nlg0MoW3AgE4F4I1yApIEWDY0EYsfVKx5G0tFbUtgTe50LH69Har039mtYsHiC akIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SgclQwK8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a5si3645048ejr.334.2020.12.10.18.03.59; Thu, 10 Dec 2020 18:04:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SgclQwK8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391060AbgLJPIx (ORCPT + 99 others); Thu, 10 Dec 2020 10:08:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:36342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390594AbgLJPIn (ORCPT ); Thu, 10 Dec 2020 10:08:43 -0500 Date: Thu, 10 Dec 2020 15:07:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607612882; bh=KoxOBKWsIg2Wt9l8K5GKIQKzwk5N7dcuEaIEps5LD5c=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=SgclQwK8xnkoZ5Cp6KABImVZgSOO74FBVdF7lcjniKRtgWMDMHJCtE85ifOLeNmZK o9bFiEPXXMD6QMSLicBzKLyXvfenbZe8kpwxX1SyddtcRqjGymF2Hbu9FD/di/gvmF jd3AgmfXG3jE+BqR+7jI2i2cB/U9pkZOSLWpOJ19JVHBEgZGFUOOkXlPa+RPE8z46a 07WlCKgK7tSTx0RqSkf/AtlJ7zC6Dhd+LR7UUqhfFDHfW565QjZ11qgBBW2ACfKhVK txyge2n4wlMDmHWEWKnXROPpAZA0nuauTEn3fd7t6Rg8/N6qC7hj0kZEvG6XRGoNgU q7/8QTPM/oQCg== From: Will Deacon To: Marc Zyngier Cc: LAK , linux-kernel , Catalin Marinas , Thomas Gleixner , Valentin Schneider , Peter Zijlstra , Mark Rutland , Russell King , Android Kernel Team Subject: Re: [PATCH v2 2/6] genirq: Allow an interrupt to be marked as 'raw' Message-ID: <20201210150756.GA10381@willie-the-truck> References: <20201124141449.572446-1-maz@kernel.org> <20201124141449.572446-3-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201124141449.572446-3-maz@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marc, On Tue, Nov 24, 2020 at 02:14:45PM +0000, Marc Zyngier wrote: > Some interrupts (such as the rescheduling IPI) rely on not going through > the irq_enter()/irq_exit() calls. To distinguish such interrupts, add > a new IRQ flag that allows the low-level handling code to sidestep the > enter()/exit() calls. > > Only the architecture code is expected to use this. It will do the wrong > thing on normal interrupts. Note that this is a band-aid until we can > move to some more correct infrastructure (such as kernel/entry/common.c). > > Signed-off-by: Marc Zyngier > --- > include/linux/irq.h | 2 ++ > kernel/irq/Kconfig | 3 +++ > kernel/irq/debugfs.c | 1 + > kernel/irq/irqdesc.c | 17 ++++++++++++----- > kernel/irq/settings.h | 15 +++++++++++++++ > 5 files changed, 33 insertions(+), 5 deletions(-) [...] > diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c > index 1a7723604399..f5beee546a6f 100644 > --- a/kernel/irq/irqdesc.c > +++ b/kernel/irq/irqdesc.c > @@ -667,10 +667,9 @@ int __handle_domain_irq(struct irq_domain *domain, unsigned int hwirq, > { > struct pt_regs *old_regs = set_irq_regs(regs); > unsigned int irq = hwirq; > + struct irq_desc *desc; > int ret = 0; > > - irq_enter(); > - > #ifdef CONFIG_IRQ_DOMAIN > if (lookup) > irq = irq_find_mapping(domain, hwirq); > @@ -680,14 +679,22 @@ int __handle_domain_irq(struct irq_domain *domain, unsigned int hwirq, > * Some hardware gives randomly wrong interrupts. Rather > * than crashing, do something sensible. > */ > - if (unlikely(!irq || irq >= nr_irqs)) { > + if (unlikely(!irq || irq >= nr_irqs || !(desc = irq_to_desc(irq)))) { > ack_bad_irq(irq); > ret = -EINVAL; > + goto out; > + } > + > + if (IS_ENABLED(CONFIG_ARCH_WANTS_IRQ_RAW) && > + unlikely(irq_settings_is_raw(desc))) { > + generic_handle_irq_desc(desc); Based on tglx's previous comments, I was expecting to see calls to __irq_{enter,exit}_raw() around this. Are they hiding somewhere else or are they not needed? Will