From: Thomas Gleixner <tglx@kernel.org>
To: Yu-Chun Lin <eleanor.lin@realtek.com>,
radu@rendec.net, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, lee@kernel.org, afaerber@suse.com
Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
mfd@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-realtek-soc@lists.infradead.org, james.tai@realtek.com,
cy.huang@realtek.com, stanley_chang@realtek.com,
eleanor.lin@realtek.com
Subject: Re: [PATCH v5 4/8] irqchip/realtek-intc-common: Add basic support for Realtek DHC SoCs
Date: Mon, 09 Nov 2026 10:11:58 +0100 [thread overview]
Message-ID: <87y0b2v069.ffs@fw13> (raw)
In-Reply-To: <20261018160653.3940371-5-eleanor.lin@realtek.com>
On Mon, Oct 19 2026 at 00:06, Yu-Chun Lin wrote:
> +static bool realtek_intc_dispatch(struct realtek_intc_subset_data *subset_data)
> +{
> + const struct realtek_intc_info *bank_info = subset_data->bank_info;
> + struct realtek_intc_data *data = subset_data->common;
> + u32 ints, inte, mask, val;
> + irq_hw_number_t hwirq;
> + bool handled = false;
> + int irq;
> +
> + if (regmap_read(data->base, bank_info->isr_offset, &val))
> + return false;
> +
> + ints = val & subset_data->subset_mask->ints_mask;
> +
> + if (!ints)
> + return false;
> +
> + if (regmap_read(data->base, bank_info->scpu_int_en_offset, &inte))
> + return false;
> +
> + while (ints) {
> + irq = __ffs(ints);
> + ints &= ~BIT(irq);
> +
> + mask = bank_info->isr_to_scpu_int_en_mask[irq];
> + if (mask != IRQ_ALWAYS_ENABLED && !(inte & mask))
> + continue;
> +
> + hwirq = (subset_data->bank_idx * 32) + irq;
> +
> + if (!generic_handle_domain_irq(data->domain, hwirq))
You might want to use generic_handle_demux_domain_irq() which allows you
to implement affinity setting for the individual demultiplexed interrupts/
> +static void realtek_intc_handler(struct irq_desc *desc)
> +{
> + struct realtek_intc_subset_data *subset_data = irq_desc_get_handler_data(desc);
> + struct irq_chip *chip = irq_desc_get_chip(desc);
> +
> + chained_irq_enter(chip, desc);
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=6cf0d999a18e799965cf2cf4a0157e257c805946
> + realtek_intc_dispatch(subset_data);
> +
> + chained_irq_exit(chip, desc);
> +}
> +int realtek_intc_probe(struct platform_device *pdev, const struct realtek_intc_desc *desc)
> +{
> + struct realtek_intc_data *data;
> + struct device *dev = &pdev->dev;
> + struct device_node *node = dev->of_node;
> + unsigned int total_subset_num = 0;
> + int ret, parent_irq = 0;
> +
> + for (unsigned int i = 0; i < desc->bank_num; i++)
> + total_subset_num += desc->banks[i].subset_num;
> +
> + data = devm_kzalloc(dev, struct_size(data, subset_data, total_subset_num),
> + GFP_KERNEL);
> + if (!data)
> + return -ENOMEM;
> +
> + data->saved_en = devm_kcalloc(dev, desc->bank_num, sizeof(*data->saved_en), GFP_KERNEL);
> + if (!data->saved_en)
> + return -ENOMEM;
> +
> + data->base = syscon_node_to_regmap(node->parent);
> + if (IS_ERR(data->base))
> + return PTR_ERR(data->base);
> +
> + data->desc = desc;
> +
> + data->domain = irq_domain_create_linear(of_fwnode_handle(node),
> + 32 * desc->bank_num,
> + &realtek_intc_domain_ops, data);
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=irq/drivers&id=51987720c2845807161f56f4714df4562f56f328
> + if (!data->domain)
> + return -ENOMEM;
Thanks,
tglx
next prev parent reply other threads:[~2026-11-09 9:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-18 16:06 [PATCH v5 0/8] Initial support for the Realtek interrupt controller Yu-Chun Lin
2026-10-18 16:06 ` [PATCH v5 1/8] dt-bindings: interrupt-controller: Add support for Realtek DHC SoCs Yu-Chun Lin
2026-10-20 7:25 ` Krzysztof Kozlowski
2026-10-18 16:06 ` [PATCH v5 2/8] dt-bindings: mfd: realtek,rtd1xxx: Add new SoCs Yu-Chun Lin
2026-10-19 9:11 ` Krzysztof Kozlowski
2026-10-18 16:06 ` [PATCH v5 3/8] dt-bindings: mfd: realtek,rtd1xxx: Add interrupt controller child node Yu-Chun Lin
2026-10-19 9:13 ` Krzysztof Kozlowski
2026-10-19 11:19 ` Yu-Chun Lin [林祐君]
2026-10-20 5:51 ` Krzysztof Kozlowski
2026-10-22 6:44 ` Yu-Chun Lin [林祐君]
2026-10-22 6:53 ` Krzysztof Kozlowski
2026-10-28 8:15 ` Yu-Chun Lin [林祐君]
2026-10-18 16:06 ` [PATCH v5 4/8] irqchip/realtek-intc-common: Add basic support for Realtek DHC SoCs Yu-Chun Lin
2026-11-09 9:11 ` Thomas Gleixner [this message]
2026-10-18 16:06 ` [PATCH v5 5/8] irqchip/realtek-rtd1319: Add driver for Realtek DHC RTD1319 SoC Yu-Chun Lin
2026-10-18 16:06 ` [PATCH v5 6/8] irqchip/realtek-rtd1319d: Add driver for Realtek RTD1319D and RTD1325 SoCs Yu-Chun Lin
2026-10-18 16:06 ` [PATCH v5 7/8] irqchip/realtek-rtd1619b: Add driver for Realtek DHC RTD1619B SoC Yu-Chun Lin
2026-10-18 16:06 ` [PATCH v5 8/8] irqchip/realtek-rtd1625: Add driver for Realtek DHC rtd1625 SoC Yu-Chun Lin
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=87y0b2v069.ffs@fw13 \
--to=tglx@kernel.org \
--cc=afaerber@suse.com \
--cc=conor+dt@kernel.org \
--cc=cy.huang@realtek.com \
--cc=devicetree@vger.kernel.org \
--cc=eleanor.lin@realtek.com \
--cc=james.tai@realtek.com \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-realtek-soc@lists.infradead.org \
--cc=mfd@lists.linux.dev \
--cc=radu@rendec.net \
--cc=robh@kernel.org \
--cc=stanley_chang@realtek.com \
/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
all inboxes | Powered by JetHome®