All of lore.kernel.org
 help / color / mirror / Atom feed
* [Devel] Re: [PATCH 2/2] ACPI: ARM Performance Monitoring Unit Table (APMT) initial support
@ 2022-05-04 22:08 Besar Wicaksono
  0 siblings, 0 replies; 4+ messages in thread
From: Besar Wicaksono @ 2022-05-04 22:08 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 2430 bytes --]

Hi Sudeep,

> Any particular reason why you would like to rush and push this without
> the actual driver to probe the device being added here ?

I plan to have two patch series, one for ACPI patch (this patch) and one for driver patch.
My understanding is the driver patch will depend on this patch, but not the other way. So, I thought it would be better to get this patch approved first.
However, if it helps the review of this patch, I am hoping to post the driver patch by end of the week and will CC you on that one.

> I really don't prefer this name:
> 1. arm-coresight-pmu is much better than "csite". I see the short form
>    used elsewhere in the kernel is just "cs" as in cs_etm,...etc
> 2. Since APMT is more generic than just coresight(I understand coresight
>    was the initial motivation for the generic specification) and also
>    the type list seem to cover memory controller, SMMU,..etc, does
>    it make sense to call it "arm-generic-pmu" or something similar.

Between these two, I would prefer arm-coresight-pmu just to anticipate another standard in the future from ARM.
The APMT, to my understanding, is applicable only to CoreSight based PMUs. Using "coresight" as part of the device name is reasonable.

> Not sure if the same device name will be re-used or PMUs can be registered
> with different name under perf subsystem, but the name matters for the user
> space tools and decoders. They may use the name or type information to analyse
> the data samples.
>
> So it is better to wait for all those discussion as part of the driver
> upstreaming before you use this device name unless we are absolutely sure
> the PMUs can be registered with different names in the driver(which could
> be possible, I just don't know)
>
> Apart from this name, I am OK with the changes here and happy to ack if it
> is OK to merge this without any driver to probe this device yet.

I believe using a different name to register the PMU is possible.
In the current driver patch, we use a different name format to register the PMU: arm_csite_pmu<numeric id>. Certainly the "csite" needs to change as well 😊
Another example like ARM CCI PMU uses device name "ARM-CCI PMU", but it is registered to perf subsystem as "CCI_400" or "CCI_500".

If there is no objection, I can post update to this patch and go ahead with "arm-coresight-pmu" for the device name.

Regards,
Besar


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Devel] Re: [PATCH 2/2] ACPI: ARM Performance Monitoring Unit Table (APMT) initial support
@ 2022-05-07 15:03 Hanjun Guo
  0 siblings, 0 replies; 4+ messages in thread
From: Hanjun Guo @ 2022-05-07 15:03 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 2087 bytes --]

On 2022/4/20 4:54, Besar Wicaksono wrote:
> ARM Performance Monitoring Unit Table describes the properties of PMU
> support in ARM-based system. The APMT table contains a list of nodes,
> each represents a PMU in the system that conforms to ARM CoreSight PMU
> architecture. The properties of each node include information required
> to access the PMU (e.g. MMIO base address, interrupt number) and also
> identification. For more detailed information, please refer to the
> specification below:
>   * APMT: https://developer.arm.com/documentation/den0117/latest
>   * ARM Coresight PMU:
>          https://developer.arm.com/documentation/ihi0091/latest
> 
> The initial support adds the detection of APMT table and generic
> infrastructure to create platform devices for ARM CoreSight PMUs.
> Similar to IORT the root pointer of APMT is preserved during runtime
> and each PMU platform device is given a pointer to the corresponding
> APMT node.
> 
> Signed-off-by: Besar Wicaksono <bwicaksono(a)nvidia.com>
> ---
>   arch/arm64/Kconfig          |   1 +
>   drivers/acpi/arm64/Kconfig  |   3 +
>   drivers/acpi/arm64/Makefile |   1 +
>   drivers/acpi/arm64/apmt.c   | 176 ++++++++++++++++++++++++++++++++++++
>   drivers/acpi/bus.c          |   2 +
>   include/linux/acpi_apmt.h   |  19 ++++
>   6 files changed, 202 insertions(+)
>   create mode 100644 drivers/acpi/arm64/apmt.c
>   create mode 100644 include/linux/acpi_apmt.h
> 
> +++ b/drivers/acpi/arm64/apmt.c
> @@ -0,0 +1,176 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * ARM APMT table support.
> + * Design document number: ARM DEN0117.
> + *
> + * Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES.
> + *
> + */
> +
> +#define pr_fmt(fmt)	"ACPI: APMT: " fmt
> +
> +#include <linux/acpi.h>
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/platform_device.h>

Please include <linux/acpi_apmt.h>, here is the similar patch:

https://lore.kernel.org/lkml/CAJZ5v0gqr97AFuk855UZkcVpDnmj1Q6B2PE32zWmx4eKxbNvCw(a)mail.gmail.com/T/

Thanks
Hanjun

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Devel] Re: [PATCH 2/2] ACPI: ARM Performance Monitoring Unit Table (APMT) initial support
@ 2022-05-05 11:42 Sudeep Holla
  0 siblings, 0 replies; 4+ messages in thread
From: Sudeep Holla @ 2022-05-05 11:42 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 4014 bytes --]

On Wed, May 04, 2022 at 10:08:39PM +0000, Besar Wicaksono wrote:
> Hi Sudeep,
> 
> > Any particular reason why you would like to rush and push this without
> > the actual driver to probe the device being added here ?
> 
> I plan to have two patch series, one for ACPI patch (this patch) and one for
> driver patch. My understanding is the driver patch will depend on this
> patch, but not the other way. So, I thought it would be better to get this
> patch approved first. However, if it helps the review of this patch, I am
> hoping to post the driver patch by end of the week and will CC you on that
> one.

Sure please do that. IMO, the driver is usually upstreamed first along with
the DT bindings(in ACPI case either the spec change or the std namespace node)
The actual addition of the device happens via DT. ACPI APMT needs creation
of device here but I prefer to see the driver first.

> 
> > I really don't prefer this name:
> > 1. arm-coresight-pmu is much better than "csite". I see the short form
> >    used elsewhere in the kernel is just "cs" as in cs_etm,...etc
> > 2. Since APMT is more generic than just coresight(I understand coresight
> >    was the initial motivation for the generic specification) and also
> >    the type list seem to cover memory controller, SMMU,..etc, does
> >    it make sense to call it "arm-generic-pmu" or something similar.
> 
> Between these two, I would prefer arm-coresight-pmu just to anticipate
> another standard in the future from ARM. The APMT, to my understanding, is
> applicable only to CoreSight based PMUs. Using "coresight" as part of the
> device name is reasonable.

I read the APMT spec again and it has very little reference to coresight
though it is weirdly labelled as Coresight PMU for no sane reasons(Sorry I
know it's Arm to blame here and I bet something to do with marketing).

Anyways the APMT spec on its own covers all types of PMUs as I stated earlier.
So I prefer "arm-generic-pmu" or something better if you can come up with. I
am fine if you would like to retain arm-coresight-pmu when you post driver as
that's what the spec is labelled as.

Once you post the driver we can debate on that and come up with better name
with all the concerned parties involved.

> 
> > Not sure if the same device name will be re-used or PMUs can be registered
> > with different name under perf subsystem, but the name matters for the user
> > space tools and decoders. They may use the name or type information to analyse
> > the data samples.
> >
> > So it is better to wait for all those discussion as part of the driver
> > upstreaming before you use this device name unless we are absolutely sure
> > the PMUs can be registered with different names in the driver(which could
> > be possible, I just don't know)
> >
> > Apart from this name, I am OK with the changes here and happy to ack if it
> > is OK to merge this without any driver to probe this device yet.
> 
> I believe using a different name to register the PMU is possible.
> In the current driver patch, we use a different name format to register the
> PMU: arm_csite_pmu<numeric id>. Certainly the "csite" needs to change as
> well 😊. Another example like ARM CCI PMU uses device name "ARM-CCI PMU",
> but it is registered to perf subsystem as "CCI_400" or "CCI_500".
>

Agreed, those are details we can discuss once you post with all the
maintainers involved.

> If there is no objection, I can post update to this patch and go ahead with
> "arm-coresight-pmu" for the device name.

Sure as I mentioned above that should be fine. I will then raise it with
the maintainers how we managed to labelled the spec to confuse it with other
components. I prefer whatever we add must be easy to identify and doesn't
conflict with existing PMUs(like ARM CPU PMUs, or the coresight ETM PMUs,
..etc)

In short, just post the driver the way you prefer and let us start the
discussion there.

-- 
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Devel] Re: [PATCH 2/2] ACPI: ARM Performance Monitoring Unit Table (APMT) initial support
@ 2022-05-04 18:26 Sudeep Holla
  0 siblings, 0 replies; 4+ messages in thread
From: Sudeep Holla @ 2022-05-04 18:26 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 3823 bytes --]

Hi Besar, Rafael,

Sorry for the delayed response.

On Tue, Apr 19, 2022 at 03:54:32PM -0500, Besar Wicaksono wrote:
> ARM Performance Monitoring Unit Table describes the properties of PMU
> support in ARM-based system. The APMT table contains a list of nodes,
> each represents a PMU in the system that conforms to ARM CoreSight PMU
> architecture. The properties of each node include information required
> to access the PMU (e.g. MMIO base address, interrupt number) and also
> identification. For more detailed information, please refer to the
> specification below:
>  * APMT: https://developer.arm.com/documentation/den0117/latest
>  * ARM Coresight PMU:
>         https://developer.arm.com/documentation/ihi0091/latest
> 
> The initial support adds the detection of APMT table and generic
> infrastructure to create platform devices for ARM CoreSight PMUs.
> Similar to IORT the root pointer of APMT is preserved during runtime
> and each PMU platform device is given a pointer to the corresponding
> APMT node.
>

Hi Besar,

This patch on its own looks fine and happy to ack. However I would like
to know general process on such changes that add platform or any bus
device but the driver itself is not upstream.

Any particular reason why you would like to rush and push this without
the actual driver to probe the device being added here ?

> Signed-off-by: Besar Wicaksono <bwicaksono(a)nvidia.com>
> ---
>  arch/arm64/Kconfig          |   1 +
>  drivers/acpi/arm64/Kconfig  |   3 +
>  drivers/acpi/arm64/Makefile |   1 +
>  drivers/acpi/arm64/apmt.c   | 176 ++++++++++++++++++++++++++++++++++++
>  drivers/acpi/bus.c          |   2 +
>  include/linux/acpi_apmt.h   |  19 ++++
>  6 files changed, 202 insertions(+)
>  create mode 100644 drivers/acpi/arm64/apmt.c
>  create mode 100644 include/linux/acpi_apmt.h
>

[...]

> diff --git a/drivers/acpi/arm64/apmt.c b/drivers/acpi/arm64/apmt.c
> new file mode 100644
> index 000000000000..8b8b9f480548
> --- /dev/null
> +++ b/drivers/acpi/arm64/apmt.c
> @@ -0,0 +1,176 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * ARM APMT table support.
> + * Design document number: ARM DEN0117.
> + *
> + * Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES.
> + *
> + */
> +
> +#define pr_fmt(fmt)	"ACPI: APMT: " fmt
> +
> +#include <linux/acpi.h>
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/platform_device.h>
> +
> +#define DEV_NAME "arm-csite-pmu"
> +

I really don't prefer this name:
1. arm-coresight-pmu is much better than "csite". I see the short form
   used elsewhere in the kernel is just "cs" as in cs_etm,...etc
2. Since APMT is more generic than just coresight(I understand coresight
   was the initial motivation for the generic specification) and also
   the type list seem to cover memory controller, SMMU,..etc, does
   it make sense to call it "arm-generic-pmu" or something similar.

Anyways, it can be part of the driver discussion as people might have
opinion based on what and how the driver covers the variety of PMU
types possible as described in APMT.

Not sure if the same device name will be re-used or PMUs can be registered
with different name under perf subsystem, but the name matters for the user
space tools and decoders. They may use the name or type information to analyse
the data samples.

So it is better to wait for all those discussion as part of the driver
upstreaming before you use this device name unless we are absolutely sure
the PMUs can be registered with different names in the driver(which could
be possible, I just don't know)

Apart from this name, I am OK with the changes here and happy to ack if it
is OK to merge this without any driver to probe this device yet.

-- 
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-07 15:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-04 22:08 [Devel] Re: [PATCH 2/2] ACPI: ARM Performance Monitoring Unit Table (APMT) initial support Besar Wicaksono
  -- strict thread matches above, loose matches on Subject: below --
2022-05-07 15:03 Hanjun Guo
2022-05-05 11:42 Sudeep Holla
2022-05-04 18:26 Sudeep Holla

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.