[PATCH 1/8] device property: Add firmware node IRQ affinity callbacks

Leo Yan leo.yan at arm.com
Tue Nov 17 01:29:08 PST 2026


On Tue, Nov 17, 2026 at 09:42:24AM +0200, Andy Shevchenko wrote:
> On Mon, Nov 16, 2026 at 06:21:28PM +0000, Leo Yan wrote:
> > Platform IRQ affinity lookup currently selects the OF or ACPI helper
> > directly. Add fwnode_irq_get_affinity() and an irq_get_affinity operation
> > implemented by both firmware types.
> > 
> > Use the new helper for platform devices, preserving the existing fallback
> > to cpu_possible_mask when affinity information is unavailable.
> 
> From this commit message it's unclear why we do that. Is it any helpful in the
> future? If yes, for what?

This refactoring lets platform devices backed by swnode provide IRQ
affinity through the common fwnode interface. Patch 02 provides swnode's
IRQ affinity callback.

I will reply your comments in patch 02 for why we need swnode to
store IRQ affinity.

> ...
> 
> > static const struct cpumask *get_irq_affinity(struct platform_device *dev,
> 
> >  {
> >  	const struct cpumask *mask = NULL;
> >  #ifndef CONFIG_SPARC
> 
> > -	struct fwnode_handle *fwnode = dev_fwnode(&dev->dev);
> > -
> 
> Might be unneeded churn — you can leave these two lines being untouched.
> 
> > -	if (is_of_node(fwnode))
> > -		mask = of_irq_get_affinity(to_of_node(fwnode), num);
> > -	else if (is_acpi_device_node(fwnode))
> > -		mask = acpi_irq_get_affinity(ACPI_HANDLE_FWNODE(fwnode), num);
> 
> > +	mask = fwnode_irq_get_affinity(dev_fwnode(&dev->dev), num);
> 
> 	mask = fwnode_irq_get_affinity(fwnode, num);
> 
> >  #endif
> 
> >  	return mask ?: cpu_possible_mask;
> 
> But I understand the point as we have only a single user left. So I am not
> objecting the proposed approach, just pointed out on an alternative.

I'll keep the local fwnode variable as you suggest.

> ...
> 
> > +++ b/include/linux/fwnode.h
> 
> >  struct fwnode_operations;
> >  struct device;
> > +struct cpumask;
> 
> Yes, it's a bit disordered, can you place the new one before the 'device'
> to follow alphabetical order?

Will do.

Thanks,
Leo



More information about the linux-arm-kernel mailing list