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=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 85377C433F5 for ; Mon, 20 Sep 2021 11:26:28 +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 4D86260F93 for ; Mon, 20 Sep 2021 11:26:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4D86260F93 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nvOaw6vR9s2f9WMAtkENQOX8gQlQeQE6eAmb69dIX6I=; b=EvnBMOS0erkj+T QnNpau5YvYU/9z++dIOen7cSaRUfbMPhWl9C3/gfboGgnSE+uQXIRvM/rcA86KaJKNLn7tUzp5k7C EI8gj7qsnShMVT7EDGSFMiIFQ2g0N9py6PWI4FBqtEg1O+0wU9QysEI4NConyP4SwjH/rAKZwXymx WSFzm520iiDQmFIZCYYEhxkPX5SYpAgdC8ePoXNRH6fjHmyL02LwCz1KiBiDlVFukpd8u1iT2agWf 43PZjp67vQ9VdJhy1iILekYl+m5nCgYInsdot/PcSZ0tfBWZaofJWYW5y3L4HWKY03zheDkjOpIUb VtsZv+TJpoN3SuMa8tgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSHPV-001Pmh-JJ; Mon, 20 Sep 2021 11:24:33 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSHPS-001PmE-00 for linux-arm-kernel@lists.infradead.org; Mon, 20 Sep 2021 11:24:31 +0000 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 B1D5860F56; Mon, 20 Sep 2021 11:24:29 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] 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 1mSHPP-00BkJd-M9; Mon, 20 Sep 2021 12:24:27 +0100 Date: Mon, 20 Sep 2021 12:24:27 +0100 Message-ID: <87wnnbv6ac.wl-maz@kernel.org> From: Marc Zyngier To: Daniel Palmer Cc: DTML , Rob Herring , Thomas Gleixner , linux-arm-kernel , Romain Perier Subject: Re: [PATCH 2/3] irqchip: SigmaStar SSD20xD gpi In-Reply-To: References: <20210914100415.1549208-1-daniel@0x0f.com> <20210914100415.1549208-3-daniel@0x0f.com> <87zgs7vavl.wl-maz@kernel.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 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") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: daniel@0x0f.com, devicetree@vger.kernel.org, robh+dt@kernel.org, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, romain.perier@gmail.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210920_042430_107790_3A24DCC9 X-CRM114-Status: GOOD ( 28.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 20 Sep 2021 11:05:26 +0100, Daniel Palmer wrote: > > Hi Marc, > > On Mon, 20 Sept 2021 at 18:45, Marc Zyngier wrote: > > > +static void ssd20xd_gpi_unmask_irq(struct irq_data *data) > > > +{ > > > + irq_hw_number_t hwirq = irqd_to_hwirq(data); > > > + struct ssd20xd_gpi *gpi = irq_data_get_irq_chip_data(data); > > > + int offset_reg = REG_OFFSET(hwirq); > > > + int offset_bit = BIT_OFFSET(hwirq); > > > + > > > + regmap_update_bits(gpi->regmap, REG_MASK + offset_reg, offset_bit, 0); > > > > Is this regmap call atomic? When running this, you are holding a > > raw_spinlock already. From what I can see, this is unlikely to work > > correctly with the current state of regmap. > > I didn't even think about it. I will check. You may want to enable lockdep to verify that. > > > > +static void ssd20x_gpi_chainedhandler(struct irq_desc *desc) > > > +{ > > > + struct ssd20xd_gpi *intc = irq_desc_get_handler_data(desc); > > > + struct irq_chip *chip = irq_desc_get_chip(desc); > > > + unsigned int irqbit, hwirq, virq, status; > > > + int i; > > > + > > > + chained_irq_enter(chip, desc); > > > + > > > + for (i = 0; i < NUM_IRQ / IRQS_PER_REG; i++) { > > > + int offset_reg = STRIDE * i; > > > + int offset_irq = IRQS_PER_REG * i; > > > + > > > + regmap_read(intc->regmap, REG_STATUS + offset_reg, &status); > > > > Does this act as an ACK in the HW? > > Not that I'm aware of. The status registers have the interrupt bits > set until the EOI callback is called from what I can tell. Then this doesn't work for edge signalling, as you will lose interrupts that occur between the handling and EOI. > Technically I think the EOI callback should actually be ACK instead > but from my fuzzy memory with the stack of IRQ controllers that > resulted in a null pointer dereference. That's probably because you are using the wrong flow handler. You should turn this irq_eoi into an irq_ack, because that's really what it is, and use handle_edge_irq() as the flow handler. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel