From mboxrd@z Thu Jan 1 00:00:00 1970 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=-14.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 AFFE0C4707F for ; Thu, 27 May 2021 10:56:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 88DAD611CD for ; Thu, 27 May 2021 10:56:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236297AbhE0K5k (ORCPT ); Thu, 27 May 2021 06:57:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:39946 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236248AbhE0K5c (ORCPT ); Thu, 27 May 2021 06:57:32 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CDE18613AA; Thu, 27 May 2021 10:55:59 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1lmDgD-003vMq-R9; Thu, 27 May 2021 11:55:57 +0100 Date: Thu, 27 May 2021 11:55:50 +0100 Message-ID: <8735u8tphl.wl-maz@kernel.org> From: Marc Zyngier To: Valentin Schneider Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Gleixner , Lorenzo Pieralisi , Vincenzo Frascino Subject: Re: [RFC PATCH v2 02/10] genirq: Define irq_ack() and irq_eoi() helpers In-Reply-To: <20210525173255.620606-3-valentin.schneider@arm.com> References: <20210525173255.620606-1-valentin.schneider@arm.com> <20210525173255.620606-3-valentin.schneider@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: valentin.schneider@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tglx@linutronix.de, lorenzo.pieralisi@arm.com, vincenzo.frascino@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 25 May 2021 18:32:47 +0100, Valentin Schneider wrote: > > The newly-added IRQCHIP_AUTOMASKS_FLOW flag requires some additional > bookkeeping around chip->{irq_ack, irq_eoi}() calls. Define wrappers around > those chip callbacks to drive the IRQD_IRQ_FLOW_MASKED state of an IRQ when > the chip has the IRQCHIP_AUTOMASKS_FLOW flag. > > Signed-off-by: Valentin Schneider > --- > kernel/irq/chip.c | 16 ++++++++++++++++ > kernel/irq/internals.h | 2 ++ > 2 files changed, 18 insertions(+) > > diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c > index 21a21baa1366..793dbd8307b9 100644 > --- a/kernel/irq/chip.c > +++ b/kernel/irq/chip.c > @@ -408,6 +408,22 @@ void irq_percpu_disable(struct irq_desc *desc, unsigned int cpu) > cpumask_clear_cpu(cpu, desc->percpu_enabled); > } > > +void ack_irq(struct irq_desc *desc) > +{ > + desc->irq_data.chip->irq_ack(&desc->irq_data); > + > + if (desc->irq_data.chip->flags & IRQCHIP_AUTOMASKS_FLOW) > + irq_state_set_flow_masked(desc); > +} > + > +void eoi_irq(struct irq_desc *desc) > +{ > + desc->irq_data.chip->irq_eoi(&desc->irq_data); > + > + if (desc->irq_data.chip->flags & IRQCHIP_AUTOMASKS_FLOW) > + irq_state_clr_flow_masked(desc); > +} > + > static inline void mask_ack_irq(struct irq_desc *desc) > { > if (desc->irq_data.chip->irq_mask_ack) { > diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h > index b6c1cceddec0..090bd7868845 100644 > --- a/kernel/irq/internals.h > +++ b/kernel/irq/internals.h > @@ -87,6 +87,8 @@ extern void irq_enable(struct irq_desc *desc); > extern void irq_disable(struct irq_desc *desc); > extern void irq_percpu_enable(struct irq_desc *desc, unsigned int cpu); > extern void irq_percpu_disable(struct irq_desc *desc, unsigned int cpu); > +extern void irq_ack(struct irq_desc *desc); > +extern void irq_eoi(struct irq_desc *desc); Nit: we have {un,}mask_irq, but you add irq_{ack,eoi}. It'd be good to have some naming consistency (yes, this may/will clash with existing code, but we can fix that as well). Thanks, M. -- Without deviation from the norm, progress is not possible.