The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@kernel.org>
To: Jelly Jia <Jelly.Jia@cixtech.com>,
	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
Date: Tue, 01 Dec 2026 16:24:13 +0100	[thread overview]
Message-ID: <87v75dowgy.ffs@fw13> (raw)
In-Reply-To: <20261117094408.1393837-3-Jelly.Jia@cixtech.com>

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

  reply	other threads:[~2026-12-01 15:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17  9:44 [PATCH v4 0/5] soc: cix: Add the Sky1 AUDSS DMA-350 interrupt path Jelly Jia
2026-11-17  9:44 ` [PATCH v4 1/5] dt-bindings: soc: cix: Describe the Sky1 AUDSS DMA IRQ controller Jelly Jia
2026-11-18 19:10   ` Rob Herring (Arm)
2026-11-17  9:44 ` [PATCH v4 2/5] irqchip: Add the Sky1 AUDSS auxiliary interrupt controller Jelly Jia
2026-12-01 15:24   ` Thomas Gleixner [this message]
2026-11-17  9:44 ` [PATCH v4 3/5] clk: cix: Register the Sky1 AUDSS IRQ auxiliary device Jelly Jia
2026-11-19  1:42   ` Brian Masney
2026-11-20  1:51     ` Jelly Jia
2026-11-17  9:44 ` [PATCH v4 4/5] dt-bindings: dma: arm,dma-350: Document dma-channel-mask Jelly Jia
2026-11-17  9:44 ` [PATCH v4 5/5] dmaengine: arm-dma350: Honour dma-channel-mask Jelly Jia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v75dowgy.ffs@fw13 \
    --to=tglx@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=Jelly.Jia@cixtech.com \
    --cc=bmasney+clk@redhat.com \
    --cc=cix-kernel-upstream@cixtech.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=jbrunet+clk@baylibre.com \
    --cc=joakim.zhang@cixtech.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=radu@rendec.net \
    --cc=robh@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=sboyd@kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox