Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix compilation with kernel 6.1 #67

Merged
merged 2 commits into from
Jan 16, 2023

Conversation

jwrdegoede
Copy link
Contributor

Fix compilation with kernel 6.1, deal with the media-controller changes which have landed in 6.1-rc2.

Closes: #63

Signed-off-by: Hans de Goede [email protected]

Fix compilation with kernel 6.1, deal with the media-controller
changes which have landed in 6.1-rc2.

Closes: intel#63

Signed-off-by: Hans de Goede <[email protected]>
@twouters
Copy link

I've applied it on top of https://git.launchpad.net/~vicamo/+git/intel-ipu6-dkms/tree/debian?h=ubuntu/devel but it stalls during boot:

Nov 23 15:05:53 britannic kernel: BUG: kernel NULL pointer dereference, address: 0000000000000051
Nov 23 15:05:53 britannic kernel: #PF: supervisor read access in kernel mode
Nov 23 15:05:53 britannic kernel: #PF: error_code(0x0000) - not-present page
Nov 23 15:05:53 britannic kernel: PGD 0 P4D 0 
Nov 23 15:05:53 britannic kernel: Oops: 0000 [#1] PREEMPT SMP NOPTI
Nov 23 15:05:53 britannic kernel: CPU: 5 PID: 50 Comm: kworker/5:0 Tainted: G     U     OE      6.1.0-rc6-1-mainline #1 3fe764a15939e58969997178c4ba3efc6af533cd
Nov 23 15:05:53 britannic kernel: Hardware name: Dell Inc. XPS 9315/00KRKP, BIOS 1.5.0 10/08/2022
Nov 23 15:05:53 britannic kernel: Workqueue: events mei_vsc_probe_work [mei_vsc]
Nov 23 15:05:53 britannic kernel: RIP: 0010:mei_start+0x29/0x140 [mei]
Nov 23 15:05:53 britannic kernel: Code: 00 f3 0f 1e fa 0f 1f 44 00 00 41 54 4c 8d a7 d8 00 00 00 55 53 48 89 fb 4c 89 e7 e8 51 13 29 c4 48 8b 83 50 0e 00 00 48 89 df <48> 8b 40 50 ff d0 0f 1f 00 48 8b 83 50 0e 
00 00 48 89 df 48 8b 40
Nov 23 15:05:53 britannic kernel: RSP: 0018:ffffa238402dfe58 EFLAGS: 00010246
Nov 23 15:05:53 britannic kernel: RAX: 0000000000000001 RBX: ffff8f5dc9144028 RCX: ffff8f652f772868
Nov 23 15:05:53 britannic kernel: RDX: ffff8f5dc0c00000 RSI: ffff8f5dc9147cc0 RDI: ffff8f5dc9144028
Nov 23 15:05:53 britannic kernel: RBP: ffff8f5dc9147cb8 R08: 0000000000000001 R09: ffff8f5dc0950674
Nov 23 15:05:53 britannic kernel: R10: 0000000000000007 R11: 0000000000000000 R12: ffff8f5dc9144100
Nov 23 15:05:53 britannic kernel: R13: 0000000000000000 R14: ffff8f5dc0950600 R15: ffff8f5dc9147cc0
Nov 23 15:05:53 britannic kernel: FS:  0000000000000000(0000) GS:ffff8f652f740000(0000) knlGS:0000000000000000
Nov 23 15:05:53 britannic kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Nov 23 15:05:53 britannic kernel: CR2: 0000000000000051 CR3: 00000004cda10002 CR4: 0000000000f70ee0
Nov 23 15:05:53 britannic kernel: PKRU: 55555554
Nov 23 15:05:53 britannic kernel: Call Trace:
Nov 23 15:05:53 britannic kernel:  <TASK>
Nov 23 15:05:53 britannic kernel:  mei_vsc_probe_work+0x24/0x70 [mei_vsc fd51ddfe80d9be7bc31d6e7d963d23b53939614e]
Nov 23 15:05:53 britannic kernel:  process_one_work+0x1c4/0x380
Nov 23 15:05:53 britannic kernel:  worker_thread+0x51/0x390
Nov 23 15:05:53 britannic kernel:  ? rescuer_thread+0x3b0/0x3b0
Nov 23 15:05:53 britannic kernel:  kthread+0xdb/0x110
Nov 23 15:05:53 britannic kernel:  ? kthread_complete_and_exit+0x20/0x20
Nov 23 15:05:53 britannic kernel:  ret_from_fork+0x1f/0x30
Nov 23 15:05:53 britannic kernel:  </TASK>
Nov 23 15:05:53 britannic kernel: Modules linked in: pcc_cpufreq(-) spi_ljca(OE+) dell_laptop i2c_ljca(OE+) gpio_ljca(OE) intel_rapl_msr intel_tcc_cooling x86_pkg_temp_thermal intel_powerclamp coretemp kvm_inte
l kvm irqbypass rapl intel_cstate intel_uncore pcspkr psmouse dell_wmi_sysman firmware_attributes_class dell_wmi dell_smbios dcdbas ledtrig_audio dell_wmi_descriptor wmi_bmof snd_hda_codec_hdmi snd_sof_pci_inte
l_tgl snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence snd_sof_intel_hda snd_sof_pci snd_sof_xtensa_dsp snd_sof snd_sof_utils snd_soc_hdac_hda snd_hda_ext_core snd_soc_acp
i_intel_match snd_soc_acpi soundwire_bus snd_soc_core snd_compress ac97_bus snd_pcm_dmaengine snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hda_core snd_hwdep iwlmvm snd_pcm mac80211 snd_t
imer spi_nor i2c_i801 snd mtd i2c_smbus soundcore libarc4 btusb btrtl iwlwifi btbcm btintel mei_me intel_lpss_pci btmtk intel_lpss intel_ipu6_isys(OE) idma64 videobuf2_dma_contig
Nov 23 15:05:53 britannic kernel:  cfg80211 ljca(OE) bluetooth v4l2_fwnode v4l2_async ecdh_generic videobuf2_memops rfkill videobuf2_v4l2 crc16 videobuf2_common processor_thermal_device_pci processor_thermal_de
vice intel_ipu6_psys(OE) processor_thermal_rfim intel_ish_ipc processor_thermal_mbox processor_thermal_rapl intel_ishtp thunderbolt intel_ipu6(OE) intel_rapl_common ucsi_acpi typec_ucsi igen6_edac typec roles i
2c_hid_acpi mei_vsc(OE) mei i2c_hid int3403_thermal int340x_thermal_zone intel_skl_int3472_tps68470 tps68470_regulator clk_tps68470 intel_skl_int3472_discrete intel_hid sparse_keymap int3400_thermal acpi_therma
l_rel acpi_tad acpi_pad vfat fat mac_hid vboxnetflt(OE) vboxnetadp(OE) nfsd vboxdrv(OE) v4l2loopback(OE) auth_rpcgss videodev nfs_acl mc lockd dm_multipath grace sg crypto_user sunrpc fuse ip_tables x_tables bt
rfs blake2b_generic libcrc32c crc32c_generic xor raid6_pq dm_crypt cbc encrypted_keys trusted asn1_encoder tee usbhid dm_mod tpm_crb serio_raw tpm_tis atkbd crct10dif_pclmul
Nov 23 15:05:53 britannic kernel:  crc32_pclmul crc32c_intel polyval_clmulni polyval_generic gf128mul libps2 vivaldi_fmap ghash_clmulni_intel tpm_tis_core sha512_ssse3 nvme aesni_intel spi_intel_pci nvme_core t
pm i8042 xhci_pci crypto_simd cryptd spi_intel xhci_pci_renesas nvme_common rng_core serio i915 drm_buddy intel_gtt video wmi drm_display_helper cec ttm
Nov 23 15:05:53 britannic kernel: CR2: 0000000000000051
Nov 23 15:05:53 britannic kernel: ---[ end trace 0000000000000000 ]---
Nov 23 15:05:53 britannic kernel: RIP: 0010:mei_start+0x29/0x140 [mei]
Nov 23 15:05:53 britannic kernel: Code: 00 f3 0f 1e fa 0f 1f 44 00 00 41 54 4c 8d a7 d8 00 00 00 55 53 48 89 fb 4c 89 e7 e8 51 13 29 c4 48 8b 83 50 0e 00 00 48 89 df <48> 8b 40 50 ff d0 0f 1f 00 48 8b 83 50 0e 
00 00 48 89 df 48 8b 40
Nov 23 15:05:53 britannic kernel: RSP: 0018:ffffa238402dfe58 EFLAGS: 00010246
Nov 23 15:05:53 britannic kernel: RAX: 0000000000000001 RBX: ffff8f5dc9144028 RCX: ffff8f652f772868
Nov 23 15:05:53 britannic kernel: ljca-i2c ljca-i2c.3.auto: hid INTC1097 uid 0 new uid1
Nov 23 15:05:53 britannic kernel: RDX: ffff8f5dc0c00000 RSI: ffff8f5dc9147cc0 RDI: ffff8f5dc9144028
Nov 23 15:05:53 britannic kernel: RBP: ffff8f5dc9147cb8 R08: 0000000000000001 R09: ffff8f5dc0950674
Nov 23 15:05:53 britannic kernel: R10: 0000000000000007 R11: 0000000000000000 R12: ffff8f5dc9144100
Nov 23 15:05:53 britannic kernel: R13: 0000000000000000 R14: ffff8f5dc0950600 R15: ffff8f5dc9147cc0
Nov 23 15:05:53 britannic kernel: FS:  0000000000000000(0000) GS:ffff8f652f740000(0000) knlGS:0000000000000000
Nov 23 15:05:53 britannic kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Nov 23 15:05:53 britannic kernel: CR2: 0000000000000051 CR3: 00000004cda10002 CR4: 0000000000f70ee0
Nov 23 15:05:53 britannic kernel: PKRU: 55555554

@twouters
Copy link

Tried again by building your branch and I hit the same issue

@twouters
Copy link

(fyi: 6.0.x boots fine with this)

@jwrdegoede
Copy link
Contributor Author

jwrdegoede commented Nov 23, 2022

Hmm, I have so far only tested this on a Lenovo ThinkPad X1 Yoga Gen 7

I did need to either blacklist the intel-ipu6* modules in modprobe.conf and then load them manually starting with intel-ipu6, otherwise I would get a different NULL pointer deref. I have a fix for this in #68 now.

I do have a Dell XPS 9360 here, which I expect is closer to your Dell then then ThinkPad Yoga. I will give that a try too, but I don't expect to get around that before next week Monday.

@jwrdegoede
Copy link
Contributor Author

@mrhpearson, @vicamo Note if you want to build / try the IPU6 drivers with 6.1-rc2 or newer you will need this pull-req; and if you let udev load the modules at boot rather then doing it manually you will also need #68 to avoid a kernel crash due to a probe-ordering issue.

@vicamo
Copy link
Contributor

vicamo commented Nov 24, 2022

Yes, I am testing a new Ubuntu release with these combined.

@vicamo
Copy link
Contributor

vicamo commented Nov 24, 2022

Yes, I am testing a new Ubuntu release with these combined.

I have boot hang with or without #68 on v6.1-rc6.

@vicamo
Copy link
Contributor

vicamo commented Nov 24, 2022

Yes, I am testing a new Ubuntu release with these combined.

I have boot hang with or without #68 on v6.1-rc6.

Turns out it's a problem in vsc, and can be fixed by intel/ivsc-driver#27.

@twouters
Copy link

Can confirm that this change fixes compilation on v6.1-rc6 and v6.1-rc7 and mentioned fix for ivsc-driver fixes the boot hang

@hao-yao
Copy link
Contributor

hao-yao commented Dec 5, 2022

validated with #69

Kernel >= 6.2 set vb2_queue->streaming a bit earlier as <= 6.1,
specifically vb2_queue->streaming is set before the videobuf2-core
enqueues the buffers (just before calling start_streaming).

__buf_queue() uses vb2_queue->streaming to differentiate between
buffers queued before and after start_streaming has been called and
that will now no longer work, leading to a NULL pointer deref of
the not yet setup media_pipe pointer.

Fix this by explicitly checking for media_pipe == NULL. Note this
check cannot be used to replace the vb2_queue->streaming check since
for kernels < 6.1 media_pipe is always set.

Signed-off-by: Hans de Goede <[email protected]>
@jwrdegoede
Copy link
Contributor Author

Note I have just added an extra patch fixing the ipu6-driver crashing with linux-next / with the upcoming 6.2-rc# kernels.

@jwrdegoede
Copy link
Contributor Author

Ping? Is there a reason why this has not been merged yet?

@heregoesnoth
Copy link

Please! 😭

@hao-yao hao-yao merged commit 2fb42aa into intel:master Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build fails on 6.1-rc5
5 participants