Hi Greg
On 30/10/2023 11:32, Greg KH wrote:
> On Mon, Oct 30, 2023 at 11:02:04AM +0000, Suzuki K Poulose wrote:
>> Hi Greg
>>
>> Please find the updates for Linux v6.7. Kindly pull.
>
> It's too late, sorry. Last week might have been too late too, why the
> last-minute pull request?
Apologies, I was out sick last week. I was hoping that there would be
an rc8. The tree wasn't changed since last two weeks. I will try to
send the pull request at rc5-rc6 now onwards.
>
> Please send new changes after -rc1 is out for bugfixes and for normal
> new features.
Just to make sure I understand this correctly,
- I can send a pull request with handpicked fixes for rc1
- What about the other new features ?
(I can summaries the features below)
- TRBE ACPI support ( Parts of this feature went into v6.6 via
Will's perf subsystem, the coresight part was dropped due to
a conflict. I queued it for v6.7 - 2patches)
- CoreSight TPDM support for DSB feature (~10patches)
- Support for configuring cycle count threshold for ETM (3 patches)
Do they need to wait for v6.8 or could some of them go in for v6.7 ?
>
>> Please note the changes were queued and rebased onto v6.6-rc6 (which added
>> some of the fixes in the cycle).
>
> Why rebase? What required that?
This was to be on the safer side. I don't think there was any conflict.
Suzuki
>
> thanks,
>
> greg k-h
Hi Greg
Please find the updates for Linux v6.7. Kindly pull.
Please note the changes were queued and rebased onto v6.6-rc6 (which added
some of the fixes in the cycle).
Suzuki
The following changes since commit 58720809f52779dc0f08e53e54b014209d13eebb:
Linux 6.6-rc6 (2023-10-15 13:34:39 -0700)
are available in the Git repository at:
git//git.kernel.org/pub/scm/linux/kernel/git/coresight/linux.git tags/coresight-next-v6.7
for you to fetch changes up to fa55e63584f2c3c84e0c3acdace42544e1832cc2:
Documentation: coresight: fix `make refcheckdocs` warning (2023-10-25 11:21:29 +0100)
----------------------------------------------------------------
coresight: Updates for Linux v6.7
Updates for the hwtracing subsystem includes :
- Support for CoreSight TPDM DSB set
- Support for tuning Cycle count Threshold for CoreSight ETM via perf
- Support for TRBE on ACPI based systems
- Several fixes for the HiSilcon PTT tracing driver
- Fix crash with CoreSight ETM mixing perf and sysfs mode
- Remove Leo Yan from Reviewers
Signed-off-by: Suzuki K Poulose <suzuki.poulose(a)arm.com>
----------------------------------------------------------------
Anshuman Khandual (6):
coresight: trbe: Add a representative coresight_platform_data for TRBE
coresight: trbe: Enable ACPI based TRBE devices
coresight: etm: Override TRCIDR3.CCITMIN on errata affected cpus
coresight: etm: Make cycle count threshold user configurable
Documentation: coresight: Add cc_threshold tunable
coresight: tmc: Make etr buffer mode user configurable from sysfs
Bagas Sanjaya (1):
Documentation: ABI: coresight-tpdm: Fix Bit[3] description indentation
James Clark (1):
coresight: Fix crash when Perf and sysfs modes are used concurrently
Junhao He (1):
hwtracing: hisi_ptt: Add dummy callback pmu::read()
Leo Yan (1):
MAINTAINERS: Remove myself as a Arm CoreSight reviewer
Tao Zhang (13):
coresight-tpdm: Remove the unnecessary lock
dt-bindings: arm: Add support for DSB element size
coresight-tpdm: Introduce TPDM subtype to TPDM driver
coresight-tpda: Add DSB dataset support
coresight-tpdm: Initialize DSB subunit configuration
coresight-tpdm: Add reset node to TPDM node
coresight-tpdm: Add nodes to set trigger timestamp and type
coresight-tpdm: Add node to set dsb programming mode
coresight-tpdm: Add nodes for dsb edge control
coresight-tpdm: Add nodes to configure pattern match output
coresight-tpdm: Add nodes for timestamp request
dt-bindings: arm: Add support for DSB MSR register
coresight-tpdm: Add nodes for dsb msr support
Uwe Kleine-K��nig (1):
coresight: etm4x: Remove bogous __exit annotation for some functions
Vegard Nossum (1):
Documentation: coresight: fix `make refcheckdocs` warning
Yicong Yang (4):
hwtracing: hisi_ptt: Disable interrupt after trace end
hwtracing: hisi_ptt: Handle the interrupt in hardirq context
hwtracing: hisi_ptt: Optimize the trace data committing
hwtracing: hisi_ptt: Don't try to attach a task
.../ABI/testing/sysfs-bus-coresight-devices-tmc | 16 +
.../ABI/testing/sysfs-bus-coresight-devices-tpdm | 159 +++++
Documentation/arch/arm64/silicon-errata.rst | 10 +
.../bindings/arm/qcom,coresight-tpdm.yaml | 20 +
Documentation/trace/coresight/coresight.rst | 6 +-
MAINTAINERS | 1 -
drivers/hwtracing/coresight/coresight-core.c | 3 +
drivers/hwtracing/coresight/coresight-etm-perf.c | 6 +-
drivers/hwtracing/coresight/coresight-etm4x-core.c | 52 +-
drivers/hwtracing/coresight/coresight-tmc-core.c | 15 +-
drivers/hwtracing/coresight/coresight-tmc-etr.c | 111 +++-
drivers/hwtracing/coresight/coresight-tmc.h | 3 +
drivers/hwtracing/coresight/coresight-tpda.c | 126 +++-
drivers/hwtracing/coresight/coresight-tpda.h | 2 +
drivers/hwtracing/coresight/coresight-tpdm.c | 718 ++++++++++++++++++++-
drivers/hwtracing/coresight/coresight-tpdm.h | 161 +++++
drivers/hwtracing/coresight/coresight-trbe.c | 23 +-
drivers/hwtracing/coresight/coresight-trbe.h | 2 +
drivers/hwtracing/ptt/hisi_ptt.c | 33 +-
drivers/hwtracing/ptt/hisi_ptt.h | 1 +
include/linux/coresight.h | 1 +
21 files changed, 1411 insertions(+), 58 deletions(-)
There are two reasons to do this, firstly there is a shellcheck warning
in cs_etm_dev_name(), which can be completely deleted. And secondly the
current iteration method doesn't support systems with both ETE and ETM
because it picks one or the other. There isn't a known system with this
configuration, but it could happen in the future.
Iterating over all the sources for each CPU can be done by going through
/sys/bus/event_source/devices/cs_etm/cpu* and following the symlink back
to the Coresight device in /sys/bus/coresight/devices. This will work
whether the device is ETE, ETM or any future name, and is much simpler
and doesn't require any hard coded version numbers
Suggested-by: Suzuki K Poulose <suzuki.poulose(a)arm.com>
Signed-off-by: James Clark <james.clark(a)arm.com>
---
This was discussed here previously:
https://lore.kernel.org/all/20230929041133.95355-2-atrajeev@linux.vnet.ibm.…
I chose not to add a fixes tag like the original because shellcheck
isn't part of the build so it doesn't really fix any real issue yet and
is just a refactor.
tools/perf/tests/shell/test_arm_coresight.sh | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/tools/perf/tests/shell/test_arm_coresight.sh b/tools/perf/tests/shell/test_arm_coresight.sh
index fe78c4626e45..65dd85207125 100755
--- a/tools/perf/tests/shell/test_arm_coresight.sh
+++ b/tools/perf/tests/shell/test_arm_coresight.sh
@@ -11,19 +11,6 @@
glb_err=0
-cs_etm_dev_name() {
- cs_etm_path=$(find /sys/bus/event_source/devices/cs_etm/ -name cpu* -print -quit)
- trcdevarch=$(cat ${cs_etm_path}/mgmt/trcdevarch)
- archhver=$((($trcdevarch >> 12) & 0xf))
- archpart=$(($trcdevarch & 0xfff))
-
- if [ $archhver -eq 5 -a "$(printf "0x%X\n" $archpart)" = "0xA13" ] ; then
- echo "ete"
- else
- echo "etm"
- fi
-}
-
skip_if_no_cs_etm_event() {
perf list | grep -q 'cs_etm//' && return 0
@@ -149,7 +136,9 @@ arm_cs_iterate_devices() {
arm_cs_etm_traverse_path_test() {
# Iterate for every ETM device
- for dev in /sys/bus/coresight/devices/$(cs_etm_dev_name)*; do
+ for dev in /sys/bus/event_source/devices/cs_etm/cpu*; do
+ # Canonicalize the path
+ dev=`readlink -f $dev`
# Find the ETM device belonging to which CPU
cpu=`cat $dev/cpu`
--
2.34.1
On Sun, 22 Oct 2023 20:58:06 +0200, Vegard Nossum wrote:
> This reference uses a glob pattern to match multiple files, but the
> asterisk was escaped as \* in order to not be interpreted by sphinx
> as reStructuredText markup.
>
> refcheckdocs/documentation-file-ref-check doesn't know about rST syntax
> and tries to interpret the \* literally (instead of as a glob).
>
> [...]
Applied, thanks!
[1/1] Documentation: coresight: fix `make refcheckdocs` warning
https://git.kernel.org/coresight/c/fa55e63584f2
Best regards,
--
Suzuki K Poulose <suzuki.poulose(a)arm.com>
On 10/20/2023 4:59 PM, Krzysztof Kozlowski wrote:
> On 20/10/2023 10:13, Tao Zhang wrote:
>>>> diff --git a/drivers/hwtracing/coresight/coresight-tpdm.c b/drivers/hwtracing/coresight/coresight-tpdm.c
>>>> index b25284e..97654aa 100644
>>>> --- a/drivers/hwtracing/coresight/coresight-tpdm.c
>>>> +++ b/drivers/hwtracing/coresight/coresight-tpdm.c
>>>> @@ -892,7 +892,7 @@ static int tpdm_probe(struct amba_device *adev, const struct amba_id *id)
>>>>
>>>> if (drvdata && tpdm_has_dsb_dataset(drvdata))
>>>> of_property_read_u32(drvdata->dev->of_node,
>>>> - "qcom,dsb_msr_num", &drvdata->dsb_msr_num);
>>>> + "qcom,dsb-msrs-num", &drvdata->dsb_msr_num);
>>> So you never tested your DTS... We can keep asking about this but still
>>> testing does not happen :/
>> Since this new property has not been applied on the exist upstream DTS,
>> I tested this driver with the
>>
>> local DTS. Unfortunately, the property name in the local DTS is not
>> updated, this is why it is not found
> But your local DTS would not pass dtbs_check tests, so that's why I am
> saying - you never tested it on mainline kernel.
Thanks, we will add this test in the future to ensure that DTS, doc and
driver are consistent.
Best,
Tao
>
> Best regards,
> Krzysztof
>
Fix the Three issues listed below and use guards to cleanup
a) Fixed the BUG of atomic-sleep
b) Fixed uninitialized before use buf_hw_base
c) Fixed use unreset SMB buffer
Changes since V1:
* Add comment for remove lock from smb_read()
* Move reset buffer to before register sink
* Remove patch "simplify the code for check to_copy valid"
* Add two new patches
Link to V1: https://lore.kernel.org/lkml/20231012094706.21565-1-hejunhao3@huawei.com/
Junhao He (4):
coresight: ultrasoc-smb: Fix sleep while close preempt in enable_smb
coresight: ultrasoc-smb: Config SMB buffer before register sink
coresight: ultrasoc-smb: Fix uninitialized before use buf_hw_base
coresight: ultrasoc-smb: Use guards to cleanup
drivers/hwtracing/coresight/ultrasoc-smb.c | 108 +++++++--------------
drivers/hwtracing/coresight/ultrasoc-smb.h | 6 +-
2 files changed, 37 insertions(+), 77 deletions(-)
--
2.33.0
Hi Jonathan,
On 2023/10/19 21:30, Jonathan Cameron wrote:
> On Thu, 12 Oct 2023 17:47:04 +0800
> Junhao He <hejunhao3(a)huawei.com> wrote:
>
>> When we to enable the SMB by perf, the perf sched will call perf_ctx_lock()
>> to close system preempt in event_function_call(). But SMB::enable_smb() use
>> mutex to lock the critical section, which may sleep.
>>
>> BUG: sleeping function called from invalid context at kernel/locking/mutex.c:580
>> in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 153023, name: perf
>> preempt_count: 2, expected: 0
>> RCU nest depth: 0, expected: 0
>> INFO: lockdep is turned off.
>> irq event stamp: 0
>> hardirqs last enabled at (0): [<0000000000000000>] 0x0
>> hardirqs last disabled at (0): [<ffffa2983f5c5f40>] copy_process+0xae8/0x2b48
>> softirqs last enabled at (0): [<ffffa2983f5c5f40>] copy_process+0xae8/0x2b48
>> softirqs last disabled at (0): [<0000000000000000>] 0x0
>> CPU: 2 PID: 153023 Comm: perf Kdump: loaded Tainted: G W O 6.5.0-rc4+ #1
>>
>> Call trace:
>> ...
>> __mutex_lock+0xbc/0xa70
>> mutex_lock_nested+0x34/0x48
>> smb_update_buffer+0x58/0x360 [ultrasoc_smb]
>> etm_event_stop+0x204/0x2d8 [coresight]
>> etm_event_del+0x1c/0x30 [coresight]
>> event_sched_out+0x17c/0x3b8
>> group_sched_out.part.0+0x5c/0x208
>> __perf_event_disable+0x15c/0x210
>> event_function+0xe0/0x230
>> remote_function+0xb4/0xe8
>> generic_exec_single+0x160/0x268
>> smp_call_function_single+0x20c/0x2a0
>> event_function_call+0x20c/0x220
>> _perf_event_disable+0x5c/0x90
>> perf_event_for_each_child+0x58/0xc0
>> _perf_ioctl+0x34c/0x1250
>> perf_ioctl+0x64/0x98
>> ...
>>
>> Use spinlock replace mutex to control driver data access to one at a
>> time. But the function copy_to_user() may sleep so spinlock do not to
>> lock it.
> I'd like to see a comment on why we no longer need to lock over the copy_to_user
> rather than simply that we can't.
Yes, I will do that.
>> Fixes: 06f5c2926aaa ("drivers/coresight: Add UltraSoc System Memory Buffer driver")
>> Signed-off-by: Junhao He <hejunhao3(a)huawei.com>
> A follow up patch could change a lot of this to use the new cleanup.h (don't want that
> in the fix though as will make back porting trickier.).
> That should let you do
> guard(spin_lock)(&drvdata->spinlock);
> and then use direct returns instead of goto complexity.
>
>
>
> Jonathan
Thanks for sharing.
I will append up a new patch to use guards to reduce gotos.
>
>> @@ -132,10 +132,8 @@ static ssize_t smb_read(struct file *file, char __user *data, size_t len,
>> if (!len)
>> return 0;
>>
>> - mutex_lock(&drvdata->mutex);
>> -
>> if (!sdb->data_size)
>> - goto out;
>> + return 0;
>>
>> to_copy = min(sdb->data_size, len);
>>
>> @@ -145,20 +143,18 @@ static ssize_t smb_read(struct file *file, char __user *data, size_t len,
>>
>> if (copy_to_user(data, sdb->buf_base + sdb->buf_rdptr, to_copy)) {
>> dev_dbg(dev, "Failed to copy data to user\n");
>> - to_copy = -EFAULT;
>> - goto out;
>> + return -EFAULT;
>> }
>>
>> + spin_lock(&drvdata->spinlock);
>> *ppos += to_copy;
>> -
> Unrelated white space change that shouldn't be here.
Ok, i will drop this white space
Thanks for the comments!
Best regards,
Junhao.
>
>> smb_update_read_ptr(drvdata, to_copy);
>>
>> - dev_dbg(dev, "%zu bytes copied\n", to_copy);
>> -out:
>> if (!sdb->data_size)
>> smb_reset_buffer(drvdata);
>> - mutex_unlock(&drvdata->mutex);
>> + spin_unlock(&drvdata->spinlock);
>>
>> + dev_dbg(dev, "%zu bytes copied\n", to_copy);
>> return to_copy;
>> }
>
> .
>
On 10/20/2023 2:55 PM, Krzysztof Kozlowski wrote:
> On 20/10/2023 04:51, Tao Zhang wrote:
>> Correct the property name of the DSB MSR number that needs to be
>> read in TPDM driver. The right property name is
>> "qcom,dsb-msrs-num".
> Missing Fixes tag.
I will add it in the next patch.
>
>> This patch depends on patch series "Add support to configure TPDM DSB
>> subunit"
>> https://patchwork.kernel.org/project/linux-arm-kernel/list/?series=788353
> This is not suitable for commit msg. Dependencies are noted under ---.
>
> And how is this depending on that patch? Your buggy code was applied
> long time ago!
Yes, no need to depend on the patch series and it has been applied. I
will remove this comments
in the next patch.
>> Signed-off-by: Tao Zhang <quic_taozha(a)quicinc.com>
>> ---
>> drivers/hwtracing/coresight/coresight-tpdm.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/hwtracing/coresight/coresight-tpdm.c b/drivers/hwtracing/coresight/coresight-tpdm.c
>> index b25284e..97654aa 100644
>> --- a/drivers/hwtracing/coresight/coresight-tpdm.c
>> +++ b/drivers/hwtracing/coresight/coresight-tpdm.c
>> @@ -892,7 +892,7 @@ static int tpdm_probe(struct amba_device *adev, const struct amba_id *id)
>>
>> if (drvdata && tpdm_has_dsb_dataset(drvdata))
>> of_property_read_u32(drvdata->dev->of_node,
>> - "qcom,dsb_msr_num", &drvdata->dsb_msr_num);
>> + "qcom,dsb-msrs-num", &drvdata->dsb_msr_num);
> So you never tested your DTS... We can keep asking about this but still
> testing does not happen :/
Since this new property has not been applied on the exist upstream DTS,
I tested this driver with the
local DTS. Unfortunately, the property name in the local DTS is not
updated, this is why it is not found
in the tests.
Best,
Tao
>
> Best regards,
> Krzysztof
>