Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6.12.y is missing arm-pmu device tree node on Pi5 #6507

Closed
mmozeiko opened this issue Dec 3, 2024 · 2 comments
Closed

6.12.y is missing arm-pmu device tree node on Pi5 #6507

mmozeiko opened this issue Dec 3, 2024 · 2 comments
Labels
Close within 30 days Issue will be closed within 30 days unless requested to stay open

Comments

@mmozeiko
Copy link

mmozeiko commented Dec 3, 2024

Describe the bug

perf utility is not able to use hardware PMU counters on 6.12 kernel on Raspberry Pi 5

It seems 6.12.y tree is missing pmu node in device tree:
In 6.6.y - https://github.com/raspberrypi/linux/blob/rpi-6.6.y/arch/arm64/boot/dts/broadcom/bcm2712.dtsi#L725-L732
In 6.12.y - https://github.com/raspberrypi/linux/blob/rpi-6.12.y/arch/arm64/boot/dts/broadcom/bcm2712.dtsi

Steps to reproduce the behaviour

Run dmesg | grep perfevents - it does not show anything.
Or check /sys/bus/event_source/devices/armv8_cortex_a76 folder - it does not exist.

On 6.6 dmesg | grep perfevents shows:

[ 2.317516] hw perfevents: enabled with armv8_cortex_a76 PMU driver, 7 counters available

and /sys/bus/event_source/devices/armv8_cortex_a76/events/ exists and contains bunch of counter events.

I've patched my device tree file /boot/bcm2712-rpi-5-b.dtb by adding this section:

	arm-pmu {
		compatible = "arm,cortex-a76-pmu";
		interrupts = <0x00 0x10 0x04 0x00 0x11 0x04 0x00 0x12 0x04 0x00 0x13 0x04>;
		interrupt-affinity = <0x7c 0x7d 0x7e 0x7f>;
	};

I don't know if these values are 100% correct, I tried to guess them - I used 6.6 dts as example, and only changed interrupt-affinity to matching values for 6.12 dts file.

Then dmesg | grep perfevents shows:

[    2.338034] hw perfevents: enabled with armv8_cortex_a76 PMU driver, 7 (0,8000003f) counters available

and /sys/bus/event_source/devices/armv8_cortex_a76/events/ folder contains bunch of counter events.

After this patch the perf works, at least on events I've tried - cpu cycles & instructions.

Device (s)

Raspberry Pi 5

System

I am running ArchLinux ARM with linux-rpi-16k 6.12.1-1 package for kernel.

$ uname -a
Linux pi5 6.12.1-1-rpi-16k #1 SMP PREEMPT Mon Nov 25 13:04:10 MST 2024 aarch64 GNU/Linux

Logs

No response

Additional context

No response

@pelwell
Copy link
Contributor

pelwell commented Dec 3, 2024

Yes, that got dropped in the change to using the upstream bcm2712.dtsi. The pre-release squashing that happens to the tree means I can't see where we lost it, but was probably just never added.

#6508 includes the obvious fix.

pelwell added a commit that referenced this issue Dec 3, 2024
In the move to the upstream bcm2712.dts, the A76 PMU was omitted from
the required downstream additions.

Link: #6507

Signed-off-by: Phil Elwell <[email protected]>
pelwell added a commit that referenced this issue Dec 3, 2024
Following the merging of [1], it is safe to re-enable DMA to UART0
without fear of losing data.

Seen while looking at #6507.

[1] dmaengine: dw-axi-dmac: Allow client-chosen width

Signed-off-by: Phil Elwell <[email protected]>
@pelwell pelwell added the Close within 30 days Issue will be closed within 30 days unless requested to stay open label Dec 4, 2024
popcornmix pushed a commit that referenced this issue Dec 7, 2024
In the move to the upstream bcm2712.dts, the A76 PMU was omitted from
the required downstream additions.

Link: #6507

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Dec 7, 2024
Following the merging of [1], it is safe to re-enable DMA to UART0
without fear of losing data.

Seen while looking at #6507.

[1] dmaengine: dw-axi-dmac: Allow client-chosen width

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Dec 9, 2024
In the move to the upstream bcm2712.dts, the A76 PMU was omitted from
the required downstream additions.

Link: #6507

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Dec 9, 2024
Following the merging of [1], it is safe to re-enable DMA to UART0
without fear of losing data.

Seen while looking at #6507.

[1] dmaengine: dw-axi-dmac: Allow client-chosen width

Signed-off-by: Phil Elwell <[email protected]>
@mmozeiko
Copy link
Author

I've upgraded arch package that includes this fix, and perf now works fine. Thanks!

@pelwell pelwell closed this as completed Dec 10, 2024
popcornmix pushed a commit that referenced this issue Dec 10, 2024
In the move to the upstream bcm2712.dts, the A76 PMU was omitted from
the required downstream additions.

Link: #6507

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Dec 10, 2024
Following the merging of [1], it is safe to re-enable DMA to UART0
without fear of losing data.

Seen while looking at #6507.

[1] dmaengine: dw-axi-dmac: Allow client-chosen width

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Dec 16, 2024
In the move to the upstream bcm2712.dts, the A76 PMU was omitted from
the required downstream additions.

Link: #6507

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Dec 16, 2024
Following the merging of [1], it is safe to re-enable DMA to UART0
without fear of losing data.

Seen while looking at #6507.

[1] dmaengine: dw-axi-dmac: Allow client-chosen width

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Dec 16, 2024
In the move to the upstream bcm2712.dts, the A76 PMU was omitted from
the required downstream additions.

Link: #6507

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Dec 16, 2024
Following the merging of [1], it is safe to re-enable DMA to UART0
without fear of losing data.

Seen while looking at #6507.

[1] dmaengine: dw-axi-dmac: Allow client-chosen width

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Dec 20, 2024
In the move to the upstream bcm2712.dts, the A76 PMU was omitted from
the required downstream additions.

Link: #6507

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Dec 20, 2024
Following the merging of [1], it is safe to re-enable DMA to UART0
without fear of losing data.

Seen while looking at #6507.

[1] dmaengine: dw-axi-dmac: Allow client-chosen width

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jan 2, 2025
In the move to the upstream bcm2712.dts, the A76 PMU was omitted from
the required downstream additions.

Link: #6507

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jan 2, 2025
Following the merging of [1], it is safe to re-enable DMA to UART0
without fear of losing data.

Seen while looking at #6507.

[1] dmaengine: dw-axi-dmac: Allow client-chosen width

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jan 2, 2025
In the move to the upstream bcm2712.dts, the A76 PMU was omitted from
the required downstream additions.

Link: #6507

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jan 2, 2025
Following the merging of [1], it is safe to re-enable DMA to UART0
without fear of losing data.

Seen while looking at #6507.

[1] dmaengine: dw-axi-dmac: Allow client-chosen width

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jan 6, 2025
In the move to the upstream bcm2712.dts, the A76 PMU was omitted from
the required downstream additions.

Link: #6507

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jan 6, 2025
Following the merging of [1], it is safe to re-enable DMA to UART0
without fear of losing data.

Seen while looking at #6507.

[1] dmaengine: dw-axi-dmac: Allow client-chosen width

Signed-off-by: Phil Elwell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Close within 30 days Issue will be closed within 30 days unless requested to stay open
Projects
None yet
Development

No branches or pull requests

2 participants