Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@arm.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Danilo Krummrich <dakr@kernel.org>,
	Johan Hovold <johan@kernel.org>,
	Daniel Scally <djrscally@gmail.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Saravana Kannan <saravanak@kernel.org>,
	Will Deacon <will@kernel.org>, Thomas Gleixner <tglx@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	Hanjun Guo <guohanjun@huawei.com>,
	Jeremy Linton <jeremy.linton@arm.com>,
	Marc Zyngier <maz@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Sudeep Holla <sudeep.holla@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Mike Leach <mike.leach@arm.com>,
	James Clark <james.clark@linaro.org>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	Al Grant <al.grant@arm.com>,
	"Johnny.Fan" <johnny.fan@cixtech.com>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	driver-core@lists.linux.dev, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 2/8] device property: Add software-node IRQ affinity masks
Date: Thu, 19 Nov 2026 16:54:04 +0000	[thread overview]
Message-ID: <20261119165404.GA9176@e132581.arm.com> (raw)
In-Reply-To: <avwHQXJxOir8XXxX@ashevche-desk.local>

On Tue, Nov 17, 2026 at 09:50:25AM +0200, Andy Shevchenko wrote:
> On Mon, Nov 16, 2026 at 06:21:29PM +0000, Leo Yan wrote:
> > Devices created from firmware tables may need CPU affinity information
> > without a corresponding firmware node. Allow software nodes to supply
> > this information through the common firmware node IRQ affinity API.
> > 
> > Add software_node_add_irq_affinity() to copy a CPU mask for an IRQ index,
> > and implement the software node irq_get_affinity callback. Keep each mask
> > until the node is released and reject replacement so borrowed masks remain
> > valid for the node's lifetime.
> 
> 
> This is definitely not a place where to put that. Are you stating that any
> software node might find the IRQ affinity information useful? I don't think
> so. With that in mind this approach looks like a layering violation.

My intent is to expose optional affinity information through the
common platform_get_irq_affinity() interface.

As an alternative, could we represent the masks in an "irq-affinity"
property, with one CPU mask per IRQ index? The swnode .irq_get_affinity
callback would read it, using the existing property storage.

Would interpreting this property in swnode still be a layering
violation? See the sample code below.

---8<---

+static const struct cpumask *
+software_node_irq_get_affinity(const struct fwnode_handle *fwnode,
+			       unsigned int index)
+{
+	const struct property_entry *prop;
+	const void *masks;
+	size_t size = cpumask_size();
+
+	prop = property_entry_get(to_swnode(fwnode)->node->properties, "irq-affinity");
+	if (!prop || index >= prop->length / size)
+		return NULL;
+
+	masks = property_get_pointer(prop);
+	return masks ? masks + index * size : NULL;
+}
+
 static const struct fwnode_operations software_node_ops = {
 	.get = software_node_get,
 	.put = software_node_put,
@@ -774,6 +796,7 @@ static const struct fwnode_operations software_node_ops = {
 	.graph_get_port_parent = software_node_graph_get_port_parent,
 	.graph_parse_endpoint = software_node_graph_parse_endpoint,
 	.add_links = software_node_add_links,
+	.irq_get_affinity = software_node_irq_get_affinity,
 };

> ...
> 
> And overall, the domain specific (IRQ, DMA, et cetera) topics feels a bit
> misplaced when one can find that in the generic properties. We also have
> that PHY thingy, which is complete alien to word 'generic'.

Since software nodes have no standard property specification of their
own, would this be an appropriate way to define "irq-affinity" as a
generic swnode property?

Thanks for the review!

Leo


  reply	other threads:[~2026-11-19 16:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 18:21 [PATCH 0/8] ACPI: arm64: Support PMU on Heterogeneous Systems Leo Yan
2026-11-16 18:21 ` [PATCH 1/8] device property: Add firmware node IRQ affinity callbacks Leo Yan
2026-11-17  7:42   ` Andy Shevchenko
2026-11-17  9:29     ` Leo Yan
2026-11-16 18:21 ` [PATCH 2/8] device property: Add software-node IRQ affinity masks Leo Yan
2026-11-17  7:50   ` Andy Shevchenko
2026-11-19 16:54     ` Leo Yan [this message]
2026-11-16 18:21 ` [PATCH 3/8] perf/arm_pmu: Register ACPI SPE and TRBE devices with software nodes Leo Yan
2026-11-16 18:21 ` [PATCH 4/8] perf/arm_pmu: Prepare ACPI registration for per-CPU interrupts Leo Yan
2026-11-16 18:21 ` [PATCH 5/8] perf/arm_pmu: Register ACPI CPU PMUs as platform devices Leo Yan
2026-11-16 18:21 ` [PATCH 6/8] perf/arm_pmu: Support ACPI devices in the platform probe Leo Yan
2026-11-16 18:21 ` [PATCH 7/8] perf/arm_pmu: Use ACPI CPU affinity in IRQ handling Leo Yan
2026-11-16 18:21 ` [PATCH 8/8] ACPI: arm64: Move PMU device registration to drivers/acpi/arm64/ Leo Yan

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=20261119165404.GA9176@e132581.arm.com \
    --to=leo.yan@arm.com \
    --cc=al.grant@arm.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=anshuman.khandual@arm.com \
    --cc=brgl@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=dakr@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=djrscally@gmail.com \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=guohanjun@huawei.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=james.clark@linaro.org \
    --cc=jeremy.linton@arm.com \
    --cc=johan@kernel.org \
    --cc=johnny.fan@cixtech.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=mike.leach@arm.com \
    --cc=peterz@infradead.org \
    --cc=rafael@kernel.org \
    --cc=robh@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=saravanak@kernel.org \
    --cc=sudeep.holla@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=tglx@kernel.org \
    --cc=will@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