From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796292434; b=G0WFtuMDTMV2O8lavIf0k4WoaCmu1Wobq1Dy/wrK6EHyXxTPuaC4gs6nX2pFekh4ojdg btgrWud/x/SSjzI1mYZkfHQ99zuwFZQEaeKBr57GmYGgFzQB3hw5Msy7ypO0pBXy8Jk6G hOGkTmBsX86wOkAnHB9ZlfCrIUTdJG0hqQomI2twRgOfbIUAG7Q+Hmp49wAI50O8FkQuh /r5uTRHNwXoMPk1ZFFT22drzdeJTKgWhmqXvG0XEf3TFlxBQ/u0DSD7g5fOA2UG3/uBZD +2mCARHYNhuJdpoJBx9YE43mFdu2315iLuAyK22Axys44sL+oWC8krHAKXOtX2YT5Pg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796292434; h=Received:DKIM-Signature:From:To:Cc:Subject:In-Reply-To:References: Date:Message-ID:MIME-Version:Content-Type; bh=nom+beawWpn8hPzCB6Uw9xC4iL3T7v+IfC3sBmRYYnU=; b=pr0AcDppWp79fMmrirPFqLh3Igb37NvsZvScWecrMfzpA+4iHKUgNy6Tl3QvfnNRSiTh nDjZILEEJAyTgYByqmpRBny49Qapcpzzuqv1weOxSQh3buFxl4NkLTIhZK4M3SpmbbDdl /a/UCpjOs942BXJ4bBStoEfELU+rgbnUo+oTC6XOOLJUQ7lMqnOIeYB+3Zbzad9HCsOIl msjPemn4bpiKBXUMh6HQ4M4LB3fThlO7fRbppa2Gv+rqLZE2CemiKM2tOyzdTq3+6Hsmk mccqWVMoqu1ORvVFjZASZUs+QnyDAcezApkHewlzyVNO1QD3KCKEXCh6u2VbeupbivA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WdisPl4h; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2109E606A322; Thu, 3 Dec 2026 10:07:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WdisPl4h Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2C161F00893; Thu, 3 Dec 2026 10:07:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796292433; bh=nom+beawWpn8hPzCB6Uw9xC4iL3T7v+IfC3sBmRYYnU=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=WdisPl4hiZSFbPF6l1VidN4OqDzJybdT77dsZmUh6xMci/uGURgnwgGWFRwsTtexM QVnnEh9/Y6bHH/S5H28nh+2qpT+3LfjNspgSUjprmQG6x8XlXlrT8QTn27MahIHbbR 5J2cN2hi3CQO4IGprX6/dg8uluzxhwwca9Wwm5L/VJyCbJiJA75Foht8tx2SVXbDEi jV8Y8ZaWs/G4pxUSPTKOt46JqKaIpuwfFxHLi/5KD+TM8AtuVKgkYRrb6zn641DjvC HiQKj7VfLWYTjKIbXekLwUbwjTlMF18nXtIQS+Brta82Y0MG8me6QUbJDWfrykNguM gfIhqN23A08Dg== From: Thomas Gleixner To: Jelly Jia Cc: vkoul@kernel.org, Frank.Li@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, robin.murphy@arm.com, sboyd@kernel.org, bmasney+clk@redhat.com, jbrunet+clk@baylibre.com, devicetree@vger.kernel.org, cix-kernel-upstream@cixtech.com, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, joakim.zhang@cixtech.com, radu@rendec.net Subject: Re: [PATCH v5 2/6] irqchip: Add the Sky1 AUDSS auxiliary interrupt controller In-Reply-To: References: <20261120053529.371923-1-Jelly.Jia@cixtech.com> <20261120053529.371923-3-Jelly.Jia@cixtech.com> <87ecc0q2im.ffs@fw13> Date: Thu, 03 Dec 2026 11:07:10 +0100 Message-ID: <87h5guoey9.ffs@fw13> X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain On Wed, Dec 02 2026 at 20:37, Jelly Jia wrote: >>> +static int sky1_audss_irq_request_resources(struct irq_data *d) >>> +{ >>> + return try_module_get(THIS_MODULE) ? 0 : -ENODEV; >>> +} >>> + >>> +static void sky1_audss_irq_release_resources(struct irq_data *d) >>> +{ >>> + module_put(THIS_MODULE); >>> +} >> >> What's the point of this exercise? > > These callbacks pin the IRQ driver module while a child IRQ is > requested, preventing the provider from being unloaded while a DMA > consumer still owns an IRQ. Runtime PM references do not pin the module. > This follows the same pattern as irq-pruss-intc.c. Ok. I wonder if this should be made generic as that's a general life time problem for all modular interrupt chip drivers. Let me think about it. >>> + /* >>> + * There is no per-channel pending status in the CRU. Poll enabled >>> + * children without spurious-IRQ accounting, but retain level flow >>> + * control so disabled and oneshot-threaded children stay masked. >>> + */ >>> + irq_set_status_flags(irq, IRQ_LEVEL | IRQ_IS_POLLED); >> >> Huch? The chained handler below ... >> >>> + if (!regmap_read(priv->regmap, INFO_AP_IRQC, &val)) { >> >> .. clearly reads the pending bits, no? > > INFO_AP_IRQC at offset 0x54 is an enable register, not a pending register. > The hardware documentation defines bits 0-7 as read/write AP DMA channel > interrupt enables, with a reset value of zero. Misread that. > We therefore dispatch all enabled channels and let each DMA handler > check its actual status. IRQ_IS_POLLED avoids spurious-IRQ accounting > for the expected IRQ_NONE returns. I'll clarify this in the comments. Yes, please. >>> + /* The parent CRU may turn its clocks off after the child suspends. */ >>> + disable_irq(priv->parent_irq); >> >> This operates on the interrupt which runs the chained handler, which >> means disable_irq() is _not_ synchronizing against a handler in flight >> on a different CPU because chained handlers do not set/clear INPROGRESS. >> >> Please explain how this is supposed to be correct under all circumstances. > > I understand that chained handlers do not set IRQD_IRQ_INPROGRESS. > For Sky1, the parent is a non-forwarded GICv3 SPI, and the current code > relies on the additional ACTIVE-state check in synchronize_irq(). > > IRQ_DISABLE_UNLAZY ensures that disable_irq() masks the parent. > synchronize_irq() then checks IRQCHIP_STATE_ACTIVE through > gic_irq_get_irqchip_state(). Deactivation happens in chained_irq_exit(), > after all CRU accesses and child IRQ dispatches. In split EOI mode, > the earlier EOIR write only drops priority, without deactivating the IRQ. > > My understanding is that this waits until the resource accesses have > finished before suspend or teardown continues. This relies on GICv3's > ACTIVE-state support. So it works by chance and not by design. > Is there a case in this path that I have overlooked? I don't think so, but this needs a big fat comment....