vc4-kms-v3d boot failure focal armhf preinstalled server

Bug #1889223 reported by Kyle Nitzsche
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-raspi (Ubuntu)
Invalid
Undecided
Unassigned
Focal
Fix Released
Undecided
Juerg Haefliger

Bug Description

Booting 20.04 armhf preinstalled-server on Pi3b+ with vc4-kms-v3d selected [1] causes boot failure with [2] output on UART. Further system info in [3]

Side note: Booting with the same usercfg.txt but with the 18.04 vc4-kms-v3d.dtbo file "works": the boot is normal without the errors shown in [2].

[1]

ubuntu@ubuntu:~$ cat /boot/firmware/usercfg.txt
# Place "config.txt" changes (dtparam, dtoverlay, disable_overscan, etc.) in
# this file. Please refer to the README file for a description of the various
# configuration files on the boot partition.
dtoverlay=vc4-kms-v3d

[2]

  Starting kernel ...

[ 0.039873] cma: CMA area linux,cma could not be activated
[ 0.043189] DMA: failed to allocate 1024 KiB pool for atomic coherent
allocation
[ 0.308022] kobject_add_internal failed for 3e513000.framebuffer with
-EEXIST, don't try to register things with the s.
[ 1.141370] kvm [1]: Error, CPU 0 not supported!
[ 1.235565] raspberrypi-exp-gpio soc:firmware:expgpio: Failed to get
GPIO 0 config (-12 80)
[ 1.236723] raspberrypi-exp-gpio soc:firmware:expgpio: Failed to get
GPIO 1 config (-12 81)
[ 1.237882] raspberrypi-exp-gpio soc:firmware:expgpio: Failed to get
GPIO 2 config (-12 82)
[ 1.239014] raspberrypi-exp-gpio soc:firmware:expgpio: Failed to get
GPIO 3 config (-12 83)
[ 1.240139] raspberrypi-exp-gpio soc:firmware:expgpio: Failed to get
GPIO 4 config (-12 84)
[ 1.241263] raspberrypi-exp-gpio soc:firmware:expgpio: Failed to get
GPIO 5 config (-12 85)
[ 1.242412] raspberrypi-exp-gpio soc:firmware:expgpio: Failed to get
GPIO 6 config (-12 86)
[ 1.243526] raspberrypi-exp-gpio soc:firmware:expgpio: Failed to get
GPIO 7 config (-12 87)
[ 1.831440] spi-bcm2835 3f204000.spi: could not get clk: -517
[ 1.849256] raspberrypi-exp-gpio soc:firmware:expgpio: Failed to get
GPIO 2 config (-12 82)
[ 1.850523] raspberrypi-exp-gpio soc:firmware:expgpio: Failed to get
GPIO 2 config (-12 82)
[ 1.852205] bcm2835_vchiq 3f00b840.mailbox: could not allocate DMA memory
[ 2.369653] spi-bcm2835 3f204000.spi: cannot prepare fill_tx_desc -
not using DMA mode
[ 2.412710] sdhost: failed to allocate log buf
ext4

[3]

ubuntu@ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal

ubuntu@ubuntu:~$ uname -a
Linux ubuntu 5.4.0-1015-raspi #15-Ubuntu SMP Fri Jul 10 05:37:25 UTC 2020 armv7l armv7l armv7l GNU/Linux

Initial part of lshw:
ubuntu
    description: ARMv7 Processor rev 4 (v7l)
    product: Raspberry Pi 3 Model B Plus Rev 1.3
    serial: 0000000092021ecd
    width: 32 bits
    capabilities: smp

Revision history for this message
Jon Watson (jwatson-kdp) wrote :

I was able to confirm that if I started from a clean install of Ubuntu 20.04 I could copy the 18.04 .dtbo file per the workaround described above and get the board to boot with the usercfg.txt / dtoverlay=vc4-kms-v3d setting in place.

I was unable to make it work on my initial install, which I had been using for about a week.

Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

Project noticed this frame buffer "failed" message in boot console and we are not sure if it is problem or not:

Starting kernel ...

[ 0.313431] kobject_add_internal failed for 3e812000.framebuffer with -EEXIST, don't try to register things with the same name in the same directory.

[ 1.160342] kvm [1]: Error, CPU 0 not supported!

[ 1.831690] spi-bcm2835 3f204000.spi: could not get clk: -517

[ 4.365423] debugfs: Directory '3f902000.hdmi' with parent 'vc4-hdmi' already present!

ext4

Thu Jan 1 00:00:06 UTC 1970

Juerg Haefliger (juergh)
Changed in linux-raspi (Ubuntu):
status: New → Invalid
Changed in linux-raspi (Ubuntu Focal):
assignee: nobody → Juerg Haefliger (juergh)
Revision history for this message
Juerg Haefliger (juergh) wrote :

The above are benign warnings that should actually be suppressed.

I confirmed the issue: Fails on armhf, works on arm64.

Changed in linux-raspi (Ubuntu Focal):
status: New → Confirmed
Revision history for this message
Juerg Haefliger (juergh) wrote :

Using 256MB for CMA seems problematic for the armhf kernel. A work-around is to lower it like so:

dtoverlay=vc4-kms-v3d,cma-64

Changed in linux-raspi (Ubuntu Focal):
status: Confirmed → Triaged
Revision history for this message
Jon Watson (jwatson-kdp) wrote :

I will test that with the default .dtbo file and see if it works for us.

Revision history for this message
Juerg Haefliger (juergh) wrote :

From my testing cma-128 is the largest that worked.

Revision history for this message
Jon Watson (jwatson-kdp) wrote :

OK, we will try CMA-128.... not sure if it will matter for our application since we aren't doing complex 3D rendering.

Revision history for this message
Jon Watson (jwatson-kdp) wrote :

Qt responded and thinks cma-128 will work for our application.

I modified our Pi test unit to use the original Ubuntu 20.04 .dtbo file and booted successfully when I used the dtoverlay=vc4-kms-v3d,cma-64 setting.

I will test our UI with this configuration early next week.

Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

Hi, a fix for this is needed for an important project. Can we please get a sense of the expected time frame for the fix landing?

Revision history for this message
Juerg Haefliger (juergh) wrote :

What fix? The fix is to limit the cma size as indicated in the previous comments.

Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

OK, so you are saying it is really not a kernel fix but is rather an enablement file change/config. thanks.

Revision history for this message
Jon Watson (jwatson-kdp) wrote : RE: [Bug 1889223] Re: vc4-kms-v3d boot failure focal armhf preinstalled server
Download full text (4.5 KiB)

How is it not a bug when the kernel fails to boot when you use the default setting?

There is a workaround for this problem which is to limit memory, but there is still a crash. The Raspbian kernel doesn't crash -- it works. That would suggest there is a problem here.

JW

-----Original Message-----
From: <email address hidden> <email address hidden> On Behalf Of Kyle Nitzsche
Sent: Friday, September 25, 2020 2:54 PM
To: Jonathan Watson <email address hidden>
Subject: [Bug 1889223] Re: vc4-kms-v3d boot failure focal armhf preinstalled server

- - - external message, proceed with caution - - -

OK, so you are saying it is really not a kernel fix but is rather an enablement file change/config. thanks.

--
You received this bug notification because you are subscribed to the bug report.
https://urldefense.com/v3/__https://bugs.launchpad.net/bugs/1889223__;!!LrkQbg!egKH44YGlhhBxV6R0RjD7KoXnEZBg3YTxHTuKvnvxop_BsoVCnxlp3XXKcFapU0pLA8$

Title:
  vc4-kms-v3d boot failure focal armhf preinstalled server

Status in linux-raspi package in Ubuntu:
  Invalid
Status in linux-raspi source package in Focal:
  Triaged

Bug description:
  Booting 20.04 armhf preinstalled-server on Pi3b+ with vc4-kms-v3d
  selected [1] causes boot failure with [2] output on UART. Further
  system info in [3]

  Side note: Booting with the same usercfg.txt but with the 18.04 vc4
  -kms-v3d.dtbo file "works": the boot is normal without the errors
  shown in [2].

  [1]

  ubuntu@ubuntu:~$ cat /boot/firmware/usercfg.txt
  # Place "config.txt" changes (dtparam, dtoverlay, disable_overscan, etc.) in
  # this file. Please refer to the README file for a description of the various
  # configuration files on the boot partition.
  dtoverlay=vc4-kms-v3d

  [2]

    Starting kernel ...

  [ 0.039873] cma: CMA area linux,cma could not be activated
  [ 0.043189] DMA: failed to allocate 1024 KiB pool for atomic coherent
  allocation
  [ 0.308022] kobject_add_internal failed for 3e513000.framebuffer with
  -EEXIST, don't try to register things with the s.
  [ 1.141370] kvm [1]: Error, CPU 0 not supported!
  [ 1.235565] raspberrypi-exp-gpio soc:firmware:expgpio: Failed to get
  GPIO 0 config (-12 80)
  [ 1.236723] raspberrypi-exp-gpio soc:firmware:expgpio: Failed to get
  GPIO 1 config (-12 81)
  [ 1.237882] raspberrypi-exp-gpio soc:firmware:expgpio: Failed to get
  GPIO 2 config (-12 82)
  [ 1.239014] raspberrypi-exp-gpio soc:firmware:expgpio: Failed to get
  GPIO 3 config (-12 83)
  [ 1.240139] raspberrypi-exp-gpio soc:firmware:expgpio: Failed to get
  GPIO 4 config (-12 84)
  [ 1.241263] raspberrypi-exp-gpio soc:firmware:expgpio: Failed to get
  GPIO 5 config (-12 85)
  [ 1.242412] raspberrypi-exp-gpio soc:firmware:expgpio: Failed to get
  GPIO 6 config (-12 86)
  [ 1.243526] raspberrypi-exp-gpio soc:firmware:expgpio: Failed to get
  GPIO 7 config (-12 87)
  [ 1.831440] spi-bcm2835 3f204000.spi: could not get clk: -517
  [ 1.849256] raspberrypi-exp-gpio soc:firmware:expgpio: Failed to get
  GPIO 2 config (-12 82)
  [ 1.850523] raspberrypi-exp-gpio soc:firmware:expgpio: ...

Read more...

Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

@Juerg,

Is it correct that all that is required to make v3d driver work on armhf pi3+b is to modify the /boot/firmware/usercfg.txt to include:

dtoverlay=vc4-kms-v3d,cma-64,cma-128

@Jon,

Note that the pi-gadget default uses fkms, not kms. For example the 18 armhf:
https://github.com/snapcore/pi-gadget/blob/18-arm64/configs/core/config.txt.armhf#L19

Which works. If one wants to use vc4-kms-v3d, then that's a modification, and it works if you modify it correctly as shown above.

Revision history for this message
Juerg Haefliger (juergh) wrote :

Documented work-around so closing as 'Fix Released'. Please open a new bug report if you still encounter the problem.

Changed in linux-raspi (Ubuntu Focal):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.