Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Kernel doesn't load on Lenovo X1 Carbon 12th Gen [SOLVED]
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
nagmat84
Apprentice
Apprentice


Joined: 27 Mar 2007
Posts: 293

PostPosted: Wed Nov 27, 2024 6:18 pm    Post subject: Reply with quote

pietinger wrote:
If this is true then mostly PINCTRL was missing (in our dist-kernel all Intel-pinctrl-modules are configured statically, so you dont see it with "lsmod") ... and i2c needs pinctrl.
I enabled all CONFIG_PINCTRL_* below the Intel sub-menu as modules now. Let's see what is needed. It is compiling.

pietinger wrote:
Hmmm ... have you made number 2 of -> ?
https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_kernel_configuration#Before_you_start

If you dont find a module, try to search it in "make menuconfig" with a /
(see also: https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_kernel_configuration#Basics )
You mean whether I had a look at "lsmod" of a distribution kernel, first? Yes, I did. I also know that I can search with "/" inside menuconfig. In addition, I also run "egrep --recursive --include='Makefile' -i -e 'CONFIG.*<name-of-the-module>.*\.o' /usr/src/linux" to find the CONFIG option which is responsible for building the object file of the module for any module which was reported by "lsmod". I enabled all these CONFIG options as modules (=m) in order to have them (just to be on the safe side). I will deactivate any superfluous module later. Unfortunately, if something is statically built into the distribution kernel like PINCTRL (see above), "lsmod" does not report it.

pietinger wrote:
Type there: "IPU6" ... and yes its a module for your video camera :lol: ... and then these errors "int3472-discrete INT3472 ..." should be gone also.

I actually did that, but for 6.11.8 and I was under the impression to have enabled it. For some reason, sine version 6.12.1 IPU6 has started to depend on ARCH_HAS_DMA_OPS which is only implicitly enabled if one enables GART_IOMMU or XEN. IMHO, this feels like a regression bug, because GART_IOMMU is for AMD and I don't need Xen guest support. I reported that issue upstream. Anyway, I enabled Xen guest support (as a work-around) and re-enabled IPU6 afterwards.

pietinger wrote:
Maybe you need # CONFIG_SERIAL_MULTI_INSTANTIATE is not set (you should see in your "lsmod" list) ?
I have also enabled that as a module now (just to be save). It is compiling.

pietinger wrote:
Do you have emerged sys-firmware/sof-firmware for your sound? (If yes, we have a little problem ... maybe your machine is too new). If no, it should be the reason for the different capability of Meteor Lake-P HD Audio Controller.
Yes, I did. If you have a look at the dmesg output for the distribution kernel, you'll find
Code:
Loading firmware: intel/sof-ipc4/mtl/sof-mtl.ri
Loading firmware: intel/sof-ace-tplg/sof-hda-generic-2ch.tplg
Loading firmware: intel/sof-ipc4/mtl/sof-mtl.ri
sof-audio-pci-intel-mtl 0000:00:1f.3: Loaded firmware library: ADSPFW, version: 2.11.1.1
sof-audio-pci-intel-mtl 0000:00:1f.3: Booted firmware version: 2.11.1.1
Loading firmware: intel/sof-ace-tplg/sof-hda-generic-2ch.tplg
Sound works with the distribution kernel. So probably something is missing again which may be statically compiled into the distribution kernel and hence is not reported by "lsmod".

pietinger wrote:
You have a Synopsys Desingware PCI Controller ... you will need for your touchpad (yes, you have everything for it already configured, except designware):
* I2C_DESIGNWARE_PCI
* I2C_DESIGNWARE_PLATFORM
and maybe also:
* PCIE_INTEL_GW
* SPI_DESIGNWARE (?? here I am very unsure)
I enabled everything as a module (just to be on the safe side.) Additionally, I enabled everything as a module with "ELAN" in its name, because the distribution kernel reported something by that name. I also enabled everything as modules below "special HID devices". It's compiling.

pietinger wrote:
The rest of the system log looks really good. :D
OK, even though MSI is disabled for the audio controller?
Back to top
View user's profile Send private message
nagmat84
Apprentice
Apprentice


Joined: 27 Mar 2007
Posts: 293

PostPosted: Wed Nov 27, 2024 6:28 pm    Post subject: Reply with quote

For the sake of completeness: i2cdetect for 6.12.1 distribution kernel: https://pastebin.com/eeGGhUu4 But I don't know how to interpret the output.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5257
Location: Bavaria

PostPosted: Wed Nov 27, 2024 8:36 pm    Post subject: Reply with quote

nagmat84 wrote:
[...] I enabled everything as a module (just to be on the safe side.) [...]

I don't know if this is sufficient (unfortunately I can't test it, due to the lack of a notebook with such a PCI crontroller) ... maybe there is a reason why it is statically built into our dist-kernel.

But what comes to my mind: If you boot an Ubuntu LiveCD and check with “lsmod” you will see more there, because Ubuntu has much more built in as <M>odule (AFAIK also pinctrl and designware).

nagmat84 wrote:
[...] OK, even though MSI is disabled for the audio controller?

I guess it changes if we have all SOF-firmware in the kernel (and then no -2 error code while loading; saying it is missed).
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
nagmat84
Apprentice
Apprentice


Joined: 27 Mar 2007
Posts: 293

PostPosted: Thu Nov 28, 2024 7:07 pm    Post subject: Reply with quote

I am finally getting somewhere :D
pietinger wrote:
nagmat84 wrote:
[...] I enabled everything as a module (just to be on the safe side.) [...]
I don't know if this is sufficient (unfortunately I can't test it, due to the lack of a notebook with such a PCI crontroller) ... maybe there is a reason why it is statically built into our dist-kernel.
It was sufficient. :D (This gives me the chance to re-disable the needless bits again.)

pietinger wrote:
nagmat84 wrote:
[...] OK, even though MSI is disabled for the audio controller?
I guess it changes if we have all SOF-firmware in the kernel (and then no -2 error code while loading; saying it is missed).
Indeed it worked. :D Now, I have:
Code:
00:1f.3 Audio device: Intel Corporation Meteor Lake-P HD Audio Controller (rev 20) (prog-if 80)
   Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+


Still, some pieces are missing. Foremost, IPU6 (for the webcam) is not working. The driver for the PCI device is not loaded:
Code:
00:05.0 Multimedia controller: Intel Corporation Meteor Lake IPU (8086:7d19) (rev 04)
        Subsystem: Lenovo Device 231e
        Flags: fast devsel, IRQ 16, IOMMU group 3
        Memory at 4059000000 (64-bit, non-prefetchable) [size=16M]
        Capabilities: [70] Express Root Complex Integrated Endpoint, IntMsgNum 0
        Capabilities: [ac] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [d0] Power Management version 3
        Capabilities: [100] Address Translation Service (ATS)
Which is probably a direct result of:
Code:
intel-ipu6 0000:00:05.0: enabling device (0000 -> 0002)
intel-ipu6 0000:00:05.0: IPU6 in secure mode touch 0x80000000 mask 0x0
Loading firmware: intel/ipu/ipu6epmtl_fw.bin
intel-ipu6 0000:00:05.0: FW version: 20230925
intel-ipu6 0000:00:05.0: Found supported sensor OVTI08F4:00
intel-ipu6 0000:00:05.0: Connected 1 cameras
intel-ipu6 0000:00:05.0: Sending BOOT_LOAD to CSE
intel-ipu6 0000:00:05.0: Sending AUTHENTICATE_RUN to CSE
intel-ipu6 0000:00:05.0: expected resp: 0x2, IPC response: 0xd20
intel-ipu6 0000:00:05.0: CSE authenticate_run failed
intel-ipu6 0000:00:05.0: error -EIO: FW authentication failed
intel-ipu6 0000:00:05.0: probe with driver intel-ipu6 failed with error -5
With the distribution kernel I get:
Code:

intel-ipu6 0000:00:05.0: enabling device (0000 -> 0002)
intel-ipu6 0000:00:05.0: IPU6 in secure mode touch 0x80000000 mask 0x0
Loading firmware: intel/ipu/ipu6epmtl_fw.bin
intel-ipu6 0000:00:05.0: FW version: 20230925
intel-ipu6 0000:00:05.0: Found supported sensor OVTI08F4:00
intel-ipu6 0000:00:05.0: Connected 1 cameras
intel-ipu6 0000:00:05.0: Sending BOOT_LOAD to CSE
intel-ipu6 0000:00:05.0: Sending AUTHENTICATE_RUN to CSE
intel-ipu6 0000:00:05.0: CSE authenticate_run done
intel-ipu6 0000:00:05.0: IPU6-v4[7d19] hardware version 6
It is reproducible. I do not know what is missing.

Moreover, there are some minor difference. But everything seems to work, so I am not sure whether I should care.

The custom kernel still prints
Code:
Advanced Linux Sound Architecture Driver Initialized.
  No soundcards found.
But I have sound.

There are still differences in the number and name of input devices:
  • The distribution kernel identifies the trackpoint as "TPPS/2 Elan Trackpoint" while the custom kernel identifies it as "PS/2 Generic Mouse"
  • Only the distribution kernel finds the touchscreen, the custom kernel does not (but it is working for some reason)
  • The distribution kernel registers the mouse (which mouse? maybe touchscreen?) and the touchpad twice each, while the custom kernel registers each one only once
Here is the comparison between distribution kernel (-) and custom kernel (+). I reordered the line for easier comparison:
Code:
-input: TPPS/2 Elan TrackPoint as /devices/platform/i8042/serio1/input/input5
+input: PS/2 Generic Mouse as /devices/platform/i8042/serio1/input/input11

-input: ELAN901C:00 04F3:4250 Touchscreen as /devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-1/i2c-ELAN901C:00/0018:04F3:4250.0002/input/input7
-input: ELAN901C:00 04F3:4250 as /devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-1/i2c-ELAN901C:00/0018:04F3:4250.0002/input/input8
-input: ELAN901C:00 04F3:4250 as /devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-1/i2c-ELAN901C:00/0018:04F3:4250.0002/input/input9

-input: ELAN06D4:00 04F3:32B5 Mouse as /devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/i2c-ELAN06D4:00/0018:04F3:32B5.0003/input/input11
-input: ELAN06D4:00 04F3:32B5 Mouse as /devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/i2c-ELAN06D4:00/0018:04F3:32B5.0003/input/input18
+input: ELAN06D4:00 04F3:32B5 Mouse as /devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-15/i2c-ELAN06D4:00/0018:04F3:32B5.0005/input/input14

-input: ELAN06D4:00 04F3:32B5 Touchpad as /devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/i2c-ELAN06D4:00/0018:04F3:32B5.0003/input/input13
-input: ELAN06D4:00 04F3:32B5 Touchpad as /devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/i2c-ELAN06D4:00/0018:04F3:32B5.0003/input/input20
+input: ELAN06D4:00 04F3:32B5 Touchpad as /devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-15/i2c-ELAN06D4:00/0018:04F3:32B5.0005/input/input16


Output for ACPI still differs
Code:
- acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI EDR HPX-Type3]
+ acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI     HPX-Type3]
- acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug SHPCHotplug PME PCIeCapability LTR DPC]
+ acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug             PME PCIeCapability LTR    ]
I don't know if this might be related to the problem of loading the IPU6 firmware or if this is unrelated.

Three additional PCI devices are still without a driver (but that is identical to the distribution kernel):
Code:
00:08.0 System peripheral: Intel Corporation Meteor Lake-P Gaussian & Neural-Network Accelerator (8086:7e4c) (rev 20)
        Subsystem: Lenovo Device 231e
        Flags: fast devsel, IRQ 255, IOMMU group 8
        Memory at 405b724000 (64-bit, non-prefetchable) [disabled] [size=4K]
        Capabilities: [90] MSI: Enable- Count=1/1 Maskable- 64bit-
        Capabilities: [a0] Vendor Specific Information: Len=14 <?>
        Capabilities: [dc] Power Management version 2
        Capabilities: [f0] PCI Advanced Features

00:14.2 RAM memory: Intel Corporation Device 7e7f (8086:7e7f) (rev 20)
        Subsystem: Lenovo Device 231e
        Flags: fast devsel, IOMMU group 13
        Memory at 405b718000 (64-bit, non-prefetchable) [size=16K]
        Memory at 405b720000 (64-bit, non-prefetchable) [size=4K]
        Capabilities: [80] Power Management version 3

00:1f.0 ISA bridge: Intel Corporation Device 7e03 (8086:7e03) (rev 20)
        Subsystem: Lenovo Device 231e
        Flags: bus master, fast devsel, latency 0, IOMMU group 18
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3461
Location: Canada

PostPosted: Thu Nov 28, 2024 8:24 pm    Post subject: Reply with quote

This 'no soundcards found' I even have on my current old 2017 Thinkpad X1 with 5.15 kernel

dmesg gives

Code:

     0.693440] ALSA device list:
[    0.694092]   No soundcards found.
[    0.700087] snd_hda_codec_conexant hdaudioC0D0: CX8200: BIOS auto-probing.
[    0.701120] snd_hda_codec_conexant hdaudioC0D0: vmaster hook already present before cdev!
[    0.701785] snd_hda_codec_conexant hdaudioC0D0: autoconfig for CX8200: line_outs=1 (0x17/0x0/0x0/0x0/0x0) ty
.....


and sound is working perfectly

I also do not have a driver for ISA bridge.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5257
Location: Bavaria

PostPosted: Thu Nov 28, 2024 8:33 pm    Post subject: Reply with quote

nagmat84 wrote:
I am finally getting somewhere :D [...]

Still, some pieces are missing. Foremost, IPU6 (for the webcam) is not working. The driver for the PCI device is not loaded:
Code:
[...]
intel-ipu6 0000:00:05.0: Connected 1 cameras
intel-ipu6 0000:00:05.0: Sending BOOT_LOAD to CSE
intel-ipu6 0000:00:05.0: Sending AUTHENTICATE_RUN to CSE
intel-ipu6 0000:00:05.0: expected resp: 0x2, IPC response: 0xd20
intel-ipu6 0000:00:05.0: CSE authenticate_run failed
intel-ipu6 0000:00:05.0: error -EIO: FW authentication failed
intel-ipu6 0000:00:05.0: probe with driver intel-ipu6 failed with error -5

What I always do is googling for messages I dont know (with a "Linux" tag). So I googled "Linux Sending AUTHENTICATE_RUN to CSE" ... and found no senseful result ... but ...

Googling for "Linux Sending BOOT_LOAD to CSE" gave me a hit to an Arch forums post: https://bbs.archlinux.org/viewtopic.php?id=297262

... and there was mentionend "udmabuf" ... and there exists CONFIG_UDMABUF in our Linux kernel ... I would give it a try ;-)
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5257
Location: Bavaria

PostPosted: Thu Nov 28, 2024 8:59 pm    Post subject: Reply with quote

nagmat84 wrote:
[...] The distribution kernel registers the mouse (which mouse? maybe touchscreen?) and the touchpad twice each, while the custom kernel registers each one only once [...]

I guess it is because in our dist kernel CONFIG_MOUSE_PS2_ELANTECH and CONFIG_MOUSE_PS2_ELANTECH_SMBUS are enabled also ... but you dont need it as PS/2 device when you have EVDEV.
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
nagmat84
Apprentice
Apprentice


Joined: 27 Mar 2007
Posts: 293

PostPosted: Fri Nov 29, 2024 8:11 pm    Post subject: Reply with quote

pietinger wrote:
I guess it is because in our dist kernel CONFIG_MOUSE_PS2_ELANTECH and CONFIG_MOUSE_PS2_ELANTECH_SMBUS are enabled also ... but you dont need it as PS/2 device when you have EVDEV.
Ok, so I will simply ignore it.
pietinger wrote:
.. and there was mentionend "udmabuf" ... and there exists CONFIG_UDMABUF in our Linux kernel ... I would give it a try ;-)
I did, nothing changed. "Linux Sending AUTHENTICATE_RUN to CSE" is still failing. :(
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5257
Location: Bavaria

PostPosted: Fri Nov 29, 2024 8:53 pm    Post subject: Reply with quote

nagmat84 wrote:
pietinger wrote:
.. and there was mentionend "udmabuf" ... and there exists CONFIG_UDMABUF in our Linux kernel ... I would give it a try ;-)
I did, nothing changed. "Linux Sending AUTHENTICATE_RUN to CSE" is still failing. :(

Sad ... last chance is now to inspect the source code of this module or asking the developer of this module ... (TBH I am also of the opinion that there is an error in the Kconfig system, because actually enabling this module should also select all dependencies).
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
nagmat84
Apprentice
Apprentice


Joined: 27 Mar 2007
Posts: 293

PostPosted: Sat Nov 30, 2024 6:50 pm    Post subject: Reply with quote

To properly close this thread, one last post from my side. Many thanks to @pietinger for the help.

I finally got a booting (yeah!) and monolithic kernel which only contains the necessary drivers. I spent the last day reverting all added functionality step-by-step. Indeed, both options
Code:
CONFIG_X86_X2APIC=y
CONFIG_X86_INTEL_LPSS=y
are both mandatory for the Lenovo X1 Carbon 12th Gen to be bootable. "CONFIG_X86_INTEL_TSX_MODE_AUTO" (the default) suffices, also "CONFIG_AGP", "CONFIG_FB_VESA", "CONFIG_FB_EFI", "CONFIG_CPUSETS_V1" and all the other options which we set along the way for safety reasons are not necessary.

For anyone who wants to re-build my kernel, here is the final, monolithic configuration: https://pastebin.com/QGB8K3Jt.

Unfortunately, I was not able to get the IPU6 camera to work. The firmware doesn't load, because CSE (Intel Converged Security Engine) does not authenticate the camera firmware.
pietinger wrote:
Sad ... last chance is now to inspect the source code of this module or asking the developer of this module ... (TBH I am also of the opinion that there is an error in the Kconfig system, because actually enabling this module should also select all dependencies).
I share your opinion. I filed a bug report here: https://github.com/intel/ipu6-drivers/issues/306

If anybody wonders why I have enabled Xen support in the kernel, there is an additional dependency bug in kernel 6.12.1 which only allows IPU6 to be built if either AMD or Xen is enabled. Bug report can be found here: https://bugzilla.kernel.org/show_bug.cgi?id=219534, https://github.com/intel/ipu6-drivers/issues/303. The bug fix will be included in 6.13 and hopefully gets back ported.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5257
Location: Bavaria

PostPosted: Sat Nov 30, 2024 7:38 pm    Post subject: Reply with quote

nagmat84 wrote:
To properly close this thread, one last post from my side. Many thanks to @pietinger for the help. [...]

You are very Welcome ... and thank you very much for your detailed feedback. :D

(I will also be watching the bug reports.)
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3461
Location: Canada

PostPosted: Sun Dec 01, 2024 11:56 pm    Post subject: Reply with quote

Thank you very much (looking at still unopened box of X1 Gen 12)
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5257
Location: Bavaria

PostPosted: Thu Dec 05, 2024 1:36 pm    Post subject: Reply with quote

It looks like the fixes have been ported back.
6.12.2 contains 3 patches for IPU. One of them is:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.12.y&id=11b0543efe54357b94dccb88dac2099c59358cd4
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum