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=1796138657; b=bntseq3hIJ4Z/BYlSsOhP8TvEX5DFuQwyIl+pahEk6jzqnc8xxHNEw0fqUi0KNRIO1nM UbpJ848W+uUps6bhNvkDggVm6UYBquQL1WlQ3bbzPTnqtTwdFq5OMAlin+uo2WveBbVUY +uvkChDxsGspRCYcIn/rVqNqMVdP4mZIcpEHpYqYHLLhCy5PG7IMeHsvppeI6mndNz3yw DpokENQ17gAKE4ci3vfjfFH5dhtOf+Q04z/GPMEGoO4ebkQNZwPt2sxnXMQNnFg9/QNYJ swycJ43W+oSv03EIF6i9/2pieTRureN3jnWENg9O50ZiTvju/I0z/FzlAUiBnTTaDHw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796138657; h=Received:DKIM-Signature:From:To:Cc:Subject:In-Reply-To:References: Date:Message-ID:MIME-Version:Content-Type; bh=YOLGBf8c6mZCd5NgSjqyE5GNfzApBLgG1LsIXVyjVm4=; b=FSG6THAou+jEKckage6kwVPBUpd8z+GpZAaMmFkHc7NIPzRuizRPZYCHf//JLBRxzkz3 bMAdEkF7SKF9cBdU0i+KC3ix41Of337Uutl+Tzh2PWt+aIk3X/HQfiJZY31o/NlYFc/Vh tQrDOih8mWNrIZoNscfCGH9tnXEGBdBkPNSSS/5DOy4MniIKfXasMiRhHUA5Djaezp8k1 B6JM16m1LduqkL0cWA8WxLNEuWxag1Wyos1/VCic0WraPcDjMa2jvWX5HJ3Tz1khEGCYB EaAl7FT8Bdi4+614jqVjeXD3Ww7VevCwUG0fOnIfi6AD/DHOJER+XEbiZG9wtBlBOlw== 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=eqDYWeA6; 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 A4196606A31A; Tue, 1 Dec 2026 15:24:17 +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=eqDYWeA6 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-Mailing-List: linux-kernel@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 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