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 7DE1F606A320 for ; Tue, 1 Dec 2026 15:24:37 +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=3/D+b+qP; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=eqDYWeA6 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=YOLGBf8c6mZCd5NgSjqyE5GNfzApBLgG1LsIXVyjVm4=; b=3/D+b+qP5Z6g/e3b6JWtlj2syp ethUq9cZ/MDsoOMObtGIU0Xrt6wnBrQWQSci1PpF/mssv65dso9dKRAFAn9KL9SEoFVeISzcCUbCh 1jwwcYjHkGg3ed8XO7WFHDLUNjtav9o0YWaE9EXy70Ey7KF7G8pdPJ0vSUzVbOWOKT2di+ngQcdko jR3VmViLReYYsEYZWnbe9qS9lVW7IypOj+nI96spsl+7RqFk8psxkGvZGr9QWCKdKIeyhYNdNFBRf TXC+VdywrW4Qe9Btyz/vLmUpglRsry34MnsApDvbq5MvBImlHgVhaXa716cIig7coEjy1Ien/paaN ZLcF92qA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYPiN-00000008X0V-3IkQ; Tue, 01 Dec 2026 15:24:19 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYPiM-00000008X09-2LLD for linux-arm-kernel@lists.infradead.org; Tue, 01 Dec 2026 15:24:18 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id B2135605D9; Tue, 1 Dec 2026 15:24:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 351331F008A0; Tue, 1 Dec 2026 15:24:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796138656; bh=YOLGBf8c6mZCd5NgSjqyE5GNfzApBLgG1LsIXVyjVm4=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=eqDYWeA6RGNfvAxWTVCvrliI7W1Kqd7lYH58ynnjpwXtnmV97cWhh8YUWHiJZeCTm bwc0qCK8Vdj485yTTh9cdBZjVyX7WoycZVUWdt51R1aHswMi8miUi5r/5+PojOiejp k9pMRatE18hF7EX5r6z9CvF2Mjhv/lS6NnH/1Iip3xFskfhbE1BpGct4UR5B3y1WK8 PmilL1SYKxM9tJSGiJleH0zk+PVpYALsPr1C22CnAP74c7xYjAg5q7uZ+lW9pfsxr8 DyjpKWc0o/BbfPy0DfbhTeXhF3Jd1YRH2fjf7RqQUmS/cydx3HAVA1+B1wY0g4mWPw cHXCAQOEhY3rw== From: Thomas Gleixner To: Jelly Jia , 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 Cc: devicetree@vger.kernel.org, cix-kernel-upstream@cixtech.com, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jelly.Jia@cixtech.com, linux-clk@vger.kernel.org, joakim.zhang@cixtech.com, radu@rendec.net Subject: Re: [PATCH v4 2/5] irqchip: Add the Sky1 AUDSS auxiliary interrupt controller In-Reply-To: <20261117094408.1393837-3-Jelly.Jia@cixtech.com> References: <20261117094408.1393837-1-Jelly.Jia@cixtech.com> <20261117094408.1393837-3-Jelly.Jia@cixtech.com> Date: Tue, 01 Dec 2026 16:24:13 +0100 Message-ID: <87v75dowgy.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 Tue, Nov 17 2026 at 17:44, Jelly Jia wrote: > +#define INFO_AP_IRQC 0x54 > +#define INFO_AP_IRQC_DMAC_MASK GENMASK(7, 0) > +#define SKY1_AUDSS_DMAC_IRQS 8 > + > +struct sky1_audss_irq { > + struct regmap *regmap; > + struct irq_domain *domain; > + int parent_irq; > +}; Please use tabular layout for the defines and struct declaration. https://docs.kernel.org/process/maintainer-tip.html > + > +static void sky1_audss_irq_mask(struct irq_data *d) > +{ > + struct sky1_audss_irq *priv = irq_data_get_irq_chip_data(d); > + > + regmap_update_bits(priv->regmap, INFO_AP_IRQC, BIT(d->hwirq), 0); > +} > + > +static void sky1_audss_irq_unmask(struct irq_data *d) > +{ > + struct sky1_audss_irq *priv = irq_data_get_irq_chip_data(d); > + > + regmap_update_bits(priv->regmap, INFO_AP_IRQC, > + BIT(d->hwirq), BIT(d->hwirq)); No line break requied you have 100 characters. > +} > + > +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? > + > +static struct irq_chip sky1_audss_irq_chip = { > + .name = "sky1-audss-dmac", > + .irq_mask = sky1_audss_irq_mask, > + .irq_unmask = sky1_audss_irq_unmask, > + .irq_disable = sky1_audss_irq_mask, > + .irq_request_resources = sky1_audss_irq_request_resources, > + .irq_release_resources = sky1_audss_irq_release_resources, > + .flags = IRQCHIP_SKIP_SET_WAKE, > +}; > + > +static int sky1_audss_irq_map(struct irq_domain *d, unsigned int irq, > + irq_hw_number_t hwirq) > +{ > + if (hwirq >= SKY1_AUDSS_DMAC_IRQS) > + return -EINVAL; > + > + irq_set_chip_data(irq, d->host_data); > + irq_set_chip_and_handler(irq, &sky1_audss_irq_chip, handle_level_irq); > + /* > + * 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 ... > + irq_set_noprobe(irq); > + > + return 0; > +} > + > +static const struct irq_domain_ops sky1_audss_irq_ops = { > + .map = sky1_audss_irq_map, > + .xlate = irq_domain_xlate_onecell, > +}; > + > +static void sky1_audss_irq_handler(struct irq_desc *desc) > +{ > + struct sky1_audss_irq *priv = irq_desc_get_handler_data(desc); > + struct irq_chip *chip = irq_desc_get_chip(desc); > + unsigned long enabled; > + unsigned int hwirq; > + u32 val; > + > + chained_irq_enter(chip, desc); > + > + if (!regmap_read(priv->regmap, INFO_AP_IRQC, &val)) { .. clearly reads the pending bits, no? > + enabled = val & INFO_AP_IRQC_DMAC_MASK; > + for_each_set_bit(hwirq, &enabled, SKY1_AUDSS_DMAC_IRQS) > + generic_handle_domain_irq(priv->domain, hwirq); > + } > + > + chained_irq_exit(chip, desc); > +} > + > +static int sky1_audss_irq_runtime_suspend(struct device *dev) > +{ > + struct sky1_audss_irq *priv = dev_get_drvdata(dev); > + > + /* 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. Thanks, tglx