Skip to content

Fix issues with i915 reading DRAM config on Tigerlake systems

A couple of Tigerlake systems out there currently have issues with i915 retrieving various information related to the DRAM configuration on the system, which results in potentially incorrect watermarks being used and thus - potential display flickering, along with a pretty nasty set of WARN_ONs() in the kernel log.

Example:

[    1.725695] kernel: ------------[ cut here ]------------
[    1.725695] kernel: Missing case (val == 65535)
[    1.725701] kernel: WARNING: CPU: 5 PID: 425 at drivers/gpu/drm/i915/intel_dram.c:96 skl_dram_get_dimm_info+0x73/0x1a0 [i915]
[    1.725742] kernel: Modules linked in: i915(+) hid_multitouch(+) ax88179_178a(+) usbnet mii fjes(-) mxm_wmi drm_ttm_helper ttm i2c_algo_bit rtsx_pci_sdmmc drm_kms_helper mmc_core cec nvme drm serio_raw crct10dif_pclmul crc32_pclmul crc32c_intel rtsx_pci nvme_core ghas>
[    1.725753] kernel: CPU: 5 PID: 425 Comm: systemd-udevd Tainted: G        W         5.11.11-200.fc33.x86_64 #1
[    1.725754] kernel: Hardware name: Dell Inc. Precision [REDACTED]/, BIOS [REDACTED] 01/14/2021
[    1.725754] kernel: RIP: 0010:skl_dram_get_dimm_info+0x73/0x1a0 [i915]
[    1.725790] kernel: Code: 0f 84 32 01 00 00 41 f7 c0 00 01 00 00 0f 84 25 01 00 00 41 0f b7 d0 48 c7 c6 80 53 7a c0 48 c7 c7 84 53 7a c0 e8 a3 16 57 c4 <0f> 0b 44 0f b7 0b b9 01 00 00 00 31 c0 31 f6 88 43 02 41 c1 fe 09
[    1.725792] kernel: RSP: 0018:ffffbdf54074fb10 EFLAGS: 00010282
[    1.725793] kernel: RAX: 000000000000001b RBX: ffffbdf54074fb9a RCX: ffff978ebf558ac8
[    1.725793] kernel: RDX: 00000000ffffffd8 RSI: 0000000000000027 RDI: ffff978ebf558ac0
[    1.725794] kernel: RBP: 0000000000000053 R08: 0000000000000000 R09: ffffbdf54074f940
[    1.725795] kernel: R10: ffffbdf54074f938 R11: ffffffff85b44f08 R12: 0000000000000001
[    1.725795] kernel: R13: ffff978b4d120000 R14: 000000000000ffff R15: ffff978b4d120000
[    1.725796] kernel: FS:  00007f9ba29e8380(0000) GS:ffff978ebf540000(0000) knlGS:0000000000000000
[    1.725797] kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    1.725798] kernel: CR2: 0000561abbaaf3b8 CR3: 000000010b100003 CR4: 0000000000770ee0
[    1.725799] kernel: PKRU: 55555554
[    1.725799] kernel: Call Trace:
[    1.725800] kernel:  skl_dram_get_channel_info+0x40/0x150 [i915]
[    1.725834] kernel:  intel_dram_detect+0x12d/0x680 [i915]
[    1.725868] kernel:  ? intel_opregion_setup+0x5dc/0x690 [i915]
[    1.725928] kernel:  i915_driver_probe+0x56c/0xc80 [i915]
[    1.725967] kernel:  ? vga_switcheroo_client_probe_defer+0x1f/0x40
[    1.725969] kernel:  ? i915_pci_probe+0x31/0x110 [i915]
[    1.726004] kernel:  local_pci_probe+0x42/0x80
[    1.726006] kernel:  ? _cond_resched+0x16/0x40
[    1.726008] kernel:  pci_device_probe+0xd9/0x190
[    1.726010] kernel:  really_probe+0xf2/0x440
[    1.726012] kernel:  driver_probe_device+0xe1/0x150
[    1.726013] kernel:  device_driver_attach+0xa1/0xb0
[    1.726015] kernel:  __driver_attach+0x8a/0x150
[    1.726017] kernel:  ? device_driver_attach+0xb0/0xb0
[    1.726018] kernel:  ? device_driver_attach+0xb0/0xb0
[    1.726020] kernel:  bus_for_each_dev+0x64/0x90
[    1.726022] kernel:  bus_add_driver+0x12b/0x1e0
[    1.726024] kernel:  driver_register+0x8b/0xe0
[    1.726026] kernel:  ? 0xffffffffc0894000
[    1.726026] kernel:  i915_init+0x62/0x7c [i915]
[    1.726075] kernel:  do_one_initcall+0x44/0x1d0
[    1.726077] kernel:  ? do_init_module+0x23/0x270
[    1.726078] kernel:  ? kmem_cache_alloc_trace+0xef/0x1e0
[    1.726080] kernel:  do_init_module+0x5c/0x270
[    1.726081] kernel:  __do_sys_init_module+0x12a/0x190
[    1.726083] kernel:  do_syscall_64+0x33/0x40
[    1.726085] kernel:  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[    1.726086] kernel: RIP: 0033:0x7f9ba395f70e
[    1.726087] kernel: Code: 48 8b 0d 6d 17 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 49 89 ca b8 af 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 3a 17 0c 00 f7 d8 64 89 01 48
[    1.726088] kernel: RSP: 002b:00007ffca67c0938 EFLAGS: 00000246 ORIG_RAX: 00000000000000af
[    1.726089] kernel: RAX: ffffffffffffffda RBX: 0000561abacdcff0 RCX: 00007f9ba395f70e
[    1.726090] kernel: RDX: 00007f9ba3a9535a RSI: 000000000051ccde RDI: 0000561abb5926d0
[    1.726091] kernel: RBP: 0000561abb5926d0 R08: 0000561abb5926d0 R09: 00007ffca67bd4be
[    1.726091] kernel: R10: 0000561abacbd010 R11: 0000000000000246 R12: 00007f9ba3a9535a
[    1.726092] kernel: R13: 0000561abace4260 R14: 0000000000000007 R15: 0000561abaceaff0
[    1.726093] kernel: ---[ end trace 12c93332b2739df3 ]---

There's a fix for this already upstream, but it hasn't been forwarded to stable yet so let's include it ourselves for the mean time.

Merge request reports