Skip to contentSkip to conversation

Regression with mainline kernel on rpi4

DISCUSSION Sudip Mukherjee 4 participants 27 messages Sep 2, 2021 – Oct 25, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi All,

Our last night's test on rpi4 had a nasty trace. The test was with 7c636d4d20f8 ("Merge tag 'dt-5.15' of
git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc"). Previous test was on 9e9fb7655ed5 ("Merge tag 'net-next-5.15' of
git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next") and it did not have this trace.

[   40.975161] Unable to handle kernel access to user memory outside
uaccess routines at virtual address 0000000000000348
[   40.986187] Mem abort info:
[   40.989062]   ESR = 0x96000004
[   40.992233]   EC = 0x25: DABT (current EL), IL = 32 bits
[   40.997699]   SET = 0, FnV = 0
[   41.001205]   EA = 0, S1PTW = 0
[   41.004428]   FSC = 0x04: level 0 translation fault
[   41.009468] Data abort info:
[   41.012410]   ISV = 0, ISS = 0x00000004
[   41.016325]   CM = 0, WnR = 0
[   41.019358] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000042ae1000
[   41.025926] [0000000000000348] pgd=0000000000000000, p4d=0000000000000000
[   41.032845] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[   41.038495] Modules linked in: overlay algif_hash algif_skcipher

af_alg bnep sch_fq_codel ppdev lp parport ip_tables x_tables autofs4 btrfs blake2b_generic zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor xor_neon raid6_pq libcrc32c raid1 raid0 multipath linear uas usb_storage snd_soc_hdmi_codec btsdio brcmfmac brcmutil hci_uart btqca btrtl bcm2835_v4l2(C) btbcm crct10dif_ce bcm2835_mmal_vchiq(C) btintel raspberrypi_hwmon videobuf2_vmalloc videobuf2_memops bluetooth videobuf2_v4l2 videobuf2_common cfg80211 ecdh_generic ecc vc4 drm_kms_helper videodev dwc2 cec snd_bcm2835(C) i2c_brcmstb udc_core roles drm xhci_pci mc pwm_bcm2835 xhci_pci_renesas snd_soc_core ac97_bus snd_pcm_dmaengine snd_pcm phy_generic snd_timer uio_pdrv_genirq snd fb_sys_fops syscopyarea sysfillrect sysimgblt uio aes_neon_bs aes_neon_blk crypto_simd cryptd

[   41.116584] CPU: 0 PID: 1569 Comm: pulseaudio Tainted: G         C
      5.14.0-7c636d4d20f8 #1
[   41.125494] Hardware name: Raspberry Pi 4 Model B (DT)
[   41.130699] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[   41.137756] pc : vc4_hdmi_audio_prepare+0x3c0/0xba4 [vc4]
[   41.143256] lr : vc4_hdmi_audio_prepare+0x308/0xba4 [vc4]
[   41.148747] sp : ffff800012f73a50
[   41.152099] x29: ffff800012f73a50 x28: ffff0000562ecc00 x27: 0000000000000000
[   41.159338] x26: 0000000000000000 x25: 000000000000ac44 x24: 0000000021002003
[   41.166574] x23: ffff800012f73b40 x22: 0000000000000003 x21: ffff000059400080
[   41.173811] x20: ffff0000594004c8 x19: 0005833333380600 x18: 0000000000000000
[   41.181047] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[   41.188283] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000991
[   41.195520] x11: 0000000000000001 x10: 000000000001d4c0 x9 : ffff800009047838
[   41.202757] x8 : 0000000000000031 x7 : 000000000001d4c0 x6 : 0000000000000030
[   41.209993] x5 : ffff800012f73a98 x4 : ffff80000905bb60 x3 : 0000000010624dd3
[   41.217230] x2 : 00000000000003e8 x1 : 0000000000000000 x0 : 0000000000562200
[   41.224466] Call trace:
[   41.226939]  vc4_hdmi_audio_prepare+0x3c0/0xba4 [vc4]
[   41.232080]  hdmi_codec_prepare+0xe8/0x1b0 [snd_soc_hdmi_codec]
[   41.238083]  snd_soc_pcm_dai_prepare+0x5c/0x10c [snd_soc_core]
[   41.244038]  soc_pcm_prepare+0x5c/0x130 [snd_soc_core]
[   41.249276]  snd_pcm_prepare+0x150/0x1f0 [snd_pcm]
[   41.254149]  snd_pcm_common_ioctl+0x1644/0x1d14 [snd_pcm]
[   41.259635]  snd_pcm_ioctl+0x3c/0x5c [snd_pcm]
[   41.264152]  __arm64_sys_ioctl+0xb4/0x100
[   41.268216]  invoke_syscall+0x50/0x120
[   41.272014]  el0_svc_common+0x18c/0x1a4
[   41.275899]  do_el0_svc+0x34/0x9c
[   41.279254]  el0_svc+0x2c/0xc0
[   41.282348]  el0t_64_sync_handler+0xa4/0x12c
[   41.286673]  el0t_64_sync+0x1a4/0x1a8
[   41.290385] Code: 52807d02 72a20c43 f9400421 9ba37c13 (f941a423)
[   41.296563] ---[ end trace dcfe08f10aaf6873 ]---

You can see the complete dmesg at
https://openqa.qa.codethink.co.uk/tests/76#step/dmesg/8

Signature · 2 lines
Regards
Sudip
#1 lore raw

Hi Sudip,

Quoted 72 lines · Sudip Mukherjee

Hi All,

Our last night's test on rpi4 had a nasty trace. The test was with 7c636d4d20f8 ("Merge tag 'dt-5.15' of
git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc"). Previous test was on 9e9fb7655ed5 ("Merge tag 'net-next-5.15' of
git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next") and it did not have this trace.

[   40.975161] Unable to handle kernel access to user memory outside
uaccess routines at virtual address 0000000000000348
[   40.986187] Mem abort info:
[   40.989062]   ESR = 0x96000004
[   40.992233]   EC = 0x25: DABT (current EL), IL = 32 bits
[   40.997699]   SET = 0, FnV = 0
[   41.001205]   EA = 0, S1PTW = 0
[   41.004428]   FSC = 0x04: level 0 translation fault
[   41.009468] Data abort info:
[   41.012410]   ISV = 0, ISS = 0x00000004
[   41.016325]   CM = 0, WnR = 0
[   41.019358] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000042ae1000
[   41.025926] [0000000000000348] pgd=0000000000000000, p4d=0000000000000000
[   41.032845] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[   41.038495] Modules linked in: overlay algif_hash algif_skcipher

af_alg bnep sch_fq_codel ppdev lp parport ip_tables x_tables autofs4 btrfs blake2b_generic zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor xor_neon raid6_pq libcrc32c raid1 raid0 multipath linear uas usb_storage snd_soc_hdmi_codec btsdio brcmfmac brcmutil hci_uart btqca btrtl bcm2835_v4l2(C) btbcm crct10dif_ce bcm2835_mmal_vchiq(C) btintel raspberrypi_hwmon videobuf2_vmalloc videobuf2_memops bluetooth videobuf2_v4l2 videobuf2_common cfg80211 ecdh_generic ecc vc4 drm_kms_helper videodev dwc2 cec snd_bcm2835(C) i2c_brcmstb udc_core roles drm xhci_pci mc pwm_bcm2835 xhci_pci_renesas snd_soc_core ac97_bus snd_pcm_dmaengine snd_pcm phy_generic snd_timer uio_pdrv_genirq snd fb_sys_fops syscopyarea sysfillrect sysimgblt uio aes_neon_bs aes_neon_blk crypto_simd cryptd

[   41.116584] CPU: 0 PID: 1569 Comm: pulseaudio Tainted: G         C
      5.14.0-7c636d4d20f8 #1
[   41.125494] Hardware name: Raspberry Pi 4 Model B (DT)
[   41.130699] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[   41.137756] pc : vc4_hdmi_audio_prepare+0x3c0/0xba4 [vc4]
[   41.143256] lr : vc4_hdmi_audio_prepare+0x308/0xba4 [vc4]
[   41.148747] sp : ffff800012f73a50
[   41.152099] x29: ffff800012f73a50 x28: ffff0000562ecc00 x27: 0000000000000000
[   41.159338] x26: 0000000000000000 x25: 000000000000ac44 x24: 0000000021002003
[   41.166574] x23: ffff800012f73b40 x22: 0000000000000003 x21: ffff000059400080
[   41.173811] x20: ffff0000594004c8 x19: 0005833333380600 x18: 0000000000000000
[   41.181047] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[   41.188283] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000991
[   41.195520] x11: 0000000000000001 x10: 000000000001d4c0 x9 : ffff800009047838
[   41.202757] x8 : 0000000000000031 x7 : 000000000001d4c0 x6 : 0000000000000030
[   41.209993] x5 : ffff800012f73a98 x4 : ffff80000905bb60 x3 : 0000000010624dd3
[   41.217230] x2 : 00000000000003e8 x1 : 0000000000000000 x0 : 0000000000562200
[   41.224466] Call trace:
[   41.226939]  vc4_hdmi_audio_prepare+0x3c0/0xba4 [vc4]
[   41.232080]  hdmi_codec_prepare+0xe8/0x1b0 [snd_soc_hdmi_codec]
[   41.238083]  snd_soc_pcm_dai_prepare+0x5c/0x10c [snd_soc_core]
[   41.244038]  soc_pcm_prepare+0x5c/0x130 [snd_soc_core]
[   41.249276]  snd_pcm_prepare+0x150/0x1f0 [snd_pcm]
[   41.254149]  snd_pcm_common_ioctl+0x1644/0x1d14 [snd_pcm]
[   41.259635]  snd_pcm_ioctl+0x3c/0x5c [snd_pcm]
[   41.264152]  __arm64_sys_ioctl+0xb4/0x100
[   41.268216]  invoke_syscall+0x50/0x120
[   41.272014]  el0_svc_common+0x18c/0x1a4
[   41.275899]  do_el0_svc+0x34/0x9c
[   41.279254]  el0_svc+0x2c/0xc0
[   41.282348]  el0t_64_sync_handler+0xa4/0x12c
[   41.286673]  el0t_64_sync+0x1a4/0x1a8
[   41.290385] Code: 52807d02 72a20c43 f9400421 9ba37c13 (f941a423)
[   41.296563] ---[ end trace dcfe08f10aaf6873 ]---
Quoted 2 lines

You can see the complete dmesg at
https://openqa.qa.codethink.co.uk/tests/76#step/dmesg/8

What test were you running?

Maxime

#2 lore raw

Hi Maxime,

Quoted 7 lines · Maxime Ripard

Hi Sudip,

Quoted 2 lines · Sudip Mukherjee

Hi All,

<snip>

Quoted 6 lines
Quoted 4 lines

You can see the complete dmesg at
https://openqa.qa.codethink.co.uk/tests/76#step/dmesg/8

What test were you running?

Nothing particular, its just a boot test that we do every night after pulling from torvalds/linux.git

Signature · 2 lines
Regards
Sudip
#3 lore raw
Quoted 15 lines · Sudip Mukherjee

Hi Maxime,

Quoted 7 lines · Maxime Ripard

Hi Sudip,

Quoted 2 lines · Sudip Mukherjee

Hi All,

<snip>

Quoted 2 lines
Quoted 2 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

You can see the complete dmesg at
https://openqa.qa.codethink.co.uk/tests/76#step/dmesg/8

What test were you running?

Nothing particular, its just a boot test that we do every night after pulling from torvalds/linux.git

What are you booting to then?

Maxime

#4 lore raw

Hi Maxime,

Quoted 20 lines · Maxime Ripard
Quoted 18 lines · Sudip Mukherjee

Hi Maxime,

Quoted 7 lines · Maxime Ripard

Hi Sudip,

Quoted 2 lines · Sudip Mukherjee

Hi All,

<snip>

Quoted 5 lines
Quoted 4 lines

You can see the complete dmesg at
https://openqa.qa.codethink.co.uk/tests/76#step/dmesg/8

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

What test were you running?

Nothing particular, its just a boot test that we do every night after pulling from torvalds/linux.git

What are you booting to then?

I am not sure I understood the question.
Its an Ubuntu image. The desktop environment is gnome. And as mentioned earlier, we use the HEAD of linus tree every night to boot the rpi4 and test that we can login via desktop environment and that there is no regression in dmesg.

Signature · 2 lines
Regards
Sudip
#5 lore raw
Quoted 28 lines · Sudip Mukherjee

Hi Maxime,

Quoted 25 lines · Maxime Ripard
Quoted 22 lines · Sudip Mukherjee

Hi Maxime,

Quoted 7 lines · Maxime Ripard

Hi Sudip,

Quoted 2 lines · Sudip Mukherjee

Hi All,

<snip>

Quoted 6 lines
Quoted 4 lines

You can see the complete dmesg at
https://openqa.qa.codethink.co.uk/tests/76#step/dmesg/8

What test were you running?

Nothing particular, its just a boot test that we do every night after pulling from torvalds/linux.git

Quoted 7 lines
Quoted 1 line

What are you booting to then?

I am not sure I understood the question.
Its an Ubuntu image. The desktop environment is gnome. And as mentioned earlier, we use the HEAD of linus tree every night to boot the rpi4 and test that we can login via desktop environment and that there is no regression in dmesg.

Looking at the CI, this isn't from a RPi but from qemu?

What defconfig are you using? How did you generate the Ubuntu image? Through debootstrap? Any additional package?

Maxime

#6 lore raw
Quoted 37 lines · Maxime Ripard
Quoted 28 lines · Sudip Mukherjee

Hi Maxime,

Quoted 25 lines · Maxime Ripard
Quoted 22 lines · Sudip Mukherjee

Hi Maxime,

Quoted 7 lines · Maxime Ripard

Hi Sudip,

Quoted 2 lines · Sudip Mukherjee

Hi All,

<snip>

Quoted 6 lines
Quoted 4 lines

You can see the complete dmesg at
https://openqa.qa.codethink.co.uk/tests/76#step/dmesg/8

What test were you running?

Nothing particular, its just a boot test that we do every night after pulling from torvalds/linux.git

Quoted 7 lines
Quoted 1 line

What are you booting to then?

I am not sure I understood the question.
Its an Ubuntu image. The desktop environment is gnome. And as mentioned earlier, we use the HEAD of linus tree every night to boot the rpi4 and test that we can login via desktop environment and that there is no regression in dmesg.

Quoted 4 lines

Looking at the CI, this isn't from a RPi but from qemu?

What defconfig are you using? How did you generate the Ubuntu image? Through debootstrap? Any additional package?

So qemu (at least on Fedora 34) doesn't seem to have an RPI4 target, nor upstream:
https://github.com/qemu/qemu/blob/079b1252e9de384385c9da910262312ec2e574c8/hw/arm/raspi.c#L367

I've tested an Ubuntu 21.04 arm64 build (since it seems like it's what you've been using), built using debootstrap + ubuntu-desktop, both with and without a monitor attached, and up to the desktop once logged in.

I don't see any crash.

Maxime

#7 lore raw
Quoted 47 lines · Maxime Ripard
Quoted 37 lines · Maxime Ripard
Quoted 28 lines · Sudip Mukherjee

Hi Maxime,

Quoted 25 lines · Maxime Ripard
Quoted 22 lines · Sudip Mukherjee

Hi Maxime,

Quoted 7 lines · Maxime Ripard

Hi Sudip,

Quoted 2 lines · Sudip Mukherjee

Hi All,

<snip>

Quoted 6 lines
Quoted 4 lines

You can see the complete dmesg at
https://openqa.qa.codethink.co.uk/tests/76#step/dmesg/8

What test were you running?

Nothing particular, its just a boot test that we do every night after pulling from torvalds/linux.git

Quoted 7 lines
Quoted 1 line

What are you booting to then?

I am not sure I understood the question.
Its an Ubuntu image. The desktop environment is gnome. And as mentioned earlier, we use the HEAD of linus tree every night to boot the rpi4 and test that we can login via desktop environment and that there is no regression in dmesg.

Quoted 4 lines

Looking at the CI, this isn't from a RPi but from qemu?

What defconfig are you using? How did you generate the Ubuntu image? Through debootstrap? Any additional package?

So qemu (at least on Fedora 34) doesn't seem to have an RPI4 target, nor upstream:
https://github.com/qemu/qemu/blob/079b1252e9de384385c9da910262312ec2e574c8/hw/arm/raspi.c#L367

Quoted 5 lines

I've tested an Ubuntu 21.04 arm64 build (since it seems like it's what you've been using), built using debootstrap + ubuntu-desktop, both with and without a monitor attached, and up to the desktop once logged in.

I don't see any crash.

That was with arm64's defconfig.

Maxime

#8 lore raw
Quoted 34 lines · Maxime Ripard
Quoted 32 lines · Maxime Ripard
Quoted 31 lines · Maxime Ripard
Quoted 30 lines · Sudip Mukherjee

Hi Maxime,

Quoted 26 lines · Maxime Ripard
Quoted 15 lines · Sudip Mukherjee

Hi Maxime,

Quoted 7 lines · Maxime Ripard

Hi Sudip,

Quoted 2 lines · Sudip Mukherjee

Hi All,

<snip>

Quoted 2 lines
Quoted 2 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

You can see the complete dmesg at
https://openqa.qa.codethink.co.uk/tests/76#step/dmesg/8

What test were you running?

Nothing particular, its just a boot test that we do every night after pulling from torvalds/linux.git

What are you booting to then?

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

I am not sure I understood the question.
Its an Ubuntu image. The desktop environment is gnome. And as mentioned earlier, we use the HEAD of linus tree every night to boot the rpi4 and test that we can login via desktop environment and that there is no regression in dmesg.

Looking at the CI, this isn't from a RPi but from qemu?

No, this is from rpi4 board (4GB), not qemu. The CI is a little complicated here, lava boots the board with the new kernel and will then trigger the openQA job. openQA will then connect to the board using vnc to test the desktop. This is the last link that I sent to Linus when he asked for it.
https://lava.qa.codethink.co.uk/scheduler/job/164#L1356

And this is the lava job for today -
https://lava.qa.codethink.co.uk/scheduler/job/173

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

What defconfig are you using? How did you generate the Ubuntu image? Through debootstrap? Any additional package?

Its the default ubuntu config. I can send you the config if you want.

Quoted 5 lines
Quoted 5 lines

So qemu (at least on Fedora 34) doesn't seem to have an RPI4 target, nor upstream:
https://github.com/qemu/qemu/blob/079b1252e9de384385c9da910262312ec2e574c8/hw/arm/raspi.c#L367

Like I said, its not on qemu.

Quoted 3 lines
Quoted 3 lines

I've tested an Ubuntu 21.04 arm64 build (since it seems like it's what you've been using), built using debootstrap + ubuntu-desktop, both with and without a monitor attached, and up to the desktop once logged in.

I am using the official ubuntu image downloaded from
https://cdimage.ubuntu.com/releases/21.04/release/ubuntu-21.04-preinstalled-desktop-arm64+raspi.img.xz

Signature · 2 lines
Regards
Sudip
#9 lore raw
Quoted 50 lines · Sudip Mukherjee
Quoted 34 lines · Maxime Ripard
Quoted 32 lines · Maxime Ripard
Quoted 31 lines · Maxime Ripard
Quoted 30 lines · Sudip Mukherjee

Hi Maxime,

Quoted 26 lines · Maxime Ripard
Quoted 15 lines · Sudip Mukherjee

Hi Maxime,

Quoted 7 lines · Maxime Ripard

Hi Sudip,

Quoted 2 lines · Sudip Mukherjee

Hi All,

<snip>

Quoted 2 lines
Quoted 2 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

You can see the complete dmesg at
https://openqa.qa.codethink.co.uk/tests/76#step/dmesg/8

What test were you running?

Nothing particular, its just a boot test that we do every night after pulling from torvalds/linux.git

What are you booting to then?

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

I am not sure I understood the question.
Its an Ubuntu image. The desktop environment is gnome. And as mentioned earlier, we use the HEAD of linus tree every night to boot the rpi4 and test that we can login via desktop environment and that there is no regression in dmesg.

Looking at the CI, this isn't from a RPi but from qemu?

No, this is from rpi4 board (4GB), not qemu. The CI is a little complicated here, lava boots the board with the new kernel and will then trigger the openQA job. openQA will then connect to the board using vnc to test the desktop. This is the last link that I sent to Linus when he asked for it.
https://lava.qa.codethink.co.uk/scheduler/job/164#L1356

Quoted 2 lines

And this is the lava job for today -
https://lava.qa.codethink.co.uk/scheduler/job/173

Is it connected to a monitor then?

Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

What defconfig are you using? How did you generate the Ubuntu image? Through debootstrap? Any additional package?

Its the default ubuntu config. I can send you the config if you want.

Yes, please.

Thanks
Maxime

#10 lore raw
Quoted 52 lines · Maxime Ripard
Quoted 50 lines · Sudip Mukherjee
Quoted 34 lines · Maxime Ripard
Quoted 32 lines · Maxime Ripard
Quoted 31 lines · Maxime Ripard
Quoted 30 lines · Sudip Mukherjee

Hi Maxime,

Quoted 26 lines · Maxime Ripard
Quoted 15 lines · Sudip Mukherjee

Hi Maxime,

Quoted 7 lines · Maxime Ripard

Hi Sudip,

Quoted 2 lines · Sudip Mukherjee

Hi All,

<snip>

Quoted 2 lines
Quoted 2 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

You can see the complete dmesg at
https://openqa.qa.codethink.co.uk/tests/76#step/dmesg/8

What test were you running?

Nothing particular, its just a boot test that we do every night after pulling from torvalds/linux.git

What are you booting to then?

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

I am not sure I understood the question.
Its an Ubuntu image. The desktop environment is gnome. And as mentioned earlier, we use the HEAD of linus tree every night to boot the rpi4 and test that we can login via desktop environment and that there is no regression in dmesg.

Looking at the CI, this isn't from a RPi but from qemu?

No, this is from rpi4 board (4GB), not qemu. The CI is a little complicated here, lava boots the board with the new kernel and will then trigger the openQA job. openQA will then connect to the board using vnc to test the desktop. This is the last link that I sent to Linus when he asked for it.
https://lava.qa.codethink.co.uk/scheduler/job/164#L1356

Quoted 4 lines
Quoted 2 lines

And this is the lava job for today -
https://lava.qa.codethink.co.uk/scheduler/job/173

Is it connected to a monitor then?

Missed replying to this one earlier. I have a hdmi lilliput monitor connected to it.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

What defconfig are you using? How did you generate the Ubuntu image? Through debootstrap? Any additional package?

Its the default ubuntu config. I can send you the config if you want.

Yes, please.

Attached.
My build script will copy this config as .config, do olddefconfig and then build.

Signature · 2 lines
Regards
Sudip
#11 lore raw
Quoted 66 lines · Sudip Mukherjee
Quoted 52 lines · Maxime Ripard
Quoted 50 lines · Sudip Mukherjee
Quoted 34 lines · Maxime Ripard
Quoted 32 lines · Maxime Ripard
Quoted 31 lines · Maxime Ripard
Quoted 30 lines · Sudip Mukherjee

Hi Maxime,

Quoted 26 lines · Maxime Ripard
Quoted 15 lines · Sudip Mukherjee

Hi Maxime,

Quoted 7 lines · Maxime Ripard

Hi Sudip,

Quoted 2 lines · Sudip Mukherjee

Hi All,

<snip>

Quoted 2 lines
Quoted 2 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

You can see the complete dmesg at
https://openqa.qa.codethink.co.uk/tests/76#step/dmesg/8

What test were you running?

Nothing particular, its just a boot test that we do every night after pulling from torvalds/linux.git

What are you booting to then?

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

I am not sure I understood the question.
Its an Ubuntu image. The desktop environment is gnome. And as mentioned earlier, we use the HEAD of linus tree every night to boot the rpi4 and test that we can login via desktop environment and that there is no regression in dmesg.

Looking at the CI, this isn't from a RPi but from qemu?

No, this is from rpi4 board (4GB), not qemu. The CI is a little complicated here, lava boots the board with the new kernel and will then trigger the openQA job. openQA will then connect to the board using vnc to test the desktop. This is the last link that I sent to Linus when he asked for it.
https://lava.qa.codethink.co.uk/scheduler/job/164#L1356

Quoted 4 lines
Quoted 2 lines

And this is the lava job for today -
https://lava.qa.codethink.co.uk/scheduler/job/173

Is it connected to a monitor then?

Missed replying to this one earlier. I have a hdmi lilliput monitor connected to it.

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

What defconfig are you using? How did you generate the Ubuntu image? Through debootstrap? Any additional package?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Its the default ubuntu config. I can send you the config if you want.

Yes, please.

Attached.
My build script will copy this config as .config, do olddefconfig and then build.

I still can't reproduce it.

What other customisations did you do to that image? It looks like there's some customs scripts in there (test-mainline.sh), what are they doing?

Maxime

#12 lore raw
Quoted 76 lines · Maxime Ripard
Quoted 66 lines · Sudip Mukherjee
Quoted 52 lines · Maxime Ripard
Quoted 50 lines · Sudip Mukherjee
Quoted 34 lines · Maxime Ripard
Quoted 32 lines · Maxime Ripard
Quoted 31 lines · Maxime Ripard
Quoted 30 lines · Sudip Mukherjee

Hi Maxime,

Quoted 26 lines · Maxime Ripard
Quoted 15 lines · Sudip Mukherjee

Hi Maxime,

Quoted 7 lines · Maxime Ripard

Hi Sudip,

Quoted 2 lines · Sudip Mukherjee

Hi All,

<snip>

Quoted 2 lines
Quoted 2 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

You can see the complete dmesg at
https://openqa.qa.codethink.co.uk/tests/76#step/dmesg/8

What test were you running?

Nothing particular, its just a boot test that we do every night after pulling from torvalds/linux.git

What are you booting to then?

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

I am not sure I understood the question.
Its an Ubuntu image. The desktop environment is gnome. And as mentioned earlier, we use the HEAD of linus tree every night to boot the rpi4 and test that we can login via desktop environment and that there is no regression in dmesg.

Looking at the CI, this isn't from a RPi but from qemu?

No, this is from rpi4 board (4GB), not qemu. The CI is a little complicated here, lava boots the board with the new kernel and will then trigger the openQA job. openQA will then connect to the board using vnc to test the desktop. This is the last link that I sent to Linus when he asked for it.
https://lava.qa.codethink.co.uk/scheduler/job/164#L1356

Quoted 4 lines
Quoted 2 lines

And this is the lava job for today -
https://lava.qa.codethink.co.uk/scheduler/job/173

Is it connected to a monitor then?

Missed replying to this one earlier. I have a hdmi lilliput monitor connected to it.

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

What defconfig are you using? How did you generate the Ubuntu image? Through debootstrap? Any additional package?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Its the default ubuntu config. I can send you the config if you want.

Yes, please.

Attached.
My build script will copy this config as .config, do olddefconfig and then build.

Quoted 5 lines

I still can't reproduce it.

What other customisations did you do to that image? It looks like there's some customs scripts in there (test-mainline.sh), what are they doing?

That test script is triggering the openqa job, but its running only after lava is able to login. The trace is appearing before the login prompt even, so test_mainline.sh should not matter here. The only customization done to the default ubuntu image is the initrd. Can you please try with the initrd from
https://elisa-builder-00.iol.unh.edu/kernel/mainline/rpi4/initrd.gz..
I will check with another board also.

Signature · 2 lines
Regards
Sudip
#13 lore raw
Quoted 83 lines · Sudip Mukherjee
Quoted 76 lines · Maxime Ripard
Quoted 66 lines · Sudip Mukherjee
Quoted 52 lines · Maxime Ripard
Quoted 50 lines · Sudip Mukherjee
Quoted 34 lines · Maxime Ripard
Quoted 32 lines · Maxime Ripard
Quoted 31 lines · Maxime Ripard
Quoted 30 lines · Sudip Mukherjee

Hi Maxime,

Quoted 26 lines · Maxime Ripard
Quoted 15 lines · Sudip Mukherjee

Hi Maxime,

Quoted 7 lines · Maxime Ripard

Hi Sudip,

Quoted 2 lines · Sudip Mukherjee

Hi All,

<snip>

Quoted 2 lines
Quoted 2 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

You can see the complete dmesg at
https://openqa.qa.codethink.co.uk/tests/76#step/dmesg/8

What test were you running?

Nothing particular, its just a boot test that we do every night after pulling from torvalds/linux.git

What are you booting to then?

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

I am not sure I understood the question.
Its an Ubuntu image. The desktop environment is gnome. And as mentioned earlier, we use the HEAD of linus tree every night to boot the rpi4 and test that we can login via desktop environment and that there is no regression in dmesg.

Looking at the CI, this isn't from a RPi but from qemu?

No, this is from rpi4 board (4GB), not qemu. The CI is a little complicated here, lava boots the board with the new kernel and will then trigger the openQA job. openQA will then connect to the board using vnc to test the desktop. This is the last link that I sent to Linus when he asked for it.
https://lava.qa.codethink.co.uk/scheduler/job/164#L1356

Quoted 4 lines
Quoted 2 lines

And this is the lava job for today -
https://lava.qa.codethink.co.uk/scheduler/job/173

Is it connected to a monitor then?

Missed replying to this one earlier. I have a hdmi lilliput monitor connected to it.

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

What defconfig are you using? How did you generate the Ubuntu image? Through debootstrap? Any additional package?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Its the default ubuntu config. I can send you the config if you want.

Yes, please.

Attached.
My build script will copy this config as .config, do olddefconfig and then build.

Quoted 5 lines

I still can't reproduce it.

What other customisations did you do to that image? It looks like there's some customs scripts in there (test-mainline.sh), what are they doing?

Quoted 7 lines

That test script is triggering the openqa job, but its running only after lava is able to login. The trace is appearing before the login prompt even, so test_mainline.sh should not matter here. The only customization done to the default ubuntu image is the initrd. Can you please try with the initrd from
https://elisa-builder-00.iol.unh.edu/kernel/mainline/rpi4/initrd.gz..
I will check with another board also.

Still works fine (and it required some mangling of the kernel command line).

If we summarize:

- You initially just dumped a panic and a link to your QA, without any more context:

- Then stating that you're not doing any test, really;

- Well, except for booting Ubuntu, but no other modification

- But you're not booting the standard image

- And with a custom initrd

- And that QA link states that you're booting from QEMU, but you're not.

Please provide a full documentation on what you're doing to generate that image, from scratch, in order to get that panic you reported previously.

I've spent an entire day trying to make sense of what you're doing exactly to get into that situation. I have other things to work on and I don't plan on figuring out any random CI system.

Maxime

#14 lore raw
Quoted 4 lines · Maxime Ripard
Quoted 2 lines · Sudip Mukherjee
Quoted 1 line · Maxime Ripard

<snip>

Quoted 7 lines

Still works fine (and it required some mangling of the kernel command line).

If we summarize:

- You initially just dumped a panic and a link to your QA, without any more context:

The SHA was also given, and I didn't know what else you would need. The openQA link was given to show the dmesg.

Quoted 2 lines

- Then stating that you're not doing any test, really;

Yes, and I still say that, its just a boot test.

Quoted 6 lines

- Well, except for booting Ubuntu, but no other modification

- But you're not booting the standard image

- And with a custom initrd

yes, something which has always worked in boot-testing LTS kernel or mainline kernel.

Quoted 3 lines

- And that QA link states that you're booting from QEMU, but you're not.

I only found that the "WORKER_CLASS" has the name "qemu_rpi4", that is a name which I choose to give as that worker laptop is connected to rpi4 and also running qemu tests. If you want I can change the name of the WORKER_CLASS. :)
iiuc, dmesg shows if its booting in a qemu or on a real hardware.

Quoted 4 lines

Please provide a full documentation on what you're doing to generate that image, from scratch, in order to get that panic you reported previously.

I have now ordered another rpi4 board and will create the image from scratch and give you the steps.

Quoted 4 lines

I've spent an entire day trying to make sense of what you're doing exactly to get into that situation. I have other things to work on and I don't plan on figuring out any random CI system.

I am not really sure why you are trying to figure out a random CI system. I can reproduce the problem in our setup everytime I test with that reverted commit and I have already said I am happy to test with a debug patch or anything else.

Signature · 2 lines
Regards
Sudip
#15 lore raw
In reply to Sudip Mukherjee
Quoted 4 lines · Sudip Mukherjee

That test script is triggering the openqa job, but its running only after lava is able to login. The trace is appearing before the login prompt even, so test_mainline.sh should not matter here.

Side note: the traces might be more legible if you have debug info in the kernel, and run the dmesg through the script in

scripts/decode_stacktrace.sh

which should give line numbers and inlining information.

That often makes it much easier to see which access it is that hits a NULL pointer dereference.

On x86-64, generally just decode the instruction stream, and look at the instruction patterns and try to figure out where an oops is coming from, but that's much less useful on arm64 (partly because I'm not as used to it, but because the arm64 oopses don't print out much of the instructions so there's often little to go by).

Linus

#16 lore raw
Quoted 8 lines · Linus Torvalds
Quoted 4 lines · Sudip Mukherjee

That test script is triggering the openqa job, but its running only after lava is able to login. The trace is appearing before the login prompt even, so test_mainline.sh should not matter here.

Quoted 6 lines

Side note: the traces might be more legible if you have debug info in the kernel, and run the dmesg through the script in

scripts/decode_stacktrace.sh

which should give line numbers and inlining information.

Attached is a complete dmesg and also the decoded trace. This is done on 4357f03d6611 ("Merge tag 'pm-5.15-rc2' of
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm")

Signature · 2 lines
Regards
Sudip
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]
[    0.000000] Linux version 5.15.0-rc1-4357f03d6611 (smukherjee@db7e030c489f) (aarch64-linux-gcc (GCC) 11.2.1 20210911, GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Wed Sep 22 15:18:16 UTC 2021
[    0.000000] Machine model: Raspberry Pi 4 Model B
[    0.000000] efi: UEFI not found.
[    0.000000] Reserved memory: created CMA memory pool at 0x0000000032800000, size 64 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000000000-0x000000003fffffff]
[    0.000000]   DMA32    [mem 0x0000000040000000-0x00000000fbffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000003b3fffff]
[    0.000000]   node   0: [mem 0x0000000040000000-0x00000000fbffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x00000000fbffffff]
[    0.000000] percpu: Embedded 29 pages/cpu s80344 r8192 d30248 u118784
[    0.000000] pcpu-alloc: s80344 r8192 d30248 u118784 alloc=29*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Detected PIPT I-cache on CPU0
[    0.000000] CPU features: detected: Spectre-v2
[    0.000000] CPU features: detected: Spectre-v3a
[    0.000000] CPU features: detected: Spectre-v4
[    0.000000] CPU features: detected: ARM errata 1165522, 1319367, or 1530923
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 996912
[    0.000000] Kernel command line: console=ttyS0,115200n8 root=/dev/ram0 coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=0 bcm2708_fb.fbheight=0 bcm2708_fb.fbswap=1 smsc95xx.macaddr=DC:A6:32:BC:4B:41 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 root=LABEL=writable1 rootfstype=ext4 elevator=deadline rootwait fixrtc loglevel=7 ip=dhcp
[    0.000000] Kernel parameter elevator= does not have any effect anymore.
               Please use sysfs to set IO scheduler for individual devices.
[    0.000000] Unknown command line parameters: fixrtc
[    0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
[    0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] software IO TLB: mapped [mem 0x000000002e800000-0x0000000032800000] (64MB)
[    0.000000] Memory: 3742168K/4050944K available (12928K kernel code, 1960K rwdata, 4868K rodata, 4352K init, 843K bss, 243240K reserved, 65536K cma-reserved)
[    0.000000] random: get_random_u64 called from __kmem_cache_create+0x38/0x4e0 with crng_init=0
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 40527 entries in 159 pages
[    0.000000] ftrace: allocated 159 pages with 6 groups
[    0.000000] trace event string verifier disabled
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
[    0.000000] 	Trampoline variant of Tasks RCU enabled.
[    0.000000] 	Rude variant of Tasks RCU enabled.
[    0.000000] 	Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] Root IRQ handler: gic_handle_irq
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] irq_brcmstb_l2: registered L2 intc (/soc/interrupt-controller@7ef00100, parent irq: 10)
[    0.000000] arch_timer: cp15 timer(s) running at 54.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xc743ce346, max_idle_ns: 440795203123 ns
[    0.000001] sched_clock: 56 bits at 54MHz, resolution 18ns, wraps every 4398046511102ns
[    0.000189] Console: colour dummy device 80x25
[    0.000266] Calibrating delay loop (skipped), value calculated using timer frequency.. 108.00 BogoMIPS (lpj=216000)
[    0.000294] pid_max: default: 32768 minimum: 301
[    0.000485] LSM: Security Framework initializing
[    0.000549] Yama: becoming mindful.
[    0.000663] AppArmor: AppArmor initialized
[    0.000862] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.000932] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.003978] rcu: Hierarchical SRCU implementation.
[    0.005401] EFI services will not be available.
[    0.006275] smp: Bringing up secondary CPUs ...
[    0.007352] Detected PIPT I-cache on CPU1
[    0.007421] CPU1: Booted secondary processor 0x0000000001 [0x410fd083]
[    0.008690] Detected PIPT I-cache on CPU2
[    0.008738] CPU2: Booted secondary processor 0x0000000002 [0x410fd083]
[    0.009888] Detected PIPT I-cache on CPU3
[    0.009936] CPU3: Booted secondary processor 0x0000000003 [0x410fd083]
[    0.010094] smp: Brought up 1 node, 4 CPUs
[    0.010141] SMP: Total of 4 processors activated.
[    0.010156] CPU features: detected: 32-bit EL0 Support
[    0.010169] CPU features: detected: 32-bit EL1 Support
[    0.010186] CPU features: detected: CRC32 instructions
[    0.010360] CPU features: emulated: Privileged Access Never (PAN) using TTBR0_EL1 switching
[    0.039406] CPU: All CPU(s) started at EL2
[    0.039488] alternatives: patching kernel code
[    0.041223] devtmpfs: initialized
[    0.048114] Registered cp15_barrier emulation handler
[    0.048155] Registered setend emulation handler
[    0.048177] KASLR disabled due to lack of seed
[    0.048401] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.048436] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.050556] pinctrl core: initialized pinctrl subsystem
[    0.051252] DMI not present or invalid.
[    0.051882] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.055013] DMA: preallocated 1024 KiB GFP_KERNEL pool for atomic allocations
[    0.055312] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.056131] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.056201] audit: initializing netlink subsys (disabled)
[    0.056457] audit: type=2000 audit(0.056:1): state=initialized audit_enabled=0 res=1
[    0.057011] thermal_sys: Registered thermal governor 'fair_share'
[    0.057024] thermal_sys: Registered thermal governor 'bang_bang'
[    0.057040] thermal_sys: Registered thermal governor 'step_wise'
[    0.057054] thermal_sys: Registered thermal governor 'user_space'
[    0.057312] cpuidle: using governor ladder
[    0.057373] cpuidle: using governor menu
[    0.057708] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.057884] ASID allocator initialised with 65536 entries
[    0.058100] Serial: AMBA PL011 UART driver
[    0.118568] iommu: Default domain type: Translated 
[    0.118596] iommu: DMA domain TLB invalidation policy: strict mode 
[    0.119843] SCSI subsystem initialized
[    0.120097] libata version 3.00 loaded.
[    0.120277] usbcore: registered new interface driver usbfs
[    0.120331] usbcore: registered new interface driver hub
[    0.120401] usbcore: registered new device driver usb
[    0.120756] pps_core: LinuxPPS API ver. 1 registered
[    0.120772] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]>
[    0.120808] PTP clock support registered
[    0.121183] EDAC MC: Ver: 3.0.0
[    0.122568] NetLabel: Initializing
[    0.122588] NetLabel:  domain hash size = 128
[    0.122603] NetLabel:  protocols = UNLABELED CIPSOv4 CALIPSO
[    0.122691] NetLabel:  unlabeled traffic allowed by default
[    0.123642] clocksource: Switched to clocksource arch_sys_counter
[    0.212886] VFS: Disk quotas dquot_6.6.0
[    0.212993] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.213738] AppArmor: AppArmor Filesystem Enabled
[    0.214091] simple-framebuffer 3e843000.framebuffer: framebuffer at 0x3e843000, 0x384000 bytes
[    0.214117] simple-framebuffer 3e843000.framebuffer: format=a8r8g8b8, mode=1280x720x32, linelength=5120
[    0.224129] Console: switching to colour frame buffer device 160x45
[    0.232869] simple-framebuffer 3e843000.framebuffer: fb0: simplefb registered!
[    0.243193] NET: Registered PF_INET protocol family
[    0.243712] IP idents hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.246755] tcp_listen_portaddr_hash hash table entries: 2048 (order: 3, 32768 bytes, linear)
[    0.246812] TCP established hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.247102] TCP bind hash table entries: 32768 (order: 7, 524288 bytes, linear)
[    0.247591] TCP: Hash tables configured (established 32768 bind 32768)
[    0.248090] MPTCP token hash table entries: 4096 (order: 4, 98304 bytes, linear)
[    0.248217] UDP hash table entries: 2048 (order: 4, 65536 bytes, linear)
[    0.248278] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes, linear)
[    0.248994] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.249036] NET: Registered PF_XDP protocol family
[    0.249062] PCI: CLS 0 bytes, default 64
[    0.249369] Trying to unpack rootfs image as initramfs...
[    0.250924] hw perfevents: enabled with armv8_cortex_a72 PMU driver, 7 counters available
[    0.251114] kvm [1]: IPA Size Limit: 44 bits
[    0.252497] kvm [1]: vgic interrupt IRQ9
[    0.252947] kvm [1]: Hyp mode initialized successfully
[    0.255165] Initialise system trusted keyrings
[    0.255241] Key type blacklist registered
[    0.255522] workingset: timestamp_bits=46 max_order=20 bucket_order=0
[    0.261911] zbud: loaded
[    0.263735] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.264656] fuse: init (API version 7.34)
[    0.330459] Key type asymmetric registered
[    0.330492] Asymmetric key parser 'x509' registered
[    0.330620] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 242)
[    0.330833] io scheduler mq-deadline registered
[    0.336685] brcm-pcie fd500000.pcie: host bridge /scb/pcie@7d500000 ranges:
[    0.336731] brcm-pcie fd500000.pcie:   No bus range found for /scb/pcie@7d500000, using [bus 00-ff]
[    0.336809] brcm-pcie fd500000.pcie:      MEM 0x0600000000..0x0603ffffff -> 0x00f8000000
[    0.336884] brcm-pcie fd500000.pcie:   IB MEM 0x0000000000..0x00bfffffff -> 0x0000000000
[    0.339510] brcm-pcie fd500000.pcie: link up, 5.0 GT/s PCIe x1 (SSC)
[    0.339892] brcm-pcie fd500000.pcie: PCI host bridge to bus 0000:00
[    0.339916] pci_bus 0000:00: root bus resource [bus 00-ff]
[    0.339939] pci_bus 0000:00: root bus resource [mem 0x600000000-0x603ffffff] (bus address [0xf8000000-0xfbffffff])
[    0.340020] pci 0000:00:00.0: [14e4:2711] type 01 class 0x060400
[    0.340248] pci 0000:00:00.0: PME# supported from D0 D3hot
[    0.343158] pci 0000:01:00.0: [1106:3483] type 00 class 0x0c0330
[    0.343290] pci 0000:01:00.0: reg 0x10: [mem 0xc0000000-0xc0000fff 64bit]
[    0.343782] pci 0000:01:00.0: PME# supported from D0 D3cold
[    0.346548] pci 0000:00:00.0: BAR 14: assigned [mem 0x600000000-0x6000fffff]
[    0.346581] pci 0000:01:00.0: BAR 0: assigned [mem 0x600000000-0x600000fff 64bit]
[    0.346623] pci 0000:00:00.0: PCI bridge to [bus 01]
[    0.346647] pci 0000:00:00.0:   bridge window [mem 0x600000000-0x6000fffff]
[    0.347225] pcieport 0000:00:00.0: PME: Signaling with IRQ 63
[    0.347696] pcieport 0000:00:00.0: AER: enabled with IRQ 63
[    0.417545] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[    0.419939] printk: console [ttyS0] disabled
[    0.420064] fe215040.serial: ttyS0 at MMIO 0xfe215040 (irq = 27, base_baud = 62499999) is a 16550
[    1.478480] printk: console [ttyS0] enabled
[    1.485274] iproc-rng200 fe104000.rng: hwrng registered
[    1.491376] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    1.791731] loop: module loaded
[    1.795901] bcm2835-power bcm2835-power: Broadcom BCM2835 power domains driver
[    1.807885] libphy: Fixed MDIO Bus: probed
[    1.812559] tun: Universal TUN/TAP device driver, 1.6
[    1.818500] bcmgenet fd580000.ethernet: GENET 5.0 EPHY: 0x0000
[    1.835704] libphy: bcmgenet MII bus: probed
[    6.421505] Freeing initrd memory: 71492K
[    6.459775] unimac-mdio unimac-mdio.-19: Broadcom UniMAC MDIO bus
[    6.466867] PPP generic driver version 2.4.2
[    6.471487] usbcore: registered new interface driver lan78xx
[    6.477308] usbcore: registered new interface driver smsc95xx
[    6.483179] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    6.489836] ehci-pci: EHCI PCI platform driver
[    6.494414] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    6.500715] ohci-pci: OHCI PCI platform driver
[    6.505276] uhci_hcd: USB Universal Host Controller Interface driver
[    6.512127] mousedev: PS/2 mouse device common for all mice
[    6.518336] i2c_dev: i2c /dev entries driver
[    6.527829] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[    6.534368] device-mapper: core: CONFIG_IMA_DISABLE_HTABLE is disabled. Duplicate IMA measurements will not be recorded in the IMA log.
[    6.546884] device-mapper: uevent: version 1.0.3
[    6.551867] device-mapper: ioctl: 4.45.0-ioctl (2021-03-22) initialised: [email protected]
[    6.561307] sdhci: Secure Digital Host Controller Interface driver
[    6.567596] sdhci: Copyright(c) Pierre Ossman
[    6.572026] sdhci-pltfm: SDHCI platform and OF driver helper
[    6.579164] ledtrig-cpu: registered to indicate activity on CPUs
[    6.585835] hid: raw HID events driver (C) Jiri Kosina
[    6.591999] bcm2835-mbox fe00b880.mailbox: mailbox enabled
[    6.598427] drop_monitor: Initializing network drop monitor service
[    6.605570] NET: Registered PF_INET6 protocol family
[    6.654195] Segment Routing with IPv6
[    6.657959] RPL Segment Routing with IPv6
[    6.662108] In-situ OAM (IOAM) with IPv6
[    6.666207] NET: Registered PF_PACKET protocol family
[    6.671580] Key type dns_resolver registered
[    6.677026] registered taskstats version 1
[    6.681291] Loading compiled-in X.509 certificates
[    6.686443] zswap: loaded using pool lzo/zbud
[    6.691484] Key type ._fscrypt registered
[    6.695584] Key type .fscrypt registered
[    6.699577] Key type fscrypt-provisioning registered
[    6.717170] cryptd: max_cpu_qlen set to 1000
[    6.740554] Key type encrypted registered
[    6.744700] AppArmor: AppArmor sha1 policy hashing enabled
[    6.750320] ima: No TPM chip found, activating TPM-bypass!
[    6.755932] ima: Allocated hash algorithm: sha1
[    6.760579] ima: No architecture policies found
[    6.765282] evm: Initialising EVM extended attributes:
[    6.770512] evm: security.selinux
[    6.773888] evm: security.SMACK64
[    6.777263] evm: security.SMACK64EXEC
[    6.780990] evm: security.SMACK64TRANSMUTE
[    6.785157] evm: security.SMACK64MMAP
[    6.788883] evm: security.apparmor
[    6.792345] evm: security.ima
[    6.795357] evm: security.capability
[    6.798994] evm: HMAC attrs: 0x1
[    6.809956] fe201000.serial: ttyAMA0 at MMIO 0xfe201000 (irq = 25, base_baud = 0) is a PL011 rev2
[    6.819297] serial serial0: tty port ttyAMA0 registered
[    6.830060] raspberrypi-firmware soc:firmware: Attached to firmware from 2021-02-25T12:10:40
[    7.040443] sdhci-iproc fe300000.mmc: allocated mmc-pwrseq
[    7.106478] mmc0: SDHCI controller on fe300000.mmc [fe300000.mmc] using PIO
[    7.149504] mmc1: SDHCI controller on fe340000.mmc [fe340000.mmc] using ADMA
[    7.159062] bcmgenet fd580000.ethernet: configuring instance for external RGMII (RX delay)
[    7.167629] random: fast init done
[    7.171242] bcmgenet fd580000.ethernet eth0: Link is Down
[    7.208025] mmc0: new high speed SDIO card at address 0001
[    7.258682] mmc1: new ultra high speed DDR50 SDHC card at address aaaa
[    7.265805] mmcblk1: mmc1:aaaa SL32G 29.7 GiB 
[    7.275988]  mmcblk1: p1 p2
[   11.267944] bcmgenet fd580000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   11.276314] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   11.291637] Sending DHCP requests ., OK
[   12.307705] IP-Config: Got DHCP answer from 172.16.103.252, my address is 172.16.100.82
[   12.315873] IP-Config: Complete:
[   12.319152]      device=eth0, hwaddr=dc:a6:32:bc:4b:41, ipaddr=172.16.100.82, mask=255.255.252.0, gw=172.16.103.254
[   12.329747]      host=172.16.100.82, domain=guest.codethink.co.uk, nis-domain=(none)
[   12.337603]      bootserver=0.0.0.0, rootserver=0.0.0.0, rootpath=
[   12.337609]      nameserver0=172.16.103.254
[   12.374261] Freeing unused kernel memory: 4352K
[   12.408414] Checked W+X mappings: passed, no W+X pages found
[   12.414199] Run /init as init process
[   12.417933]   with arguments:
[   12.417939]     /init
[   12.417943]     fixrtc
[   12.417948]   with environment:
[   12.417952]     HOME=/
[   12.417956]     TERM=linux
[   13.077872] usb_phy_generic phy: supply vcc not found, using dummy regulator
[   13.156717] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.
[   13.168329] mc: Linux media interface: v0.10
[   13.174302] xhci_hcd 0000:01:00.0: xHCI Host Controller
[   13.179751] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 1
[   13.180087] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops [vc4])
[   13.187903] xhci_hcd 0000:01:00.0: hcc params 0x002841eb hci version 0x100 quirks 0x0000000000000890
[   13.199194] videodev: Linux video capture interface: v2.00
[   13.203750] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
[   13.217083] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   13.224677] usb usb1: Product: xHCI Host Controller
[   13.229710] usb usb1: Manufacturer: Linux 5.15.0-rc1-4357f03d6611 xhci-hcd
[   13.237174] usb usb1: SerialNumber: 0000:01:00.0
[   13.242585] hub 1-0:1.0: USB hub found
[   13.244736] brcmstb-i2c fef04500.i2c:  @97500hz registered in polling mode
[   13.246501] hub 1-0:1.0: 1 port detected
[   13.257693] brcmstb-i2c fef09500.i2c:  @97500hz registered in polling mode
[   13.259208] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops [vc4])
[   13.265249] xhci_hcd 0000:01:00.0: xHCI Host Controller
[   13.275392] Registered IR keymap rc-cec
[   13.276773] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 2
[   13.280532] rc rc0: vc4 as /devices/platform/soc/fef00700.hdmi/rc/rc0
[   13.284615] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   13.288647] xhci_hcd 0000:01:00.0: Host supports USB 3.0 SuperSpeed
[   13.295541] input: vc4 as /devices/platform/soc/fef00700.hdmi/rc/rc0/input0
[   13.295874] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   13.296002] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[   13.296014] cfg80211: failed to load regulatory.db
[   13.302865] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.15
[   13.317208] dwc2 fe980000.usb: supply vusb_d not found, using dummy regulator
[   13.323165] bcm2835_audio bcm2835_audio: card created with 8 channels
[   13.334068] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   13.339180] dwc2 fe980000.usb: supply vusb_a not found, using dummy regulator
[   13.344894] usb usb2: Product: xHCI Host Controller
[   13.359741] Bluetooth: Core ver 2.22
[   13.365896] usb usb2: Manufacturer: Linux 5.15.0-rc1-4357f03d6611 xhci-hcd
[   13.374666] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[   13.378168] usb usb2: SerialNumber: 0000:01:00.0
[   13.381152] hub 2-0:1.0: USB hub found
[   13.392258] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
[   13.405907] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops [vc4])
[   13.409933] brcmfmac: F1 signature read @0x18000000=0x15264345
[   13.421398] hub 2-0:1.0: 4 ports detected
[   13.425779] NET: Registered PF_BLUETOOTH protocol family
[   13.432676] Registered IR keymap rc-cec
[   13.438308] rc rc0: vc4 as /devices/platform/soc/fef00700.hdmi/rc/rc0
[   13.445042] input: vc4 as /devices/platform/soc/fef00700.hdmi/rc/rc0/input1
[   13.462296] dwc2 fe980000.usb: EPs: 8, dedicated fifos, 4080 entries in SPRAM
[   13.479667] Bluetooth: HCI device and connection manager initialized
[   13.494692] Bluetooth: HCI socket layer initialized
[   13.506187] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops [vc4])
[   13.521013] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[   13.522139] Registered IR keymap rc-cec
[   13.527049] Bluetooth: L2CAP socket layer initialized
[   13.527096] Bluetooth: SCO socket layer initialized
[   13.527671] usb 1-1: new high-speed USB device number 2 using xhci_hcd
[   13.570398] brcmfmac mmc0:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.bin failed with error -2
[   13.573791] rc rc0: vc4 as /devices/platform/soc/fef00700.hdmi/rc/rc0
[   13.582446] brcmfmac mmc0:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.bin failed with error -2
[   13.594277] usbcore: registered new interface driver brcmfmac
[   13.605176] input: vc4 as /devices/platform/soc/fef00700.hdmi/rc/rc0/input2
[   13.634737] Bluetooth: HCI UART driver ver 2.3
[   13.659691] Bluetooth: HCI UART protocol H4 registered
[   13.678347] usb 1-1: New USB device found, idVendor=2109, idProduct=3431, bcdDevice= 4.21
[   13.687105] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[   13.696507] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops [vc4])
[   13.697127] usb 1-1: Product: USB2.0 Hub
[   13.714108] hub 1-1:1.0: USB hub found
[   13.718360] Registered IR keymap rc-cec
[   13.719260] hub 1-1:1.0: 4 ports detected
[   13.722454] rc rc0: vc4 as /devices/platform/soc/fef00700.hdmi/rc/rc0
[   13.735321] Bluetooth: HCI UART protocol BCSP registered
[   13.735473] input: vc4 as /devices/platform/soc/fef00700.hdmi/rc/rc0/input3
[   13.778237] Bluetooth: HCI UART protocol LL registered
[   13.783675] Bluetooth: HCI UART protocol ATH3K registered
[   13.808030] usb 2-1: new SuperSpeed USB device number 2 using xhci_hcd
[   13.819837] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   13.830762] Bluetooth: HCI UART protocol Intel registered
[   13.841137] usb 2-1: New USB device found, idVendor=0781, idProduct=5581, bcdDevice= 1.00
[   13.842705] Bluetooth: HCI UART protocol Broadcom registered
[   13.849766] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   13.852871] hci_uart_bcm serial0-0: supply vbat not found, using dummy regulator
[   13.853018] hci_uart_bcm serial0-0: supply vddio not found, using dummy regulator
[   13.856232] Bluetooth: HCI UART protocol QCA registered
[   13.862712] usb 2-1: Product:  SanDisk 3.2Gen1
[   13.870351] Bluetooth: HCI UART protocol AG6XX registered
[   13.881668] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops [vc4])
[   13.883178] usb 2-1: Manufacturer:  USB
[   13.884785] Bluetooth: HCI UART protocol Marvell registered
[   13.900730] Registered IR keymap rc-cec
[   13.905216] usb 2-1: SerialNumber: 03003015122520104943
[   13.909264] rc rc0: vc4 as /devices/platform/soc/fef00700.hdmi/rc/rc0
[   13.926997] input: vc4 as /devices/platform/soc/fef00700.hdmi/rc/rc0/input4
[   13.976371] uart-pl011 fe201000.serial: no DMA platform data
[   14.006091] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops [vc4])
[   14.021620] Registered IR keymap rc-cec
[   14.023676] usb 1-1.4: new low-speed USB device number 3 using xhci_hcd
[   14.025768] rc rc0: vc4 as /devices/platform/soc/fef00700.hdmi/rc/rc0
[   14.042892] input: vc4 as /devices/platform/soc/fef00700.hdmi/rc/rc0/input5
[   14.110295] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops [vc4])
[   14.123088] Registered IR keymap rc-cec
[   14.127354] rc rc0: vc4 as /devices/platform/soc/fef00700.hdmi/rc/rc0
[   14.136658] input: vc4 as /devices/platform/soc/fef00700.hdmi/rc/rc0/input6
[   14.156238] usb 1-1.4: New USB device found, idVendor=046d, idProduct=c077, bcdDevice=72.00
[   14.165036] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   14.173555] usb 1-1.4: Product: USB Optical Mouse
[   14.179052] usb 1-1.4: Manufacturer: Logitech
[   14.190227] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops [vc4])
[   14.211735] Registered IR keymap rc-cec
[   14.215875] rc rc0: vc4 as /devices/platform/soc/fef00700.hdmi/rc/rc0
[   14.220507] Bluetooth: hci0: BCM: chip id 107
[   14.225033] input: vc4 as /devices/platform/soc/fef00700.hdmi/rc/rc0/input7
[   14.227315] Bluetooth: hci0: BCM: features 0x2f
[   14.240275] Bluetooth: hci0: BCM4345C0
[   14.244160] Bluetooth: hci0: BCM4345C0 (003.001.025) build 0000
[   14.250358] Bluetooth: hci0: BCM: firmware Patch file not found, tried:
[   14.257116] Bluetooth: hci0: BCM: 'brcm/BCM4345C0.hcd'
[   14.262423] Bluetooth: hci0: BCM: 'brcm/BCM.hcd'
[   14.595816] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops [vc4])
[   14.607713] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
[   14.609791] Registered IR keymap rc-cec
[   14.620059] usb-storage 2-1:1.0: USB Mass Storage device detected
[   14.620616] rc rc0: vc4 as /devices/platform/soc/fef00700.hdmi/rc/rc0
[   14.632960] input: vc4 as /devices/platform/soc/fef00700.hdmi/rc/rc0/input8
[   14.641280] scsi host0: usb-storage 2-1:1.0
[   14.642499] vc4-drm gpu: bound fef00700.hdmi (ops vc4_hdmi_ops [vc4])
[   14.646307] usbcore: registered new interface driver usb-storage
[   14.652668] usbcore: registered new interface driver usbhid
[   14.664163] usbhid: USB HID core driver
[   14.664493] Registered IR keymap rc-cec
[   14.664593] usbcore: registered new interface driver uas
[   14.677582] rc rc1: vc4 as /devices/platform/soc/fef05700.hdmi/rc/rc1
[   14.677996] input: Logitech USB Optical Mouse as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.0/0003:046D:C077.0001/input/input10
[   14.684226] input: vc4 as /devices/platform/soc/fef05700.hdmi/rc/rc1/input9
[   14.700798] hid-generic 0003:046D:C077.0001: input,hidraw0: USB HID v1.11 Mouse [Logitech USB Optical Mouse] on usb-0000:01:00.0-1.4/input0
[   14.721601] vc4-drm gpu: bound fef05700.hdmi (ops vc4_hdmi_ops [vc4])
[   14.728409] vc4-drm gpu: bound fe004000.txp (ops vc4_txp_ops [vc4])
[   14.734977] vc4-drm gpu: bound fe206000.pixelvalve (ops vc4_crtc_ops [vc4])
[   14.742367] vc4-drm gpu: bound fe207000.pixelvalve (ops vc4_crtc_ops [vc4])
[   14.749663] vc4-drm gpu: bound fe20a000.pixelvalve (ops vc4_crtc_ops [vc4])
[   14.756901] vc4-drm gpu: bound fe216000.pixelvalve (ops vc4_crtc_ops [vc4])
[   14.764212] checking generic (3e843000 384000) vs hw (0 ffffffffffffffff)
[   14.764220] fb0: switching to vc4 from simple
[   14.768864] Console: switching to colour dummy device 80x25
[   14.796714] [drm] Initialized vc4 0.0.0 20140616 for gpu on minor 0
[   14.879293] Console: switching to colour frame buffer device 160x45
[   14.902964] vc4-drm gpu: [drm] fb0: vc4 frame buffer device
[   15.652547] scsi 0:0:0:0: Direct-Access      USB      SanDisk 3.2Gen1 1.00 PQ: 0 ANSI: 6
[   15.661871] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   15.667682] sd 0:0:0:0: [sda] 30031250 512-byte logical blocks: (15.4 GB/14.3 GiB)
[   15.676590] sd 0:0:0:0: [sda] Write Protect is off
[   15.681473] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[   15.682060] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[   15.726843]  sda: sda1 sda2
[   15.733192] sd 0:0:0:0: [sda] Attached SCSI removable disk
[   16.059643] raid6: neonx8   gen()  3316 MB/s
[   16.131635] raid6: neonx8   xor()  2613 MB/s
[   16.203640] raid6: neonx4   gen()  4048 MB/s
[   16.275639] raid6: neonx4   xor()  2726 MB/s
[   16.347642] raid6: neonx2   gen()  3534 MB/s
[   16.419635] raid6: neonx2   xor()  2540 MB/s
[   16.491637] raid6: neonx1   gen()  2726 MB/s
[   16.559640] raid6: neonx1   xor()  2073 MB/s
[   16.631645] raid6: int64x8  gen()  2427 MB/s
[   16.703642] raid6: int64x8  xor()  1387 MB/s
[   16.775647] raid6: int64x4  gen()  2569 MB/s
[   16.847641] raid6: int64x4  xor()  1429 MB/s
[   16.919639] raid6: int64x2  gen()  2393 MB/s
[   16.991642] raid6: int64x2  xor()  1272 MB/s
[   17.063636] raid6: int64x1  gen()  1826 MB/s
[   17.135637] raid6: int64x1  xor()   947 MB/s
[   17.139972] raid6: using algorithm neonx4 gen() 4048 MB/s
[   17.145447] raid6: .... xor() 2726 MB/s, rmw enabled
[   17.150493] raid6: using neon recovery algorithm
[   17.156307] xor: measuring software checksum speed
[   17.162773]    8regs           :  6305 MB/sec
[   17.168602]    32regs          :  7259 MB/sec
[   17.176181]    arm64_neon      :  3128 MB/sec
[   17.180600] xor: using function: 32regs (7259 MB/sec)
[   17.186330] async_tx: api initialized (async)
[   17.331341] Btrfs loaded, crc32c=crc32c-generic, zoned=yes, fsverity=no
[   17.644079] EXT4-fs (sda2): INFO: recovery required on readonly filesystem
[   17.651181] EXT4-fs (sda2): write access will be enabled during recovery
[   18.009584] EXT4-fs (sda2): recovery complete
[   18.015896] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[   21.340468] systemd[1]: Inserted module 'autofs4'
[   21.375103] systemd[1]: systemd 247.3-3ubuntu3.4 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid)
[   21.399497] systemd[1]: Detected architecture arm64.
[   21.465160] systemd[1]: Set hostname to <kerneltest-desktop>.
[   21.849993] random: lvmconfig: uninitialized urandom read (4 bytes read)
[   22.044576] systemd[1]: /lib/systemd/system/plymouth-start.service:17: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's process lifecycle management for the service. Please update your service to use a safer KillMode=, such as 'mixed' or 'control-group'. Support for KillMode=none is deprecated and will eventually be removed.
[   22.356802] systemd[1]: Queued start job for default target Graphical Interface.
[   22.365474] random: systemd: uninitialized urandom read (16 bytes read)
[   22.426761] systemd[1]: Created slice system-modprobe.slice.
[   22.447814] random: systemd: uninitialized urandom read (16 bytes read)
[   22.461611] systemd[1]: Created slice system-serial\x2dgetty.slice.
[   22.490003] systemd[1]: Created slice system-systemd\x2dfsck.slice.
[   22.522664] systemd[1]: Created slice system-systemd\x2dgrowfs.slice.
[   22.554556] systemd[1]: Created slice User and Session Slice.
[   22.576494] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[   22.605147] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[   22.632288] systemd[1]: Reached target Remote File Systems.
[   22.655816] systemd[1]: Reached target Slices.
[   22.676235] systemd[1]: Listening on Device-mapper event daemon FIFOs.
[   22.700459] systemd[1]: Listening on LVM2 poll daemon socket.
[   22.724399] systemd[1]: Listening on Syslog Socket.
[   22.744309] systemd[1]: Listening on fsck to fsckd communication Socket.
[   22.768146] systemd[1]: Listening on initctl Compatibility Named Pipe.
[   22.792773] systemd[1]: Listening on Journal Audit Socket.
[   22.816312] systemd[1]: Listening on Journal Socket (/dev/log).
[   22.840421] systemd[1]: Listening on Journal Socket.
[   22.864702] systemd[1]: Listening on udev Control Socket.
[   22.888275] systemd[1]: Listening on udev Kernel Socket.
[   22.912301] systemd[1]: Condition check resulted in Huge Pages File System being skipped.
[   22.927383] systemd[1]: Mounting POSIX Message Queue File System...
[   22.961682] systemd[1]: Mounting Kernel Debug File System...
[   22.993578] systemd[1]: Mounting Kernel Trace File System...
[   23.029740] systemd[1]: Starting Journal Service...
[   23.048780] systemd[1]: Finished Availability of block devices.
[   23.076513] random: crng init done
[   23.078489] systemd[1]: Starting Set the console keyboard layout...
[   23.079989] random: 7 urandom warning(s) missed due to ratelimiting
[   23.115334] systemd[1]: Starting Create list of static device nodes for the current kernel...
[   23.149339] systemd[1]: Starting Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling...
[   23.184093] systemd[1]: Starting Load Kernel Module configfs...
[   23.211684] systemd[1]: Starting Load Kernel Module drm...
[   23.243905] systemd[1]: Starting Load Kernel Module fuse...
[   23.270339] systemd[1]: Condition check resulted in Set Up Additional Binary Formats being skipped.
[   23.287137] systemd[1]: Starting Load Kernel Modules...
[   23.311327] lp: driver loaded but no devices found
[   23.313250] systemd[1]: Starting Remount Root and Kernel File Systems...
[   23.329339] ppdev: user-space parallel port driver
[   23.338374] EXT4-fs (sda2): re-mounted. Opts: (null). Quota mode: none.
[   23.350722] systemd[1]: Starting Coldplug All udev Devices...
[   23.377033] systemd[1]: Starting Uncomplicated firewall...
[   23.407288] systemd[1]: Started Journal Service.
[   23.745714] Adding 1048572k swap on /swapfile.  Priority:-2 extents:3 across:5660696k FS
[   23.812625] EXT4-fs (sda2): resizing filesystem from 3688110 to 3688110 blocks
[   23.842068] systemd-journald[986]: Received client request to flush runtime journal.
[   23.867781] systemd-journald[986]: File /var/log/journal/94d1c25fd5ff400f86348b0f36fb2b44/system.journal corrupted or uncleanly shut down, renaming and replacing.
[   24.347314] loop0: detected capacity change from 0 to 8
[   24.373215] loop1: detected capacity change from 0 to 100160
[   24.414511] loop2: detected capacity change from 0 to 100152
[   24.434595] loop3: detected capacity change from 0 to 404848
[   24.452485] loop4: detected capacity change from 0 to 404624
[   24.487413] loop5: detected capacity change from 0 to 133320
[   24.511447] loop6: detected capacity change from 0 to 133552
[   24.540373] loop7: detected capacity change from 0 to 98960
[   24.577924] loop8: detected capacity change from 0 to 98864
[   24.606915] loop9: detected capacity change from 0 to 57496
[   24.630328] loop10: detected capacity change from 0 to 57496
[   34.742540] audit: type=1400 audit(1632323186.167:2): apparmor="STATUS" operation="profile_load" profile="unconfined" name="libreoffice-xpdfimport" pid=1238 comm="apparmor_parser"
[   34.746157] audit: type=1400 audit(1632323186.171:3): apparmor="STATUS" operation="profile_load" profile="unconfined" name="libreoffice-oopslash" pid=1240 comm="apparmor_parser"
[   34.758071] audit: type=1400 audit(1632323186.183:4): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/sbin/cups-browsed" pid=1241 comm="apparmor_parser"
[   34.794604] audit: type=1400 audit(1632323186.219:5): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/snapd/snap-confine" pid=1245 comm="apparmor_parser"
[   34.795052] audit: type=1400 audit(1632323186.219:6): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/snapd/snap-confine//mount-namespace-capture-helper" pid=1245 comm="apparmor_parser"
[   34.813838] audit: type=1400 audit(1632323186.239:7): apparmor="STATUS" operation="profile_load" profile="unconfined" name="libreoffice-senddoc" pid=1249 comm="apparmor_parser"
[   34.817710] audit: type=1400 audit(1632323186.243:8): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/cups/backend/cups-pdf" pid=1246 comm="apparmor_parser"
[   34.817740] audit: type=1400 audit(1632323186.243:9): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/sbin/cupsd" pid=1246 comm="apparmor_parser"
[   34.817753] audit: type=1400 audit(1632323186.243:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/sbin/cupsd//third_party" pid=1246 comm="apparmor_parser"
[   34.833667] audit: type=1400 audit(1632323186.259:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="lsb_release" pid=1251 comm="apparmor_parser"
[   37.277692] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   37.277712] Bluetooth: BNEP filters: protocol multicast
[   37.277726] Bluetooth: BNEP socket layer initialized
[   37.294532] NET: Registered PF_ALG protocol family
[   39.558433] loop11: detected capacity change from 0 to 8
[   40.736798] systemd-journald[986]: File /var/log/journal/94d1c25fd5ff400f86348b0f36fb2b44/user-1000.journal corrupted or uncleanly shut down, renaming and replacing.
[   41.248311] kauditd_printk_skb: 29 callbacks suppressed
[   41.248326] audit: type=1400 audit(1632323192.675:41): apparmor="STATUS" operation="profile_load" profile="unconfined" name="docker-default" pid=1612 comm="apparmor_parser"
[   44.332578] Unable to handle kernel access to user memory outside uaccess routines at virtual address 0000000000000348
[   44.344243] Mem abort info:
[   44.347109]   ESR = 0x96000004
[   44.350265]   EC = 0x25: DABT (current EL), IL = 32 bits
[   44.355708]   SET = 0, FnV = 0
[   44.358833]   EA = 0, S1PTW = 0
[   44.362077]   FSC = 0x04: level 0 translation fault
[   44.367061] Data abort info:
[   44.370007]   ISV = 0, ISS = 0x00000004
[   44.373925]   CM = 0, WnR = 0
[   44.376969] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000048dcf000
[   44.383584] [0000000000000348] pgd=0000000000000000, p4d=0000000000000000
[   44.390580] Internal error: Oops: 96000004 [#1] PREEMPT SMP
[   44.396238] Modules linked in: overlay algif_hash algif_skcipher af_alg bnep sch_fq_codel ppdev lp parport ip_tables x_tables autofs4 btrfs blake2b_generic zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor xor_neon raid6_pq libcrc32c raid1 raid0 multipath linear hid_generic uas usbhid usb_storage snd_soc_hdmi_codec hci_uart btsdio btqca btrtl btbcm btintel bcm2835_v4l2(C) bcm2835_mmal_vchiq(C) videobuf2_vmalloc brcmfmac brcmutil videobuf2_memops videobuf2_v4l2 crct10dif_ce dwc2 bluetooth videobuf2_common raspberrypi_hwmon cfg80211 snd_bcm2835(C) ecdh_generic i2c_brcmstb videodev udc_core ecc roles vc4 xhci_pci xhci_pci_renesas mc pwm_bcm2835 drm_kms_helper cec drm snd_soc_core ac97_bus phy_generic snd_pcm_dmaengine snd_pcm snd_timer snd uio_pdrv_genirq fb_sys_fops uio syscopyarea sysfillrect sysimgblt aes_neon_bs aes_neon_blk crypto_simd cryptd
[   44.475990] CPU: 0 PID: 1587 Comm: pulseaudio Tainted: G         C        5.15.0-rc1-4357f03d6611 #1
[   44.485252] Hardware name: Raspberry Pi 4 Model B (DT)
[   44.490456] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[   44.497513] pc : vc4_hdmi_audio_prepare+0x3c0/0xba4 [vc4]
[   44.503013] lr : vc4_hdmi_audio_prepare+0x308/0xba4 [vc4]
[   44.508501] sp : ffff800012673a60
[   44.511854] x29: ffff800012673a60 x28: ffff0000570bc400 x27: 0000000000000000
[   44.519091] x26: 0000000000000000 x25: 000000000000ac44 x24: 0000000021002003
[   44.526328] x23: ffff800012673b50 x22: 0000000000000003 x21: ffff000057fb8080
[   44.533563] x20: ffff000057fb84c8 x19: 0005833333380600 x18: 0000000000000000
[   44.540799] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[   44.548034] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000991
[   44.555269] x11: 0000000000000001 x10: 000000000001d4c0 x9 : ffff800008f66838
[   44.562506] x8 : 0000000000000031 x7 : 000000000001d4c0 x6 : 0000000000000030
[   44.569741] x5 : ffff800012673aa8 x4 : ffff800008f7ab60 x3 : 0000000010624dd3
[   44.576976] x2 : 00000000000003e8 x1 : 0000000000000000 x0 : 0000000000562200
[   44.584213] Call trace:
[   44.586684]  vc4_hdmi_audio_prepare+0x3c0/0xba4 [vc4]
[   44.591820]  hdmi_codec_prepare+0xe8/0x1b0 [snd_soc_hdmi_codec]
[   44.597821]  snd_soc_pcm_dai_prepare+0x5c/0x10c [snd_soc_core]
[   44.603780]  soc_pcm_prepare+0x5c/0x130 [snd_soc_core]
[   44.609017]  snd_pcm_prepare+0x150/0x1f0 [snd_pcm]
[   44.613891]  snd_pcm_common_ioctl+0x1644/0x1d14 [snd_pcm]
[   44.619378]  snd_pcm_ioctl+0x3c/0x5c [snd_pcm]
[   44.623895]  __arm64_sys_ioctl+0xb4/0x100
[   44.627958]  invoke_syscall+0x50/0x120
[   44.631756]  el0_svc_common.constprop.0+0x180/0x1a0
[   44.636699]  do_el0_svc+0x34/0xa0
[   44.640055]  el0_svc+0x2c/0xc0
[   44.643148]  el0t_64_sync_handler+0xa4/0x12c
[   44.647473]  el0t_64_sync+0x1a4/0x1a8
[   44.651182] Code: 52807d02 72a20c43 f9400421 9ba37c13 (f941a423) 
[   44.657358] ---[ end trace 964de1cdb7c80434 ]---
[   46.250964] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[   46.265791] Bridge firewalling registered
[   47.001727] Initializing XFRM netlink socket
[   56.341437] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[   57.062829] rfkill: input handler disabled
#17 lore raw
Quoted 5 lines · Sudip Mukherjee

Attached is a complete dmesg and also the decoded trace. This is done on 4357f03d6611 ("Merge tag 'pm-5.15-rc2' of
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm")

drivers/gpu/drm/vc4/vc4_hdmi.c:1214 is

        tmp = (u64)(mode->clock * 1000) * n;

in vc4_hdmi_set_n_cts(), which has apparently been inlined from vc4_hdmi_audio_prepare() in vc4_hdmi.c:1398.

So it looks like 'mode' is some offset off a NULL pointer.

Which looks not impossible:

  1207          struct drm_connector *connector = &vc4_hdmi->connector;
  1208          struct drm_crtc *crtc = connector->state->crtc;
  1209          const struct drm_display_mode *mode =

&crtc->state->adjusted_mode;

looks like crtc->state perhaps might be NULL.

Although it's entirely possible that it's 'crtc' itself that is NULL or one of the earlier indirection accesses.

The exact line information from the debug info is very useful and mostly correct, but at the same time should always be taken with a small pinch of salt.

Compiler optimizations means that code gets munged and moved around, and since this is the first access to 'mode', I would not be surprised if some of the calculations and accesses to get 'mode' might be moved around to it.

Linus

#18 lore raw
Quoted 18 lines · Linus Torvalds
Quoted 5 lines · Sudip Mukherjee

Attached is a complete dmesg and also the decoded trace. This is done on 4357f03d6611 ("Merge tag 'pm-5.15-rc2' of
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm")

drivers/gpu/drm/vc4/vc4_hdmi.c:1214 is

        tmp = (u64)(mode->clock * 1000) * n;

in vc4_hdmi_set_n_cts(), which has apparently been inlined from vc4_hdmi_audio_prepare() in vc4_hdmi.c:1398.

So it looks like 'mode' is some offset off a NULL pointer.

Quoted 8 lines

Which looks not impossible:

  1207          struct drm_connector *connector = &vc4_hdmi->connector;
  1208          struct drm_crtc *crtc = connector->state->crtc;
  1209          const struct drm_display_mode *mode =

&crtc->state->adjusted_mode;

looks like crtc->state perhaps might be NULL.

I added some debugs to print the addresses, and I am getting:

[   38.813809] sudip crtc 0000000000000000

This is from struct drm_crtc *crtc = connector->state->crtc;

connector and connector->state had valid addresses.

[   38.805302] sudip connector ffff000040bac578
[   38.809779] sudip state ffff000057eb5400

This is the diff of the debug I added:

drivers/gpu/drm/vc4/vc4_hdmi.c +0 -0
index 4a1115043114..2a8f06948094 100644
@@ -1205,11 +1205,20 @@ static void

vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *vc4_hdmi,
static void vc4_hdmi_set_n_cts(struct vc4_hdmi *vc4_hdmi, unsigned
int samplerate)

 {
        struct drm_connector *connector = &vc4_hdmi->connector;
-       struct drm_crtc *crtc = connector->state->crtc;
-       const struct drm_display_mode *mode = &crtc->state->adjusted_mode;
+       struct drm_crtc *crtc;
+       struct drm_display_mode *mode;
        u32 n, cts;
        u64 tmp;

+

+       pr_err("sudip connector %px\n", connector);
+       pr_err("sudip state %px\n", connector->state);
+       crtc = connector->state->crtc;
+
+       pr_err("sudip crtc %px\n", crtc);
+       pr_err("sudip state %px\n", crtc->state);
+       pr_err("state mode %px\n", &crtc->state->adjusted_mode);
+       mode = &crtc->state->adjusted_mode;
        n = 128 * samplerate / 1000;
        tmp = (u64)(mode->clock * 1000) * n;
        do_div(tmp, 128 * samplerate);
Signature · 2 lines
Regards
Sudip
#19 lore raw
Quoted 5 lines · Sudip Mukherjee

I added some debugs to print the addresses, and I am getting:

[   38.813809] sudip crtc 0000000000000000

This is from struct drm_crtc *crtc = connector->state->crtc;

Yeah, that was my personal suspicion, because while the line number implied "crtc->state" being NULL, the drm data structure documentation and other drivers both imply that "crtc" was the more likely one.

I suspect a simple

        if (!crtc)
                return;

in vc4_hdmi_set_n_cts() is at least part of the fix for this all, but I didn't check if there is possibly something else that needs to be done too.

Linus

#20 lore raw
Quoted 12 lines · Linus Torvalds
Quoted 5 lines · Sudip Mukherjee

I added some debugs to print the addresses, and I am getting:

[   38.813809] sudip crtc 0000000000000000

This is from struct drm_crtc *crtc = connector->state->crtc;

Yeah, that was my personal suspicion, because while the line number implied "crtc->state" being NULL, the drm data structure documentation and other drivers both imply that "crtc" was the more likely one.

Quoted 8 lines

I suspect a simple

        if (!crtc)
                return;

in vc4_hdmi_set_n_cts() is at least part of the fix for this all, but I didn't check if there is possibly something else that needs to be done too.

Thanks for the decode_stacktrace.sh and the follow-up

Yeah, it looks like we have several things wrong here:

* we only check that connector->state is set, and not

    connector->state->crtc indeed.

* We also check only in startup(), so at open() and not later on when the sound streaming actually start. This has been there for a while, so I guess it's never really been causing a practical issue before.

I'm still not entirely sure how we can end up in that situation though. The only case I could think of is that:

* The firmware enables the HDMI controller, then boots Linux

* The driver starts, registers its audio card. connector->state is NULL then, and if the HDMI monitor is actually an HDMI monitor (vs a DVI monitor), the VC4_HDMI_RAM_PACKET_ENABLE bit that we test in startup will be set.

* The driver will create the connector->state (through a call to drm_mode_config_reset in vc4_kms_load), connector->state isn't NULL anymore, VC4_HDMI_RAM_PACKET_ENABLE is still set.

* The driver then disables the HDMI controller (in vc4_crtc_disable_at_boot) but never clears the VC4_HDMI_RAM_PACKET_ENABLE bit.

* Pulseaudio opens the audio device, startup succeeds because both conditions we test succeed.

* However, since we either never enabled the HDMI connector (or if it was disabled at some point), connector->state->crtc is NULL and we get our NULL pointer dereference.

The Ubuntu configuration has the framebuffer emulation and the framebuffer console enabled, so it's likely to be enabled and something (X.org?) comes along and disables the connector right when pulseaudio calls prepare().

Maxime

#21 lore raw
Quoted 25 lines · Maxime Ripard
Quoted 12 lines · Linus Torvalds
Quoted 5 lines · Sudip Mukherjee

I added some debugs to print the addresses, and I am getting:

[   38.813809] sudip crtc 0000000000000000

This is from struct drm_crtc *crtc = connector->state->crtc;

Yeah, that was my personal suspicion, because while the line number implied "crtc->state" being NULL, the drm data structure documentation and other drivers both imply that "crtc" was the more likely one.

Quoted 8 lines

I suspect a simple

        if (!crtc)
                return;

in vc4_hdmi_set_n_cts() is at least part of the fix for this all, but I didn't check if there is possibly something else that needs to be done too.

Thanks for the decode_stacktrace.sh and the follow-up

Quoted 8 lines

Yeah, it looks like we have several things wrong here:

* we only check that connector->state is set, and not

    connector->state->crtc indeed.

* We also check only in startup(), so at open() and not later on when the sound streaming actually start. This has been there for a while, so I guess it's never really been causing a practical issue before.

You also have no locking, plus looking at ->state objects outside of atomic commit machinery makes no sense because you're not actually in sync with the hw state. Relevant bits need to be copied over at commit time, protected by some spinlock (and that spinlock also needs to be held over whatever other stuff you're setting to make sure we don't get a funny out-of-sync state anywhere).

Liberally sprinkling a few NULL checks here doesn't fix much at all, it only papers over design bugs in the code.
-Daniel

Quoted 31 lines

I'm still not entirely sure how we can end up in that situation though. The only case I could think of is that:

* The firmware enables the HDMI controller, then boots Linux

* The driver starts, registers its audio card. connector->state is NULL then, and if the HDMI monitor is actually an HDMI monitor (vs a DVI monitor), the VC4_HDMI_RAM_PACKET_ENABLE bit that we test in startup will be set.

* The driver will create the connector->state (through a call to drm_mode_config_reset in vc4_kms_load), connector->state isn't NULL anymore, VC4_HDMI_RAM_PACKET_ENABLE is still set.

* The driver then disables the HDMI controller (in vc4_crtc_disable_at_boot) but never clears the VC4_HDMI_RAM_PACKET_ENABLE bit.

* Pulseaudio opens the audio device, startup succeeds because both conditions we test succeed.

* However, since we either never enabled the HDMI connector (or if it was disabled at some point), connector->state->crtc is NULL and we get our NULL pointer dereference.

The Ubuntu configuration has the framebuffer emulation and the framebuffer console enabled, so it's likely to be enabled and something (X.org?) comes along and disables the connector right when pulseaudio calls prepare().

Maxime

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#22 lore raw

Hi Daniel,

Quoted 28 lines · Daniel Vetter
Quoted 27 lines · Maxime Ripard
Quoted 12 lines · Linus Torvalds
Quoted 5 lines · Sudip Mukherjee

I added some debugs to print the addresses, and I am getting:

[   38.813809] sudip crtc 0000000000000000

This is from struct drm_crtc *crtc = connector->state->crtc;

Yeah, that was my personal suspicion, because while the line number implied "crtc->state" being NULL, the drm data structure documentation and other drivers both imply that "crtc" was the more likely one.

Quoted 8 lines

I suspect a simple

        if (!crtc)
                return;

in vc4_hdmi_set_n_cts() is at least part of the fix for this all, but I didn't check if there is possibly something else that needs to be done too.

Thanks for the decode_stacktrace.sh and the follow-up

Yeah, it looks like we have several things wrong here:

Quoted 8 lines
Quoted 6 lines

* we only check that connector->state is set, and not

    connector->state->crtc indeed.

* We also check only in startup(), so at open() and not later on when the sound streaming actually start. This has been there for a while, so I guess it's never really been causing a practical issue before.

You also have no locking

Indeed. Do we just need locking to prevent a concurrent audio setup and modeset, or do you have another corner case in mind?

Also, generally, what locks should we make sure we have locked when accessing the connector and CRTC state? drm_mode_config.connection_mutex and drm_mode_config.mutex, respectively?

Quoted 6 lines

plus looking at ->state objects outside of atomic commit machinery makes no sense because you're not actually in sync with the hw state. Relevant bits need to be copied over at commit time, protected by some spinlock (and that spinlock also needs to be held over whatever other stuff you're setting to make sure we don't get a funny out-of-sync state anywhere).

If we already have a lock protecting against having both an ASoC and KMS function running, it's not clear to me what the spinlock would prevent here?

Maxime

#23 lore raw
Quoted 54 lines · Maxime Ripard

Hi Daniel,

Quoted 28 lines · Daniel Vetter
Quoted 27 lines · Maxime Ripard
Quoted 12 lines · Linus Torvalds
Quoted 5 lines · Sudip Mukherjee

I added some debugs to print the addresses, and I am getting:

[   38.813809] sudip crtc 0000000000000000

This is from struct drm_crtc *crtc = connector->state->crtc;

Yeah, that was my personal suspicion, because while the line number implied "crtc->state" being NULL, the drm data structure documentation and other drivers both imply that "crtc" was the more likely one.

Quoted 8 lines

I suspect a simple

        if (!crtc)
                return;

in vc4_hdmi_set_n_cts() is at least part of the fix for this all, but I didn't check if there is possibly something else that needs to be done too.

Thanks for the decode_stacktrace.sh and the follow-up

Yeah, it looks like we have several things wrong here:

Quoted 8 lines
Quoted 6 lines

* we only check that connector->state is set, and not

    connector->state->crtc indeed.

* We also check only in startup(), so at open() and not later on when the sound streaming actually start. This has been there for a while, so I guess it's never really been causing a practical issue before.

You also have no locking

Indeed. Do we just need locking to prevent a concurrent audio setup and modeset, or do you have another corner case in mind?

Also, generally, what locks should we make sure we have locked when accessing the connector and CRTC state? drm_mode_config.connection_mutex and drm_mode_config.mutex, respectively?

Quoted 6 lines

plus looking at ->state objects outside of atomic commit machinery makes no sense because you're not actually in sync with the hw state. Relevant bits need to be copied over at commit time, protected by some spinlock (and that spinlock also needs to be held over whatever other stuff you're setting to make sure we don't get a funny out-of-sync state anywhere).

Quoted 3 lines

If we already have a lock protecting against having both an ASoC and KMS function running, it's not clear to me what the spinlock would prevent here?

Replicating the irc chat here. With

commit 6c5ed5ae353cdf156f9ac4db17e15db56b4de880

Author: Maarten Lankhorst <[email protected]>
Date:   Thu Apr 6 20:55:20 2017 +0200

drm/atomic: Acquire connection_mutex lock in drm_helper_probe_single_connector_modes, v4.

this is already taken care of for drivers and should be all good from a locking pov.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#24 lore raw
Quoted 61 lines · Daniel Vetter
Quoted 54 lines · Maxime Ripard

Hi Daniel,

Quoted 28 lines · Daniel Vetter
Quoted 27 lines · Maxime Ripard
Quoted 12 lines · Linus Torvalds
Quoted 5 lines · Sudip Mukherjee

I added some debugs to print the addresses, and I am getting:

[   38.813809] sudip crtc 0000000000000000

This is from struct drm_crtc *crtc = connector->state->crtc;

Yeah, that was my personal suspicion, because while the line number implied "crtc->state" being NULL, the drm data structure documentation and other drivers both imply that "crtc" was the more likely one.

Quoted 8 lines

I suspect a simple

        if (!crtc)
                return;

in vc4_hdmi_set_n_cts() is at least part of the fix for this all, but I didn't check if there is possibly something else that needs to be done too.

Thanks for the decode_stacktrace.sh and the follow-up

Yeah, it looks like we have several things wrong here:

Quoted 8 lines
Quoted 6 lines

* we only check that connector->state is set, and not

    connector->state->crtc indeed.

* We also check only in startup(), so at open() and not later on when the sound streaming actually start. This has been there for a while, so I guess it's never really been causing a practical issue before.

You also have no locking

Indeed. Do we just need locking to prevent a concurrent audio setup and modeset, or do you have another corner case in mind?

Also, generally, what locks should we make sure we have locked when accessing the connector and CRTC state? drm_mode_config.connection_mutex and drm_mode_config.mutex, respectively?

Quoted 6 lines

plus looking at ->state objects outside of atomic commit machinery makes no sense because you're not actually in sync with the hw state. Relevant bits need to be copied over at commit time, protected by some spinlock (and that spinlock also needs to be held over whatever other stuff you're setting to make sure we don't get a funny out-of-sync state anywhere).

Quoted 3 lines

If we already have a lock protecting against having both an ASoC and KMS function running, it's not clear to me what the spinlock would prevent here?

Replicating the irc chat here. With

Quoted 8 lines

commit 6c5ed5ae353cdf156f9ac4db17e15db56b4de880

Author: Maarten Lankhorst <[email protected]>
Date:   Thu Apr 6 20:55:20 2017 +0200

drm/atomic: Acquire connection_mutex lock in drm_helper_probe_single_connector_modes, v4.

this is already taken care of for drivers and should be all good from a locking pov.

So, if I understand this properly, this superseeds your comment on the spinlock for the hw state, but not the comment that we need some locking to synchronize between the audio and KMS path (and CEC?). Right?

Maxime

#25 lore raw
Quoted 66 lines · Maxime Ripard
Quoted 65 lines · Daniel Vetter
Quoted 54 lines · Maxime Ripard

Hi Daniel,

Quoted 28 lines · Daniel Vetter
Quoted 27 lines · Maxime Ripard
Quoted 12 lines · Linus Torvalds
Quoted 5 lines · Sudip Mukherjee

I added some debugs to print the addresses, and I am getting:

[   38.813809] sudip crtc 0000000000000000

This is from struct drm_crtc *crtc = connector->state->crtc;

Yeah, that was my personal suspicion, because while the line number implied "crtc->state" being NULL, the drm data structure documentation and other drivers both imply that "crtc" was the more likely one.

Quoted 8 lines

I suspect a simple

        if (!crtc)
                return;

in vc4_hdmi_set_n_cts() is at least part of the fix for this all, but I didn't check if there is possibly something else that needs to be done too.

Thanks for the decode_stacktrace.sh and the follow-up

Yeah, it looks like we have several things wrong here:

Quoted 8 lines
Quoted 6 lines

* we only check that connector->state is set, and not

    connector->state->crtc indeed.

* We also check only in startup(), so at open() and not later on when the sound streaming actually start. This has been there for a while, so I guess it's never really been causing a practical issue before.

You also have no locking

Indeed. Do we just need locking to prevent a concurrent audio setup and modeset, or do you have another corner case in mind?

Also, generally, what locks should we make sure we have locked when accessing the connector and CRTC state? drm_mode_config.connection_mutex and drm_mode_config.mutex, respectively?

Quoted 6 lines

plus looking at ->state objects outside of atomic commit machinery makes no sense because you're not actually in sync with the hw state. Relevant bits need to be copied over at commit time, protected by some spinlock (and that spinlock also needs to be held over whatever other stuff you're setting to make sure we don't get a funny out-of-sync state anywhere).

Quoted 3 lines

If we already have a lock protecting against having both an ASoC and KMS function running, it's not clear to me what the spinlock would prevent here?

Replicating the irc chat here. With

commit 6c5ed5ae353cdf156f9ac4db17e15db56b4de880

Author: Maarten Lankhorst <[email protected]>
Date:   Thu Apr 6 20:55:20 2017 +0200
Quoted 8 lines
Quoted 4 lines

drm/atomic: Acquire connection_mutex lock in drm_helper_probe_single_connector_modes, v4.

this is already taken care of for drivers and should be all good from a locking pov.

So, if I understand this properly, this superseeds your comment on the spinlock for the hw state, but not the comment that we need some locking to synchronize between the audio and KMS path (and CEC?). Right?

Other way round. There's 3 things involved here:
1. kms output probe code
2. kms atomic commit code
3. calls from asoc side

The above referenced commit makes sure 1&2 are synchronized. The problem is that 2&3 are not synchonronized, and from 3, no matter how much locking you have, you cannot look at kms state. I.e. not allowed to look at crtc->state for example, irrespective of whether you're holding drm_modeset_lock or not. This is because the atomic nonblocking commit is done without holding any locks, protection is purely down to ownership rules of state structures and ordering (through drm_crtc_commit) of in-flight nonblocking atomic commits.

That's why you need a sperate lock _and_ copy state, so taht 2&3 stay in sync.

In practice you only care about modeset changes from 2 vs anything from 3, and most userspace does modeset atomic commits as blocking commits, which means you won't notice that your locking has gaps.

btw same problem exists between atomic and (vblank) irq handler. There you need a irqsafe spinlock and you also have to copy (because the irq handler just cannot access ->state in any safe way, because it doesn't own that structure).

This is maybe a bit the confusing thing with atomic commit: ->state isn't protected by locks, but through ownership rules. Only for atomic check is ->state protected by locks, but once we're committed we switch over to ownership rules for protection. swap_states() is that point of no return.

Cheers, Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#26 lore raw

Hi,

Quoted 102 lines · Daniel Vetter
Quoted 66 lines · Maxime Ripard
Quoted 65 lines · Daniel Vetter
Quoted 54 lines · Maxime Ripard

Hi Daniel,

Quoted 28 lines · Daniel Vetter
Quoted 27 lines · Maxime Ripard
Quoted 12 lines · Linus Torvalds
Quoted 5 lines · Sudip Mukherjee

I added some debugs to print the addresses, and I am getting:

[   38.813809] sudip crtc 0000000000000000

This is from struct drm_crtc *crtc = connector->state->crtc;

Yeah, that was my personal suspicion, because while the line number implied "crtc->state" being NULL, the drm data structure documentation and other drivers both imply that "crtc" was the more likely one.

Quoted 8 lines

I suspect a simple

        if (!crtc)
                return;

in vc4_hdmi_set_n_cts() is at least part of the fix for this all, but I didn't check if there is possibly something else that needs to be done too.

Thanks for the decode_stacktrace.sh and the follow-up

Yeah, it looks like we have several things wrong here:

Quoted 8 lines
Quoted 6 lines

* we only check that connector->state is set, and not

    connector->state->crtc indeed.

* We also check only in startup(), so at open() and not later on when the sound streaming actually start. This has been there for a while, so I guess it's never really been causing a practical issue before.

You also have no locking

Indeed. Do we just need locking to prevent a concurrent audio setup and modeset, or do you have another corner case in mind?

Also, generally, what locks should we make sure we have locked when accessing the connector and CRTC state? drm_mode_config.connection_mutex and drm_mode_config.mutex, respectively?

Quoted 6 lines

plus looking at ->state objects outside of atomic commit machinery makes no sense because you're not actually in sync with the hw state. Relevant bits need to be copied over at commit time, protected by some spinlock (and that spinlock also needs to be held over whatever other stuff you're setting to make sure we don't get a funny out-of-sync state anywhere).

Quoted 3 lines

If we already have a lock protecting against having both an ASoC and KMS function running, it's not clear to me what the spinlock would prevent here?

Replicating the irc chat here. With

commit 6c5ed5ae353cdf156f9ac4db17e15db56b4de880

Author: Maarten Lankhorst <[email protected]>
Date:   Thu Apr 6 20:55:20 2017 +0200
Quoted 8 lines
Quoted 4 lines

drm/atomic: Acquire connection_mutex lock in drm_helper_probe_single_connector_modes, v4.

this is already taken care of for drivers and should be all good from a locking pov.

So, if I understand this properly, this superseeds your comment on the spinlock for the hw state, but not the comment that we need some locking to synchronize between the audio and KMS path (and CEC?). Right?

Other way round. There's 3 things involved here:
1. kms output probe code
2. kms atomic commit code
3. calls from asoc side

The above referenced commit makes sure 1&2 are synchronized. The problem is that 2&3 are not synchonronized, and from 3, no matter how much locking you have, you cannot look at kms state. I.e. not allowed to look at crtc->state for example, irrespective of whether you're holding drm_modeset_lock or not. This is because the atomic nonblocking commit is done without holding any locks, protection is purely down to ownership rules of state structures and ordering (through drm_crtc_commit) of in-flight nonblocking atomic commits.

That's why you need a sperate lock _and_ copy state, so taht 2&3 stay in sync.

In practice you only care about modeset changes from 2 vs anything from 3, and most userspace does modeset atomic commits as blocking commits, which means you won't notice that your locking has gaps.

btw same problem exists between atomic and (vblank) irq handler. There you need a irqsafe spinlock and you also have to copy (because the irq handler just cannot access ->state in any safe way, because it doesn't own that structure).

Quoted 4 lines

This is maybe a bit the confusing thing with atomic commit: ->state isn't protected by locks, but through ownership rules. Only for atomic check is ->state protected by locks, but once we're committed we switch over to ownership rules for protection. swap_states() is that point of no return.

Thanks for the clarifications, I just posted a series that should be implementing this here:
https://lore.kernel.org/dri-devel/[email protected]/

Maxime