Linux Tegra architecture development
 help / color / mirror / Atom feed
From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: Besar Wicaksono <bwicaksono@nvidia.com>,
	will@kernel.org, robin.murphy@arm.com,
	ilkka@os.amperecomputing.com
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org,
	mark.rutland@arm.com, treding@nvidia.com, jonathanh@nvidia.com,
	vsethi@nvidia.com, rwiley@nvidia.com, sdonthineni@nvidia.com
Subject: Re: [PATCH v2 1/5] perf/arm_cspmu: Add arm_cspmu_acpi_dev_get
Date: Thu, 25 Sep 2025 09:30:55 +0100	[thread overview]
Message-ID: <331bea5f-cfab-49fb-87e4-7ec31523c2c3@arm.com> (raw)
In-Reply-To: <20250923001840.1586078-2-bwicaksono@nvidia.com>

On 23/09/2025 01:18, 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.
> 

Ok, but who needs this ? I couldn't see any users in the series.
Did I miss something ?

> Signed-off-by: Besar Wicaksono <bwicaksono@nvidia.com>
> ---
>   drivers/perf/arm_cspmu/arm_cspmu.c | 22 ++++++++++++++++++++++
>   drivers/perf/arm_cspmu/arm_cspmu.h |  9 +++++++++
>   2 files changed, 31 insertions(+)
> 
> diff --git a/drivers/perf/arm_cspmu/arm_cspmu.c b/drivers/perf/arm_cspmu/arm_cspmu.c
> index efa9b229e701..75b2d80f783e 100644
> --- a/drivers/perf/arm_cspmu/arm_cspmu.c
> +++ b/drivers/perf/arm_cspmu/arm_cspmu.c
> @@ -1090,6 +1090,28 @@ static int arm_cspmu_acpi_get_cpus(struct arm_cspmu *cspmu)
>   
>   	return 0;
>   }
> +
> +struct acpi_device *arm_cspmu_acpi_dev_get(const struct arm_cspmu *cspmu)
> +{
> +	char hid[16];
> +	char uid[16];
> +	struct acpi_device *adev;
> +	const struct acpi_apmt_node *apmt_node;
> +
> +	apmt_node = arm_cspmu_apmt_node(cspmu->dev);
> +	if (!apmt_node || apmt_node->type != ACPI_APMT_NODE_TYPE_ACPI)
> +		return NULL;
> +
> +	memset(hid, 0, sizeof(hid));
> +	memset(uid, 0, sizeof(uid));
> +
> +	memcpy(hid, &apmt_node->inst_primary, sizeof(apmt_node->inst_primary));
> +	sprintf(uid, "%u", apmt_node->inst_secondary);
> +
> +	adev = acpi_dev_get_first_match_dev(hid, uid, -1);
> +	return adev;
> +}
> +EXPORT_SYMBOL_GPL(arm_cspmu_acpi_dev_get);
>   #else
>   static int arm_cspmu_acpi_get_cpus(struct arm_cspmu *cspmu)
>   {
> diff --git a/drivers/perf/arm_cspmu/arm_cspmu.h b/drivers/perf/arm_cspmu/arm_cspmu.h
> index 19684b76bd96..9c5f11f98acd 100644
> --- a/drivers/perf/arm_cspmu/arm_cspmu.h
> +++ b/drivers/perf/arm_cspmu/arm_cspmu.h
> @@ -8,6 +8,7 @@
>   #ifndef __ARM_CSPMU_H__
>   #define __ARM_CSPMU_H__
>   
> +#include <linux/acpi.h>
>   #include <linux/bitfield.h>
>   #include <linux/cpumask.h>
>   #include <linux/device.h>
> @@ -222,4 +223,12 @@ int arm_cspmu_impl_register(const struct arm_cspmu_impl_match *impl_match);
>   /* Unregister vendor backend. */
>   void arm_cspmu_impl_unregister(const struct arm_cspmu_impl_match *impl_match);
>   
> +#if defined(CONFIG_ACPI)
> +/**
> + * Get ACPI device associated with the PMU.
> + * The caller is responsible for calling acpi_dev_put() on the returned device.
> + */
> +struct acpi_device *arm_cspmu_acpi_dev_get(const struct arm_cspmu *cspmu);
> +#endif
If we need this, why not add an empty stub for !CONFIG_ACPI case ? 
Similar to what we do for other cases.

Suzuki

> +
>   #endif /* __ARM_CSPMU_H__ */


  parent reply	other threads:[~2025-09-25  8:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-23  0:18 [PATCH v2 0/5] perf/arm_cspmu: Preparatory patches for NVIDIA T410 PMU Besar Wicaksono
2025-09-23  0:18 ` [PATCH v2 1/5] perf/arm_cspmu: Add arm_cspmu_acpi_dev_get Besar Wicaksono
2025-09-24 20:05   ` Ilkka Koskinen
2025-09-25  8:30   ` Suzuki K Poulose [this message]
2025-09-25 17:13     ` Besar Wicaksono
2025-09-26 10:01       ` Suzuki K Poulose
2025-09-23  0:18 ` [PATCH v2 2/5] perf/arm_cspmu: Add callback to reset filter config Besar Wicaksono
2025-09-24 20:06   ` Ilkka Koskinen
2025-09-25  9:23   ` Suzuki K Poulose
2025-09-23  0:18 ` [PATCH v2 3/5] perf/arm_cspmu: Add pmpidr support Besar Wicaksono
2025-09-23  0:18 ` [PATCH v2 4/5] perf/arm_cspmu: nvidia: Add revision id matching Besar Wicaksono
2025-09-23  0:18 ` [PATCH v2 5/5] perf/arm_cspmu: nvidia: Add pmevfiltr2 support Besar Wicaksono
2025-09-24 20:10   ` Ilkka Koskinen
2025-09-26 10:32   ` Robin Murphy
2025-09-26 16:35     ` Besar Wicaksono

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=331bea5f-cfab-49fb-87e4-7ec31523c2c3@arm.com \
    --to=suzuki.poulose@arm.com \
    --cc=bwicaksono@nvidia.com \
    --cc=ilkka@os.amperecomputing.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robin.murphy@arm.com \
    --cc=rwiley@nvidia.com \
    --cc=sdonthineni@nvidia.com \
    --cc=treding@nvidia.com \
    --cc=vsethi@nvidia.com \
    --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