Re: [PATCH v9 7/8] docs: trace: Add HiSilicon PTT device driver documentation

2022-07-07 Thread Yicong Yang via iommu
On 2022/7/7 1:57, Mathieu Poirier wrote: > Hi, > > I have started looking at this set. Thanks! > > On Mon, Jun 06, 2022 at 07:55:54PM +0800, Yicong Yang wrote: >> Document the introduction and usage of HiSilicon PTT device driver. >> >> Signed-off-by: Yicong Yang >> Reviewed-by: Jonathan Camer

Re: [PATCH v9 0/8] Add support for HiSilicon PCIe Tune and Trace device

2022-06-28 Thread Yicong Yang via iommu
On 2022/6/27 22:01, Peter Zijlstra wrote: > On Mon, Jun 27, 2022 at 09:25:42PM +0800, Yicong Yang wrote: >> On 2022/6/27 21:12, Greg KH wrote: >>> On Mon, Jun 27, 2022 at 07:18:12PM +0800, Yicong Yang wrote: Hi Greg, Since the kernel side of this device has been reviewed for 8 versio

Re: [PATCH v9 0/8] Add support for HiSilicon PCIe Tune and Trace device

2022-06-27 Thread Yicong Yang via iommu
On 2022/6/27 21:12, Greg KH wrote: > On Mon, Jun 27, 2022 at 07:18:12PM +0800, Yicong Yang wrote: >> Hi Greg, >> >> Since the kernel side of this device has been reviewed for 8 versions with >> all comments addressed and no more comment since v9 posted in 5.19-rc1, >> is it ok to merge it first (fo

Re: [PATCH v9 0/8] Add support for HiSilicon PCIe Tune and Trace device

2022-06-27 Thread Yicong Yang via iommu
Hi Greg, Since the kernel side of this device has been reviewed for 8 versions with all comments addressed and no more comment since v9 posted in 5.19-rc1, is it ok to merge it first (for Patch 1-3 and 7-8)? Thanks. On 2022/6/6 19:55, Yicong Yang wrote: > HiSilicon PCIe tune and trace device (PT

Re: [PATCH v9 5/8] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver

2022-06-27 Thread Yicong Yang via iommu
On 2022/6/27 10:02, Leo Yan wrote: > On Mon, Jun 06, 2022 at 07:55:52PM +0800, Yicong Yang wrote: >> From: Qi Liu >> >> HiSilicon PCIe tune and trace device (PTT) could dynamically tune >> the PCIe link's events, and trace the TLP headers). >> >> This patch add support for PTT device in perf tool,

[PATCH v9 2/8] hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-06-06 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated Endpoint(RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic and trace the TLP headers. Add the driver for the device to enable the trace function. Register PMU device of PTT trace, the

[PATCH v9 5/8] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver

2022-06-06 Thread Yicong Yang via iommu
From: Qi Liu HiSilicon PCIe tune and trace device (PTT) could dynamically tune the PCIe link's events, and trace the TLP headers). This patch add support for PTT device in perf tool, so users could use 'perf record' to get TLP headers trace data. Signed-off-by: Qi Liu Signed-off-by: Yicong Yan

[PATCH v9 8/8] MAINTAINERS: Add maintainer for HiSilicon PTT driver

2022-06-06 Thread Yicong Yang via iommu
Add maintainer for driver and documentation of HiSilicon PTT device. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index a6d3bd9d2a8d..5893fde0cc82 100644 --- a/MAINTAINERS +++ b/MAIN

[PATCH v9 1/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-06-06 Thread Yicong Yang via iommu
The DMA operations of HiSilicon PTT device can only work properly with identical mappings. So add a quirk for the device to force the domain as passthrough. Acked-by: Will Deacon Signed-off-by: Yicong Yang Reviewed-by: John Garry --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 21 +++

[PATCH v9 7/8] docs: trace: Add HiSilicon PTT device driver documentation

2022-06-06 Thread Yicong Yang via iommu
Document the introduction and usage of HiSilicon PTT device driver. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- Documentation/trace/hisi-ptt.rst | 307 +++ Documentation/trace/index.rst| 1 + 2 files changed, 308 insertions(+) create mode 1006

[PATCH v9 6/8] perf tool: Add support for parsing HiSilicon PCIe Trace packet

2022-06-06 Thread Yicong Yang via iommu
From: Qi Liu Add support for using 'perf report --dump-raw-trace' to parse PTT packet. Example usage: Output will contain raw PTT data and its textual representation, such as: 0 0 0x5810 [0x30]: PERF_RECORD_AUXTRACE size: 0x40 offset: 0 ref: 0xa5d50c725 idx: 0 tid: -1 cpu: 0 . . ... HI

[PATCH v9 4/8] perf tool: arm: Refactor event list iteration in auxtrace_record__init()

2022-06-06 Thread Yicong Yang via iommu
From: Qi Liu Add find_pmu_for_event() and use to simplify logic in auxtrace_record_init(). find_pmu_for_event() will be reused in subsequent patches. Reviewed-by: Jonathan Cameron Signed-off-by: Qi Liu Signed-off-by: Yicong Yang --- tools/perf/arch/arm/util/auxtrace.c | 53 ++

[PATCH v9 0/8] Add support for HiSilicon PCIe Tune and Trace device

2022-06-06 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device (PTT) is a PCIe Root Complex integrated Endpoint (RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic (tune), and trace the TLP headers (trace). PTT tune is designed for monitoring and adjusting PCIe link parameters. We prov

[PATCH v9 3/8] hwtracing: hisi_ptt: Add tune function support for HiSilicon PCIe Tune and Trace device

2022-06-06 Thread Yicong Yang via iommu
Add tune function for the HiSilicon Tune and Trace device. The interface of tune is exposed through sysfs attributes of PTT PMU device. Reviewed-by: Jonathan Cameron Reviewed-by: John Garry Signed-off-by: Yicong Yang --- drivers/hwtracing/ptt/hisi_ptt.c | 136 +++ d

Re: [PATCH v8 2/8] hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-05-17 Thread Yicong Yang via iommu
On 2022/5/17 16:21, John Garry wrote: > On 17/05/2022 09:09, Yicong Yang wrote: +    target = cpumask_any(cpumask_of_node(dev_to_node(&hisi_ptt->pdev->dev))); +    if (target < nr_cpumask_bits) { >>> the comment for cpumask_any() hints to check against nr_cpu_ids - any >>> specific

Re: [PATCH v8 2/8] hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-05-17 Thread Yicong Yang via iommu
On 2022/5/17 0:23, John Garry wrote: > On 16/05/2022 13:52, Yicong Yang wrote: >> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated >> Endpoint(RCiEP) device, providing the capability to dynamically monitor and >> tune the PCIe traffic and trace the TLP headers. >> >> Add

Re: [PATCH v8 2/8] hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-05-17 Thread Yicong Yang via iommu
On 2022/5/16 22:03, Jonathan Cameron wrote: > On Mon, 16 May 2022 20:52:17 +0800 > Yicong Yang wrote: > >> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated >> Endpoint(RCiEP) device, providing the capability to dynamically monitor and >> tune the PCIe traffic and trace

[PATCH v8 7/8] docs: trace: Add HiSilicon PTT device driver documentation

2022-05-16 Thread Yicong Yang via iommu
Document the introduction and usage of HiSilicon PTT device driver. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- Documentation/trace/hisi-ptt.rst | 307 +++ Documentation/trace/index.rst| 1 + 2 files changed, 308 insertions(+) create mode 1006

[PATCH v8 6/8] perf tool: Add support for parsing HiSilicon PCIe Trace packet

2022-05-16 Thread Yicong Yang via iommu
From: Qi Liu Add support for using 'perf report --dump-raw-trace' to parse PTT packet. Example usage: Output will contain raw PTT data and its textual representation, such as: 0 0 0x5810 [0x30]: PERF_RECORD_AUXTRACE size: 0x40 offset: 0 ref: 0xa5d50c725 idx: 0 tid: -1 cpu: 0 . . ... HI

[PATCH v8 2/8] hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-05-16 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated Endpoint(RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic and trace the TLP headers. Add the driver for the device to enable the trace function. Register PMU device of PTT trace, the

[PATCH v8 3/8] hwtracing: hisi_ptt: Add tune function support for HiSilicon PCIe Tune and Trace device

2022-05-16 Thread Yicong Yang via iommu
Add tune function for the HiSilicon Tune and Trace device. The interface of tune is exposed through sysfs attributes of PTT PMU device. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- drivers/hwtracing/ptt/hisi_ptt.c | 157 +++ drivers/hwtracing/ptt/hisi

[PATCH v8 5/8] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver

2022-05-16 Thread Yicong Yang via iommu
From: Qi Liu HiSilicon PCIe tune and trace device (PTT) could dynamically tune the PCIe link's events, and trace the TLP headers). This patch add support for PTT device in perf tool, so users could use 'perf record' to get TLP headers trace data. Signed-off-by: Qi Liu Signed-off-by: Yicong Yan

[PATCH v8 4/8] perf arm: Refactor event list iteration in auxtrace_record__init()

2022-05-16 Thread Yicong Yang via iommu
From: Qi Liu Use find_pmu_for_event() to simplify logic in auxtrace_record__init(). Signed-off-by: Qi Liu Signed-off-by: Yicong Yang --- tools/perf/arch/arm/util/auxtrace.c | 53 ++--- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/tools/perf/arch/arm/

[PATCH v8 8/8] MAINTAINERS: Add maintainer for HiSilicon PTT driver

2022-05-16 Thread Yicong Yang via iommu
Add maintainer for driver and documentation of HiSilicon PTT device. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index fd768d43e048..d30a1698251c 100644 --- a/MAINTAINERS +++ b/MAIN

[PATCH v8 0/8] Add support for HiSilicon PCIe Tune and Trace device

2022-05-16 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device (PTT) is a PCIe Root Complex integrated Endpoint (RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic (tune), and trace the TLP headers (trace). PTT tune is designed for monitoring and adjusting PCIe link parameters. We prov

[PATCH v8 1/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-05-16 Thread Yicong Yang via iommu
The DMA operations of HiSilicon PTT device can only work properly with identical mappings. So add a quirk for the device to force the domain as passthrough. Acked-by: Will Deacon Signed-off-by: Yicong Yang Reviewed-by: John Garry --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 21 +++

Re: [PATCH v7 2/7] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-05-10 Thread Yicong Yang via iommu
On 2022/5/10 20:54, James Clark wrote: > > > On 10/05/2022 12:18, Yicong Yang wrote: >> On 2022/5/10 17:46, James Clark wrote: >>> >>> >>> On 07/04/2022 13:58, Yicong Yang wrote: HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated Endpoint(RCiEP) device, providin

Re: [PATCH v7 1/7] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-05-10 Thread Yicong Yang via iommu
On 2022/5/10 19:23, Will Deacon wrote: > On Thu, Apr 07, 2022 at 08:58:35PM +0800, Yicong Yang wrote: >> The DMA operations of HiSilicon PTT device can only work properly with >> identical mappings. So add a quirk for the device to force the domain >> as passthrough. >> >> Signed-off-by: Yicong Yan

Re: [PATCH v7 2/7] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-05-10 Thread Yicong Yang via iommu
On 2022/5/10 17:46, James Clark wrote: > > > On 07/04/2022 13:58, Yicong Yang wrote: >> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated >> Endpoint(RCiEP) device, providing the capability to dynamically monitor and >> tune the PCIe traffic, and trace the TLP headers. >

Re: [PATCH v7 2/7] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-05-05 Thread Yicong Yang via iommu
Hi Leo, Thanks for the comments. Some questions and replies below. On 2022/4/30 0:00, Leo Yan wrote: > On Thu, Apr 07, 2022 at 08:58:36PM +0800, Yicong Yang via iommu wrote: >> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated >> Endpoint(RCiEP) device

Re: [PATCH v7 0/7] Add support for HiSilicon PCIe Tune and Trace device

2022-04-14 Thread Yicong Yang via iommu
Hi Bjorn, Since it's a device about tuning and analyzing PCIe link in your realm and you've given helpful comments in RFC and v1 version, looking forward to see your opnion on this driver as the user interface has changed to perf. Also to confirm that the hotplug problem mentioned in RFC[1] has

Re: [PATCH v7 2/7] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-04-12 Thread Yicong Yang via iommu
On 2022/4/12 16:39, John Garry wrote: +static int hisi_ptt_alloc_trace_buf(struct hisi_ptt *hisi_ptt) +{ +    struct hisi_ptt_trace_ctrl *ctrl = &hisi_ptt->trace_ctrl; +    struct device *dev = &hisi_ptt->pdev->dev; +    int i; + +    hisi_ptt->trace_ctrl.buf_inde

Re: [PATCH v7 5/7] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver

2022-04-12 Thread Yicong Yang via iommu
On 2022/4/12 1:19, John Garry wrote: > On 07/04/2022 13:58, Yicong Yang wrote: >> From: Qi Liu >> >> 'perf record' and 'perf report --dump-raw-trace' supported in this >> patch. >> >> Example usage: >> >> Output will contain raw PTT data and its textual representation, such >> as: >> >> 0 0 0x5810

Re: [PATCH v7 2/7] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-04-12 Thread Yicong Yang via iommu
Hi John, Thanks for the comments! some questions replied below. On 2022/4/12 1:02, John Garry wrote: > On 07/04/2022 13:58, Yicong Yang wrote: >> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated >> Endpoint(RCiEP) device, providing the capability to dynamically monitor

[PATCH v7 0/7] Add support for HiSilicon PCIe Tune and Trace device

2022-04-07 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device (PTT) is a PCIe Root Complex integrated Endpoint (RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic (tune), and trace the TLP headers (trace). PTT tune is designed for monitoring and adjusting PCIe link parameters. We prov

[PATCH v7 7/7] MAINTAINERS: Add maintainer for HiSilicon PTT driver

2022-04-07 Thread Yicong Yang via iommu
Add maintainer for driver and documentation of HiSilicon PTT device. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index fd768d43e048..d30a1698251c 100644 --- a/MAINTAINERS +++ b/MAIN

[PATCH v7 2/7] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-04-07 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated Endpoint(RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic, and trace the TLP headers. Add the driver for the device to enable the trace function. Register PMU device of PTT trace, th

[PATCH v7 5/7] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver

2022-04-07 Thread Yicong Yang via iommu
From: Qi Liu 'perf record' and 'perf report --dump-raw-trace' supported in this patch. Example usage: Output will contain raw PTT data and its textual representation, such as: 0 0 0x5810 [0x30]: PERF_RECORD_AUXTRACE size: 0x40 offset: 0 ref: 0xa5d50c725 idx: 0 tid: -1 cpu: 0 . . ... HI

[PATCH v7 4/7] hisi_ptt: Add tune function support for HiSilicon PCIe Tune and Trace device

2022-04-07 Thread Yicong Yang via iommu
Add tune function for the HiSilicon Tune and Trace device. The interface of tune is exposed through sysfs attributes of PTT PMU device. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- drivers/hwtracing/ptt/hisi_ptt.c | 154 +++ drivers/hwtracing/ptt/hisi

[PATCH v7 3/7] hisi_ptt: Add support for dynamically updating the filter list

2022-04-07 Thread Yicong Yang via iommu
The PCIe devices supported by the PTT trace can be removed/rescanned by hotplug or through sysfs. Add support for dynamically updating the available filter list by registering a PCI bus notifier block. Then user can always get latest information about available tracing filters and driver can block

[PATCH v7 6/7] docs: Add HiSilicon PTT device driver documentation

2022-04-07 Thread Yicong Yang via iommu
Document the introduction and usage of HiSilicon PTT device driver. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- Documentation/trace/hisi-ptt.rst | 303 +++ 1 file changed, 303 insertions(+) create mode 100644 Documentation/trace/hisi-ptt.rst diff -

[PATCH v7 1/7] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-04-07 Thread Yicong Yang via iommu
The DMA operations of HiSilicon PTT device can only work properly with identical mappings. So add a quirk for the device to force the domain as passthrough. Signed-off-by: Yicong Yang --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 1 file changed, 16 insertions(+) diff --

Re: [PATCH v6 4/7] hisi_ptt: Add tune function support for HiSilicon PCIe Tune and Trace device

2022-04-07 Thread Yicong Yang via iommu
On 2022/4/7 12:28, kernel test robot wrote: > Hi Yicong, > > I love your patch! Perhaps something to improve: > > [auto build test WARNING on joro-iommu/next] > [also build test WARNING on linus/master linux/master v5.18-rc1 next-20220406] > [cannot apply to tip/perf/core] > [If your patch is app

[PATCH v6 5/7] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver

2022-04-06 Thread Yicong Yang via iommu
From: Qi Liu 'perf record' and 'perf report --dump-raw-trace' supported in this patch. Example usage: Output will contain raw PTT data and its textual representation, such as: 0 0 0x5810 [0x30]: PERF_RECORD_AUXTRACE size: 0x40 offset: 0 ref: 0xa5d50c725 idx: 0 tid: -1 cpu: 0 . . ... HI

[PATCH v6 6/7] docs: Add HiSilicon PTT device driver documentation

2022-04-06 Thread Yicong Yang via iommu
Document the introduction and usage of HiSilicon PTT device driver. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- Documentation/trace/hisi-ptt.rst | 303 +++ 1 file changed, 303 insertions(+) create mode 100644 Documentation/trace/hisi-ptt.rst diff -

[PATCH v6 2/7] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-04-06 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated Endpoint(RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic, and trace the TLP headers. Add the driver for the device to enable the trace function. Register PMU device of PTT trace, th

[PATCH v6 7/7] MAINTAINERS: Add maintainer for HiSilicon PTT driver

2022-04-06 Thread Yicong Yang via iommu
Add maintainer for driver and documentation of HiSilicon PTT device. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index fd768d43e048..d30a1698251c 100644 --- a/MAINTAINERS +++ b/MAIN

[PATCH v6 0/7] Add support for HiSilicon PCIe Tune and Trace device

2022-04-06 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device (PTT) is a PCIe Root Complex integrated Endpoint (RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic (tune), and trace the TLP headers (trace). PTT tune is designed for monitoring and adjusting PCIe link parameters. We prov

[PATCH v6 3/7] hisi_ptt: Add support for dynamically updating the filter list

2022-04-06 Thread Yicong Yang via iommu
The PCIe devices supported by the PTT trace can be removed/rescanned by hotplug or through sysfs. Add support for dynamically updating the available filter list by registering a PCI bus notifier block. Then user can always get latest information about available tracing filters and driver can block

[PATCH v6 4/7] hisi_ptt: Add tune function support for HiSilicon PCIe Tune and Trace device

2022-04-06 Thread Yicong Yang via iommu
Add tune function for the HiSilicon Tune and Trace device. The interface of tune is exposed through sysfs attributes of PTT PMU device. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- drivers/hwtracing/ptt/hisi_ptt.c | 154 +++ drivers/hwtracing/ptt/hisi

[PATCH v6 1/7] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-04-06 Thread Yicong Yang via iommu
The DMA operations of HiSilicon PTT device can only work properly with identical mappings. So add a quirk for the device to force the domain as passthrough. Signed-off-by: Yicong Yang --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 1 file changed, 16 insertions(+) diff --

Re: [PATCH v5 2/8] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-03-16 Thread Yicong Yang via iommu
On 2022/3/12 1:55, John Garry wrote: >> + >> +static int hisi_ptt_alloc_trace_buf(struct hisi_ptt *hisi_ptt) > > no caller > >> +{ >> +    struct hisi_ptt_trace_ctrl *ctrl = &hisi_ptt->trace_ctrl; >> +    struct device *dev = &hisi_ptt->pdev->dev; >> +    int i; >> + >> +    hisi_ptt->trace_ctrl.

Re: [PATCH v5 1/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-03-15 Thread Yicong Yang via iommu
On 2022/3/12 1:27, John Garry wrote: > On 08/03/2022 08:49, Yicong Yang wrote: >> The DMA of HiSilicon PTT device can only work with identical mapping. > > nit: I'd have "DMA operations of the HiSilicon PTT device can only work > properly with identity mappings". > >> So add a quirk for the devi

Re: [PATCH v5 3/8] hisi_ptt: Register PMU device for PTT trace

2022-03-08 Thread Yicong Yang via iommu
On 2022/3/8 20:06, Jonathan Cameron wrote: > On Tue, 8 Mar 2022 19:13:08 +0800 > Yicong Yang wrote: > >> On 2022/3/8 18:21, Jonathan Cameron wrote: >>> On Tue, 8 Mar 2022 16:49:25 +0800 >>> Yicong Yang wrote: >>> Register PMU device of PTT trace, then users can use trace through perf >>>

Re: [PATCH v5 8/8] MAINTAINERS: Add maintainer for HiSilicon PTT driver

2022-03-08 Thread Yicong Yang via iommu
On 2022/3/8 18:32, Jonathan Cameron wrote: > On Tue, 8 Mar 2022 16:49:30 +0800 > Yicong Yang wrote: > >> Add maintainer for driver and documentation of HiSilicon PTT device. >> >> Signed-off-by: Yicong Yang > FWIW > Reviewed-by: Jonathan Cameron > > I've left the perf tool and iommu patches wi

Re: [PATCH v5 3/8] hisi_ptt: Register PMU device for PTT trace

2022-03-08 Thread Yicong Yang via iommu
On 2022/3/8 18:21, Jonathan Cameron wrote: > On Tue, 8 Mar 2022 16:49:25 +0800 > Yicong Yang wrote: > >> Register PMU device of PTT trace, then users can use trace through perf >> command. The driver makes use of perf AUX trace and support following >> events to configure the trace: >> >> - filte

[PATCH v5 2/8] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-03-08 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated Endpoint(RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic, and trace the TLP headers. Add the driver for the device to enable the trace function. This patch adds basic function of tr

[PATCH v5 4/8] hisi_ptt: Add support for dynamically updating the filter list

2022-03-08 Thread Yicong Yang via iommu
The PCIe devices supported by the PTT trace can be removed/rescanned by hotplug or through sysfs. Add support for dynamically updating the available filter list by registering a PCI bus notifier block. Then user can always get latest information about available tracing filters and driver can block

[PATCH v5 3/8] hisi_ptt: Register PMU device for PTT trace

2022-03-08 Thread Yicong Yang via iommu
Register PMU device of PTT trace, then users can use trace through perf command. The driver makes use of perf AUX trace and support following events to configure the trace: - filter: select Root port or Endpoint to trace - type: select the type of traced TLP headers - direction: select the directi

[PATCH v5 6/8] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver

2022-03-08 Thread Yicong Yang via iommu
From: Qi Liu 'perf record' and 'perf report --dump-raw-trace' supported in this patch. Example usage: Output will contain raw PTT data and its textual representation, such as: 0 0 0x5810 [0x30]: PERF_RECORD_AUXTRACE size: 0x40 offset: 0 ref: 0xa5d50c725 idx: 0 tid: -1 cpu: 0 . . ... HI

[PATCH v5 5/8] hisi_ptt: Add tune function support for HiSilicon PCIe Tune and Trace device

2022-03-08 Thread Yicong Yang via iommu
Add tune function for the HiSilicon Tune and Trace device. The interface of tune is exposed through sysfs attributes of PTT PMU device. Reviewed-by: Jonathan Cameron Signed-off-by: Yicong Yang --- drivers/hwtracing/ptt/hisi_ptt.c | 154 +++ drivers/hwtracing/ptt/hisi

[PATCH v5 7/8] docs: Add HiSilicon PTT device driver documentation

2022-03-08 Thread Yicong Yang via iommu
Document the introduction and usage of HiSilicon PTT device driver. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- Documentation/trace/hisi-ptt.rst | 303 +++ 1 file changed, 303 insertions(+) create mode 100644 Documentation/trace/hisi-ptt.rst diff -

[PATCH v5 0/8] Add support for HiSilicon PCIe Tune and Trace device

2022-03-08 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device (PTT) is a PCIe Root Complex integrated Endpoint (RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic (tune), and trace the TLP headers (trace). PTT tune is designed for monitoring and adjusting PCIe link parameters. We prov

[PATCH v5 8/8] MAINTAINERS: Add maintainer for HiSilicon PTT driver

2022-03-08 Thread Yicong Yang via iommu
Add maintainer for driver and documentation of HiSilicon PTT device. Signed-off-by: Yicong Yang --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index ea3e6c914384..237c618a74d5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8689,6 +8689,13 @@

[PATCH v5 1/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-03-08 Thread Yicong Yang via iommu
The DMA of HiSilicon PTT device can only work with identical mapping. So add a quirk for the device to force the domain passthrough. Signed-off-by: Yicong Yang --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 1 file changed, 16 insertions(+) diff --git a/drivers/iommu/arm/

Re: [PATCH v4 2/8] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-02-24 Thread Yicong Yang via iommu
On 2022/2/24 20:32, John Garry wrote: > On 24/02/2022 03:53, Yicong Yang wrote: >> On 2022/2/22 19:06, John Garry wrote: >>> On 21/02/2022 08:43, Yicong Yang wrote: HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated Endpoint(RCiEP) device, providing the capability

Re: [PATCH v4 3/8] hisi_ptt: Register PMU device for PTT trace

2022-02-23 Thread Yicong Yang via iommu
On 2022/2/22 19:17, John Garry wrote: > >> + >>   static irqreturn_t hisi_ptt_irq(int irq, void *context) >>   { >>   struct hisi_ptt *hisi_ptt = context; >> @@ -169,7 +233,7 @@ static irqreturn_t hisi_ptt_irq(int irq, void *context) >>   if (!(status & HISI_PTT_TRACE_INT_STAT_MASK)) >>   

Re: [PATCH v4 2/8] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-02-23 Thread Yicong Yang via iommu
On 2022/2/22 19:06, John Garry wrote: > On 21/02/2022 08:43, Yicong Yang wrote: >> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex >> integrated Endpoint(RCiEP) device, providing the capability >> to dynamically monitor and tune the PCIe traffic, and trace >> the TLP headers. >> >>

Re: [PATCH v4 3/8] hisi_ptt: Register PMU device for PTT trace

2022-02-21 Thread Yicong Yang via iommu
On 2022/2/21 21:26, Yicong Yang wrote: > On 2022/2/21 19:44, Jonathan Cameron wrote: >> On Mon, 21 Feb 2022 16:43:02 +0800 >> Yicong Yang wrote: >> >>> Register PMU device of PTT trace, then users can use >>> trace through perf command. The driver makes use of perf >>> AUX trace and support follow

Re: [PATCH v4 3/8] hisi_ptt: Register PMU device for PTT trace

2022-02-21 Thread Yicong Yang via iommu
On 2022/2/21 19:44, Jonathan Cameron wrote: > On Mon, 21 Feb 2022 16:43:02 +0800 > Yicong Yang wrote: > >> Register PMU device of PTT trace, then users can use >> trace through perf command. The driver makes use of perf >> AUX trace and support following events to configure the >> trace: >> >> -

Re: [PATCH v4 2/8] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-02-21 Thread Yicong Yang via iommu
Hi Jonathan, On 2022/2/21 19:18, Jonathan Cameron wrote: > On Mon, 21 Feb 2022 16:43:01 +0800 > Yicong Yang wrote: > >> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex >> integrated Endpoint(RCiEP) device, providing the capability >> to dynamically monitor and tune the PCIe traf

[PATCH v4 3/8] hisi_ptt: Register PMU device for PTT trace

2022-02-21 Thread Yicong Yang via iommu
Register PMU device of PTT trace, then users can use trace through perf command. The driver makes use of perf AUX trace and support following events to configure the trace: - filter: select Root port or Endpoint to trace - type: select the type of traced TLP headers - direction: select the directi

[PATCH v4 2/8] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-02-21 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated Endpoint(RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic, and trace the TLP headers. Add the driver for the device to enable the trace function. This patch adds basic function of tr

[PATCH v4 0/8] Add support for HiSilicon PCIe Tune and Trace device

2022-02-21 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device (PTT) is a PCIe Root Complex integrated Endpoint (RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic (tune), and trace the TLP headers (trace). PTT tune is designed for monitoring and adjusting PCIe link parameters. We prov

[PATCH v4 4/8] hisi_ptt: Add support for dynamically updating the filter list

2022-02-21 Thread Yicong Yang via iommu
The PCIe devices supported by the PTT trace can be removed/rescanned by hotplug or through sysfs. Add support for dynamically updating the available filter list by registering a PCI bus notifier block. Then user can always get latest information about available tracing filters and driver can block

[PATCH v4 7/8] docs: Add HiSilicon PTT device driver documentation

2022-02-21 Thread Yicong Yang via iommu
Document the introduction and usage of HiSilicon PTT device driver. Signed-off-by: Yicong Yang --- Documentation/trace/hisi-ptt.rst | 303 +++ 1 file changed, 303 insertions(+) create mode 100644 Documentation/trace/hisi-ptt.rst diff --git a/Documentation/trace/hisi

[PATCH v4 6/8] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver

2022-02-21 Thread Yicong Yang via iommu
From: Qi Liu 'perf record' and 'perf report --dump-raw-trace' supported in this patch. Example usage: Output will contain raw PTT data and its textual representation, such as: 0 0 0x5810 [0x30]: PERF_RECORD_AUXTRACE size: 0x40 offset: 0 ref: 0xa5d50c725 idx: 0 tid: -1 cpu: 0 . . ... HI

[PATCH v4 5/8] hisi_ptt: Add tune function support for HiSilicon PCIe Tune and Trace device

2022-02-21 Thread Yicong Yang via iommu
Add tune function for the HiSilicon Tune and Trace device. The interface of tune is exposed through sysfs attributes of PTT PMU device. Reviewed-by: Jonathan Cameron Signed-off-by: Yicong Yang --- drivers/hwtracing/ptt/hisi_ptt.c | 154 +++ drivers/hwtracing/ptt/hisi

[PATCH v4 8/8] MAINTAINERS: Add maintainer for HiSilicon PTT driver

2022-02-21 Thread Yicong Yang via iommu
Add maintainer for driver and documentation of HiSilicon PTT device. Signed-off-by: Yicong Yang --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index ea3e6c914384..237c618a74d5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8689,6 +8689,13 @@

[PATCH v4 1/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-02-21 Thread Yicong Yang via iommu
The DMA of HiSilicon PTT device can only work with identical mapping. So add a quirk for the device to force the domain passthrough. Signed-off-by: Yicong Yang --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 1 file changed, 16 insertions(+) diff --git a/drivers/iommu/arm/

Re: [PATCH v3 8/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-02-16 Thread Yicong Yang via iommu
On 2022/2/15 22:29, Robin Murphy wrote: > On 2022-02-15 13:42, Will Deacon wrote: >> On Tue, Feb 15, 2022 at 01:30:26PM +, Robin Murphy wrote: >>> On 2022-02-15 13:00, Will Deacon wrote: On Mon, Feb 14, 2022 at 08:55:20PM +0800, Yicong Yang wrote: > On 2022/1/24 21:11, Yicong Yang wrot

Re: [PATCH v3 8/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-02-14 Thread Yicong Yang via iommu
Hi Robin, Is this quirk ok with the SMMU v3 driver? Just want to confirm that I'm on the right way to dealing with the issue of our device. Thanks. On 2022/1/24 21:11, Yicong Yang wrote: > The DMA of HiSilicon PTT device can only work with identical > mapping. So add a quirk for the device to fo

Re: [PATCH v3 1/8] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-02-14 Thread Yicong Yang via iommu
On 2022/2/8 19:07, Yicong Yang wrote: > On 2022/2/7 19:42, Jonathan Cameron wrote: >> On Mon, 24 Jan 2022 21:11:11 +0800 >> Yicong Yang wrote: >> >>> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex >>> integrated Endpoint(RCiEP) device, providing the capability >>> to dynamically

Re: [PATCH v3 8/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-02-08 Thread Yicong Yang via iommu
On 2022/2/8 19:56, John Garry wrote: > On 08/02/2022 11:21, Yicong Yang wrote: >>> This patch should be earlier in the series, before the PTT driver, and the >>> comment on hisi_ptt_check_iommu_mapping() should mention what is going on >>> here. >>> >> ok I'll reorder the serives and modify the c

Re: [PATCH v3 8/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-02-08 Thread Yicong Yang via iommu
On 2022/2/8 16:05, John Garry wrote: > On 24/01/2022 13:11, Yicong Yang wrote: >> The DMA of HiSilicon PTT device can only work with identical >> mapping. So add a quirk for the device to force the domain >> passthrough. > > This patch should be earlier in the series, before the PTT driver, and th

Re: [PATCH v3 6/8] docs: Add HiSilicon PTT device driver documentation

2022-02-08 Thread Yicong Yang via iommu
On 2022/2/7 20:12, Jonathan Cameron wrote: > On Mon, 24 Jan 2022 21:11:16 +0800 > Yicong Yang wrote: > >> Document the introduction and usage of HiSilicon PTT device driver. >> >> Signed-off-by: Yicong Yang > Nice document. A few trivial typos inline. > I would give a RB except I've suggested y

Re: [PATCH v3 1/8] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-02-08 Thread Yicong Yang via iommu
On 2022/2/7 19:42, Jonathan Cameron wrote: > On Mon, 24 Jan 2022 21:11:11 +0800 > Yicong Yang wrote: > >> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex >> integrated Endpoint(RCiEP) device, providing the capability >> to dynamically monitor and tune the PCIe traffic, and trace

Re: [PATCH v3 1/8] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-02-08 Thread Yicong Yang via iommu
Hi John, Thanks for the comments. some replies inline. On 2022/2/8 2:11, John Garry wrote: > On 24/01/2022 13:11, Yicong Yang wrote: >> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex >> integrated Endpoint(RCiEP) device, providing the capability >> to dynamically monitor and tun

Re: [PATCH v3 2/8] hisi_ptt: Register PMU device for PTT trace

2022-02-07 Thread Yicong Yang via iommu
On 2022/2/7 19:42, Jonathan Cameron wrote: > On Mon, 24 Jan 2022 21:11:12 +0800 > Yicong Yang wrote: > >> Register PMU device of PTT trace, then users can use >> trace through perf command. The driver makes use of perf >> AUX trace and support following events to configure the >> trace: >> >> - f

Re: [PATCH v3 4/8] hisi_ptt: Add tune function support for HiSilicon PCIe Tune and Trace device

2022-02-07 Thread Yicong Yang via iommu
On 2022/2/7 19:49, Jonathan Cameron wrote: > On Mon, 24 Jan 2022 21:11:14 +0800 > Yicong Yang wrote: > >> Add tune function for the HiSilicon Tune and Trace device. The interface >> of tune is exposed through sysfs attributes of PTT PMU device. >> >> Signed-off-by: Yicong Yang > > A few trivial

Re: [PATCH v3 0/8] Add support for HiSilicon PCIe Tune and Trace device

2022-02-07 Thread Yicong Yang via iommu
Hi perf, ETM and PCI related experts, a gentle ping ... appreciate for the comments. thanks. On 2022/1/24 21:11, Yicong Yang wrote: > HiSilicon PCIe tune and trace device (PTT) is a PCIe Root Complex > integrated Endpoint (RCiEP) device, providing the capability > to dynamically monitor and tune

[PATCH v3 0/8] Add support for HiSilicon PCIe Tune and Trace device

2022-01-24 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device (PTT) is a PCIe Root Complex integrated Endpoint (RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic (tune), and trace the TLP headers (trace). PTT tune is designed for monitoring and adjusting PCIe link parameters. We prov

[PATCH v3 1/8] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-01-24 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated Endpoint(RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic, and trace the TLP headers. Add the driver for the device to enable the trace function. This patch adds basic function of tr

[PATCH v3 2/8] hisi_ptt: Register PMU device for PTT trace

2022-01-24 Thread Yicong Yang via iommu
Register PMU device of PTT trace, then users can use trace through perf command. The driver makes use of perf AUX trace and support following events to configure the trace: - filter: select Root port or Endpoint to trace - type: select the type of traced TLP headers - direction: select the directi

[PATCH v3 5/8] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver

2022-01-24 Thread Yicong Yang via iommu
From: Qi Liu 'perf record' and 'perf report --dump-raw-trace' supported in this patch. Example usage: Output will contain raw PTT data and its textual representation, such as: 0 0 0x5810 [0x30]: PERF_RECORD_AUXTRACE size: 0x40 offset: 0 ref: 0xa5d50c725 idx: 0 tid: -1 cpu: 0 . . ... HI

[PATCH v3 3/8] hisi_ptt: Add support for dynamically updating the filter list

2022-01-24 Thread Yicong Yang via iommu
The PCIe devices supported by the PTT trace can be removed/rescanned by hotplug or through sysfs. Add support for dynamically updating the available filter list by registering a PCI bus notifier block. Then user can always get latest information about available tracing filters and driver can block

[PATCH v3 4/8] hisi_ptt: Add tune function support for HiSilicon PCIe Tune and Trace device

2022-01-24 Thread Yicong Yang via iommu
Add tune function for the HiSilicon Tune and Trace device. The interface of tune is exposed through sysfs attributes of PTT PMU device. Signed-off-by: Yicong Yang --- drivers/hwtracing/ptt/hisi_ptt.c | 154 +++ drivers/hwtracing/ptt/hisi_ptt.h | 19 2 files chan

[PATCH v3 7/8] MAINTAINERS: Add maintainer for HiSilicon PTT driver

2022-01-24 Thread Yicong Yang via iommu
Add maintainer for driver and documentation of HiSilicon PTT device. Signed-off-by: Yicong Yang --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index ea3e6c914384..237c618a74d5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8689,6 +8689,13 @@

[PATCH v3 8/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-01-24 Thread Yicong Yang via iommu
The DMA of HiSilicon PTT device can only work with identical mapping. So add a quirk for the device to force the domain passthrough. Signed-off-by: Yicong Yang --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 1 file changed, 16 insertions(+) diff --git a/drivers/iommu/arm/

[PATCH v3 6/8] docs: Add HiSilicon PTT device driver documentation

2022-01-24 Thread Yicong Yang via iommu
Document the introduction and usage of HiSilicon PTT device driver. Signed-off-by: Yicong Yang --- Documentation/trace/hisi-ptt.rst | 304 +++ 1 file changed, 304 insertions(+) create mode 100644 Documentation/trace/hisi-ptt.rst diff --git a/Documentation/trace/hisi

  1   2   >