Re: [PATCH v3 1/5] perf/arm_cspmu: Add arm_cspmu_acpi_dev_get
From: Suzuki K Poulose
Date: Tue Sep 30 2025 - 09:05:15 EST
On 30/09/2025 14:00, Besar Wicaksono wrote:
-----Original Message-----
From: Suzuki K Poulose <suzuki.poulose@xxxxxxx>
Sent: Tuesday, September 30, 2025 3:38 AM
To: Besar Wicaksono <bwicaksono@xxxxxxxxxx>; will@xxxxxxxxxx;
robin.murphy@xxxxxxx; ilkka@xxxxxxxxxxxxxxxxxxxxxx
Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; linux-
tegra@xxxxxxxxxxxxxxx; mark.rutland@xxxxxxx; Thierry Reding
<treding@xxxxxxxxxx>; Jon Hunter <jonathanh@xxxxxxxxxx>; Vikram Sethi
<vsethi@xxxxxxxxxx>; Rich Wiley <rwiley@xxxxxxxxxx>; Shanker Donthineni
<sdonthineni@xxxxxxxxxx>
Subject: Re: [PATCH v3 1/5] perf/arm_cspmu: Add arm_cspmu_acpi_dev_get
External email: Use caution opening links or attachments
On 30/09/2025 01:26, Besar Wicaksono wrote:
> Add interface to get ACPI device associated with the
> PMU. This ACPI device may contain additional properties
> not covered by the standard properties.
>
> Signed-off-by: Besar Wicaksono <bwicaksono@xxxxxxxxxx>
Repeat: Where is the user ?
I thought you were okay if the use case is on future (different) series.
So, this is a heads up on what I will have in nvidia_cspmu when adding the
new PMU support. Do you prefer it to be part of this series?
No, I recommended the opposite. Apologies, if that wasn't clear.
Add a helper only when there is a user.
Suzuki
+static u32 nv_cspmu_get_inst_id(const struct arm_cspmu *cspmu)
+{
+ u32 inst_id;
+ struct fwnode_handle *fwnode;
+ struct acpi_device *adev;
+
+ inst_id = 0;
+
+ adev = arm_cspmu_acpi_dev_get(cspmu);
+ if (!adev)
+ return 0;
+
+ fwnode = acpi_fwnode_handle(adev);
+ if (fwnode && fwnode_property_read_u32(fwnode, "instance_id", &inst_id))
+ kstrtou32(acpi_device_uid(adev), 0, &inst_id);
+
+ acpi_dev_put(adev);
+ return inst_id;
+}
Thanks,
Besar