Kernel panic with 1920x720 HDMI touchscreen

Hello,

I am experiencing a strange issue when I connect a monitor with a native resolution of 1920x720 pixels over HDMI: Very early in the boot process, I see a kernel crash, with the following stack trace when using the official Android 13 images:

[   10.014200][    C4] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
[   10.014201][    C4] Mem abort info:
[   10.014202][    C4]   ESR = 0x96000005
[   10.014203][    C4]   EC = 0x25: DABT (current EL), IL = 32 bits
[   10.014204][    C4]   SET = 0, FnV = 0
[   10.014205][    C4]   EA = 0, S1PTW = 0
[   10.014206][    C4] Data abort info:
[   10.014207][    C4]   ISV = 0, ISS = 0x00000005
[   10.014208][    C4]   CM = 0, WnR = 0
[   10.014209][    C4] [0000000000000000] user address but active_mm is swapper
[   10.014210][    C4] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[   10.014212][    C4] Modules linked in:
[   10.014214][    C4] CPU: 4 PID: 1 Comm: swapper/0 Not tainted 5.10.157 #1
[   10.014215][    C4] Hardware name: Khadas Edge2 (DT)
[   10.014216][    C4] pstate: 604000c9 (nZCv daIF +PAN -UAO -TCO BTYPE=--)
[   10.014217][    C4] pc : mcu_reboot_boot_mode+0x38/0xe0
[   10.014218][    C4] lr : panic+0x278/0x39c
[   10.014219][    C4] sp : ffffffc00a33b2d0
[   10.014220][    C4] x29: ffffffc00a33b2f0 x28: ffffff83fc7f0000 
[   10.014223][    C4] x27: ffffffc00a2bf204 x26: ffffffc0099fef05 
[   10.014225][    C4] x25: 0000000000000000 x24: 0000000000001388 
[   10.014227][    C4] x23: 00000000000003e8 x22: ffffffc009cf0000 
[   10.014229][    C4] x21: 0000000000001388 x20: ffffffc00a101000 
[   10.014232][    C4] x19: 0000000000000001 x18: ffffffc00a335118 
[   10.014234][    C4] x17: ffffffc00a33b263 x16: 0000000000000010 
[   10.014236][    C4] x15: ffffffc00861152c x14: ffffffc0093f2788 
[   10.014238][    C4] x13: 000000000000003f x12: 0000000000000000 
[   10.014241][    C4] x11: ffffffc0099a74c2 x10: ffffffc00a2d2518 
[   10.014243][    C4] x9 : 0000000200000000 x8 : 0000000000000000 
[   10.014245][    C4] x7 : 392e34202020205b x6 : ffffff84fd6429db 
[   10.014248][    C4] x5 : 0000000000000044 x4 : ffff0a01ffffff00 
[   10.014250][    C4] x3 : 000000000000000a x2 : 0000000000000002 
[   10.014252][    C4] x1 : 0000000000000dc0 x0 : 000000000e522bcf 
[   10.014255][    C4] Call trace:
[   10.014256][    C4]  mcu_reboot_boot_mode+0x38/0xe0
[   10.014257][    C4]  panic+0x278/0x39c
[   10.014258][    C4]  test_taint+0x0/0x28
[   10.014259][    C4]  arm64_serror_panic+0x74/0x80
[   10.014260][    C4]  do_serror+0xd0/0xf0
[   10.014261][    C4]  el1_error+0x90/0x114
[   10.014262][    C4]  regmap_mmio_read32le+0x14/0x20
[   10.014263][    C4]  _regmap_bus_reg_read+0x18/0x24
[   10.014264][    C4]  _regmap_read+0x180/0x240
[   10.014265][    C4]  regmap_read+0x54/0x78
[   10.014266][    C4]  dw_hdmi_qp_bridge_attach+0x214/0x268
[   10.014268][    C4]  drm_bridge_attach+0xe8/0x194
[   10.014269][    C4]  dw_hdmi_qp_bind+0x708/0x978
[   10.014270][    C4]  dw_hdmi_rockchip_bind+0xc64/0xf64
[   10.014271][    C4]  component_bind_all+0x130/0x25c
[   10.014272][    C4]  rockchip_drm_bind+0x2e8/0x440
[   10.014273][    C4]  try_to_bring_up_master+0x164/0x1ac
[   10.014274][    C4]  component_master_add_with_match+0x120/0x1e4
[   10.014276][    C4]  rockchip_drm_platform_probe+0x314/0x32c
[   10.014277][    C4]  platform_drv_probe+0x94/0xbc
[   10.014278][    C4]  really_probe+0x200/0x500
[   10.014279][    C4]  driver_probe_device+0x7c/0xb8
[   10.014280][    C4]  device_driver_attach+0x6c/0xac
[   10.014281][    C4]  __driver_attach+0xc0/0x14c
[   10.014282][    C4]  bus_for_each_dev+0x80/0xcc
[   10.014283][    C4]  driver_attach+0x24/0x30
[   10.014284][    C4]  bus_add_driver+0x10c/0x1f8
[   10.014285][    C4]  driver_register+0x78/0x110
[   10.014287][    C4]  __platform_driver_register+0x44/0x50
[   10.014287][    C4]  rockchip_drm_init+0xc0/0x100
[   10.014289][    C4]  do_one_initcall+0xe8/0x314
[   10.014290][    C4]  do_initcall_level+0xa4/0x154
[   10.014291][    C4]  do_initcalls+0x54/0x94
[   10.014292][    C4]  do_basic_setup+0x24/0x30
[   10.014293][    C4]  kernel_init_freeable+0xf0/0x158
[   10.014294][    C4]  kernel_init+0x14/0x188
[   10.014295][    C4]  ret_from_fork+0x10/0x18

When trying the 14 images, I see a similar crash (but with a slightly different stack trace).
It is also happening with the Ubuntu 24.04 images, but the latest ones (edge2-ubuntu-24.04-gnome-linux-6.1-fenix-1.7.2-241022-emmc.img and above) works fine. So I guess a fix has been merged for Linux 6.1 between edge2-ubuntu-24.04-gnome-linux-6.1-fenix-1.6.8-240605-emmc.img and edge2-ubuntu-24.04-gnome-linux-6.1-fenix-1.7.2-241022-emmc.img.

Please note that this issue cannot be reproduced when I connect the HDMI cable after Android has booted (with both 5.10/13 and 6.1/14). It also can’t be reproduced when I use another monitor with a full HD resolution.

Kind Regards,
Mathieu

Here is the EDID of the monitor:

edid-decode (hex):

00 ff ff ff ff ff ff 00 1e 41 4b 54 00 00 00 00
0a 1e 01 03 80 18 09 78 2a fa 58 a4 55 53 a2 24
0d 4b 4e 00 00 00 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 c4 24 80 90 70 d0 28 20 32 2c
a4 01 f3 5b 00 00 00 1f 00 00 00 fd 00 3c 64 1e
70 18 00 0a 20 20 20 20 20 20 00 00 00 fc 00 48
44 20 44 69 73 70 6c 61 79 0a 20 20 00 00 00 10
00 4c 54 4e 31 37 33 4b 54 30 31 30 30 30 01 90

02 03 2f f5 40 23 09 07 07 83 01 00 00 67 03 0c
00 10 00 38 50 68 1a 00 00 01 00 32 64 00 67 d8
5d c4 01 54 80 00 e3 05 c0 00 e4 06 05 01 60 a4
38 80 c8 70 38 3c 40 30 20 45 00 7e d6 10 00 00
1e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 26

----------------

Block 0, Base EDID:
  EDID Structure Version & Revision: 1.3
  Vendor & Product Identification:
    Manufacturer: GRA
    Model: 21579
    Made in: week 10 of 2020
  Basic Display Parameters & Features:
    Digital display
    Maximum image size: 24 cm x 9 cm
    Gamma: 2.20
    DPMS levels: Off
    RGB color display
    First detailed timing is the preferred timing
  Color Characteristics:
    Red  : 0.6435, 0.3349
    Green: 0.3261, 0.6347
    Blue : 0.1416, 0.0517
    White: 0.2949, 0.3046
  Established Timings I & II: none
  Standard Timings: none
  Detailed Timing Descriptors:
    DTD 1:  1920x720    60.001020 Hz   8:3     45.601 kHz     94.120000 MHz (243 mm x 91 mm)
                 Hfront   50 Hsync  44 Hback   50 Hpol P
                 Vfront   10 Vsync  20 Vback   10 Vpol P
    Display Range Limits:
      Monitor ranges (GTF): 60-100 Hz V, 30-112 kHz H, max dotclock 240 MHz
    Display Product Name: 'HD Display'
    Dummy Descriptor:
  Extension blocks: 1
Checksum: 0x90

----------------

Block 1, CTA-861 Extension Block:
  Revision: 3
  Underscans IT Video Formats by default
  Basic audio support
  Supports YCbCr 4:4:4
  Supports YCbCr 4:2:2
  Native detailed modes: 5
  Video Data Block:
  Audio Data Block:
    Linear PCM:
      Max channels: 2
      Supported sample rates (kHz): 48 44.1 32
      Supported sample sizes (bits): 24 20 16
  Speaker Allocation Data Block:
    FL/FR - Front Left/Right
  Vendor-Specific Data Block (HDMI), OUI 00-0C-03:
    Source physical address: 1.0.0.0
    DC_36bit
    DC_30bit
    DC_Y444
    Maximum TMDS clock: 400 MHz
  Vendor-Specific Data Block (AMD), OUI 00-00-1A:
    Version: 1.0
    Minimum Refresh Rate: 50 Hz
    Maximum Refresh Rate: 100 Hz
    Flags 1.x: 0x00
  Vendor-Specific Data Block (HDMI Forum), OUI C4-5D-D8:
    Version: 1
    Maximum TMDS Character Rate: 420 MHz
    SCDC Present
  Colorimetry Data Block:
    BT2020YCC
    BT2020RGB
  HDR Static Metadata Data Block:
    Electro optical transfer functions:
      Traditional gamma - SDR luminance range
      SMPTE ST2084
    Supported static metadata descriptors:
      Static metadata type 1
    Desired content max luminance: 96 (400.000 cd/m^2)
  Detailed Timing Descriptors:
    DTD 2:  1920x1080   59.996690 Hz  16:9     68.396 kHz    145.000000 MHz (382 mm x 214 mm)
                 Hfront   48 Hsync  32 Hback  120 Hpol P
                 Vfront    4 Vsync   5 Vback   51 Vpol P
Checksum: 0x26

----------------

Preferred Video Timing if only Block 0 is parsed:
  DTD   1:  1920x720    60.001020 Hz   8:3     45.601 kHz     94.120000 MHz (243 mm x 91 mm)
                 Hfront   50 Hsync  44 Hback   50 Hpol P
                 Vfront   10 Vsync  20 Vback   10 Vpol P

----------------

Preferred Video Timing if Block 0 and CTA-861 Blocks are parsed:
  DTD   1:  1920x720    60.001020 Hz   8:3     45.601 kHz     94.120000 MHz (243 mm x 91 mm)
                 Hfront   50 Hsync  44 Hback   50 Hpol P
                 Vfront   10 Vsync  20 Vback   10 Vpol P

----------------

Native Video Resolution if only Block 0 is parsed:
  1920x720

----------------

Native Video Resolutions if Block 0 and CTA-861 Blocks are parsed:
  1920x720
  1920x1080

----------------

edid-decode SHA: 84ddf9155376 2021-10-03 10:37:45

Ok, after cherry-picking a few commits from the khadas-edges-6.1.y branch, I found out the commit that fixes this issue: drm/bridge: synopsys: dw-hdmi-qp: Check that necessary hdmi clock is … · khadas/linux@cb42b8d · GitHub

It needs to be merged to both khadas-edge2-android13 and khadas-edge2-android14 branches to fix both Android releases.

Okay, thank you for identifying this issue and providing a solution. We will incorporate this patch in the next version

1 Like