From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92EE4606A322 for ; Thu, 3 Dec 2026 10:07:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=qwVvJhLA; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WdisPl4h DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=nom+beawWpn8hPzCB6Uw9xC4iL3T7v+IfC3sBmRYYnU=; b=qwVvJhLAB3WGnqxz/osWT0vhgK bLjTFtGHhjtyE67k4Eq7N4KMhZVr58e26ISyBNSpuX4gvKXI4nYx7LogyU7F8utDFBB5dHthQPT5d wS2owPAVyX9+1ASlXkr3RujTEow8ZHyyTH/PXs58ltfNIvR9KnXxSRCsArkYinEWeF2NvY6GcptdA AybjvPZLuERTV3ALo3QkKyZpa68xXxBFVjeerxYeW7puBmw2GqY3z+8BCQ6df7WlOkuSbHcWmgk8z YnCQyn5to9TWQJqK66UDIGOg0WIzw2kOQ+toLJjFqAt/8eii1ICtp53HYO6LSz89/a4rMLSxuNkho oAxuG1Jg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZ3ie-0000000E7XX-44iu; Thu, 03 Dec 2026 10:07:16 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZ3ic-0000000E7XP-1SJt for linux-arm-kernel@lists.infradead.org; Thu, 03 Dec 2026 10:07:15 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id C3A164067D; Thu, 3 Dec 2026 10:07:13 +0000 (UTC) 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-Archived-By: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-5.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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....