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=-4.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 7AC96C433E0 for ; Thu, 14 Jan 2021 21:07:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 29F2323A3C for ; Thu, 14 Jan 2021 21:07:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728798AbhANVGp (ORCPT ); Thu, 14 Jan 2021 16:06:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:45166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727481AbhANVGp (ORCPT ); Thu, 14 Jan 2021 16:06:45 -0500 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 1D99823A01; Thu, 14 Jan 2021 21:06:04 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1l09of-007bU8-GL; Thu, 14 Jan 2021 21:06:02 +0000 Date: Thu, 14 Jan 2021 21:06:00 +0000 Message-ID: <87turjjkjr.wl-maz@kernel.org> From: Marc Zyngier To: Samuel Holland Cc: Thomas Gleixner , Rob Herring , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Ondrej Jirman , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 03/10] irqchip/sun6i-r: Use a stacked irqchip driver In-Reply-To: <20210112055950.21209-4-samuel@sholland.org> References: <20210112055950.21209-1-samuel@sholland.org> <20210112055950.21209-4-samuel@sholland.org> 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 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: samuel@sholland.org, tglx@linutronix.de, robh+dt@kernel.org, mripard@kernel.org, wens@csie.org, jernej.skrabec@siol.net, megous@megous.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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 Hi Samuel, On 2021-01-12 05:59, Samuel Holland wrote: [...] > +static void sun6i_r_intc_ack_nmi(void) > +{ > + writel(SUN6I_NMI_BIT, base + SUN6I_IRQ_PENDING(0)); writel_relaxed() > +} > + > +static void sun6i_r_intc_nmi_ack(struct irq_data *data) > +{ > + if (irqd_get_trigger_type(data) & IRQ_TYPE_EDGE_BOTH) > + sun6i_r_intc_ack_nmi(); > + else > + data->chip_data = SUN6I_NMI_NEEDS_ACK; > +} > + > +static void sun6i_r_intc_nmi_eoi(struct irq_data *data) > +{ > + /* For oneshot IRQs, delay the ack until the IRQ is unmasked. */ > + if (data->chip_data == SUN6I_NMI_NEEDS_ACK && !irqd_irq_masked(data)) > { > + sun6i_r_intc_ack_nmi(); > + data->chip_data = 0; nit: NULL rather than 0? [...] > +static struct irq_chip sun6i_r_intc_nmi_chip = { > + .name = "sun6i-r-intc", > + .irq_ack = sun6i_r_intc_nmi_ack, > + .irq_mask = irq_chip_mask_parent, > + .irq_unmask = sun6i_r_intc_nmi_unmask, > + .irq_eoi = sun6i_r_intc_nmi_eoi, > + .irq_set_affinity = irq_chip_set_affinity_parent, > + .irq_set_type = sun6i_r_intc_nmi_set_type, > + .irq_set_irqchip_state = sun6i_r_intc_nmi_set_irqchip_state, You probably also want to wire irq_get_irqchip_state(), while you're at it. Otherwise, looks pretty good now. Thanks, M. -- Without deviation from the norm, progress is not possible.