Thanks for the great work!

Hotplugging thunderbolt docks definitely work better, but I still have a
couple issues.
Before I start, here is some info about my setup.

I use KDE on Arch Linux, but it shouldn't affect the problem. uname -a prints: 
Linux MyPC 6.1.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 21 Dec 2022 22:27:55 +0000 
x86_64 GNU/Linux

Regarding BIOS, I am running the non-standard Lenovo C940 BIOS that some
Lenovo engineer temporarily released on their forum to fix the speakers
on Linux (version AUCN57WW).

My dock is a "Kensington SD5500T/SD5550T Thunderbolt 3 and USB-C Docking
Station".

But now to the issues.

First: The fix currently mainlined in the kernel doesn't work for me.
After comparing the file arch/x86/pci/acpi.c on github with the result
of dmidecode (see below), I think it the check for DMI_PRODUCT_VERSION
should be changed to checking the product family. It could potentially
be related to my non-standard BIOS version, but I can't check that.

Second: Since the current fix didn't apply to my computer, I tried compiling 
the kernel myself and applying the patch from comment #62.
My dock has both a USB hub and display outputs, and on the non-patched kernel, 
if I tried hotplugging it, the USB hub didn't work, but the external displays 
always did (and sometimes the computer crashed).
On the patched kernel, if I hotplug, the USB hub always works, and I haven't 
experienced any crashes, but the external displays aren't recognized. More 
specifically, if the dock is unplugged when booting and I then hotplug it, they 
aren't recognized. If instead the computer is docked while booting, the 
displays work, and if I unplug the dock and then replug it within ~5-10 
seconds, the displays are recognized again. If I instead have the dock 
unplugged for a minute or so, the displays are not recognized when replugging 
the dock.
I have tried running lspci -vv, and the output differs between if the computer 
was docked on boot and after it was un- and replugged, but it doesn't differ 
between if the external displays are recognized or not.

I would attach dmesg and lspci -xxxx, but I cannot figure out how to
create attachments, so please help me if you need that info. And please
specify under which conditions you want the logs. :)

--- dmidecode ---
Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: LENOVO
        Product Name: 81Q9
        Version: Yoga C940
        Serial Number: [...]
        UUID: [...]
        Wake-up Type: Power Switch
        SKU Number: LENOVO_MT_81Q9_BU_idea_FM_Yoga C940-14IIL
        Family: Yoga C940-14IIL

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1860284

Title:
  thinkpad thunderbolt 3 dock gen2 with pci memory allocation errors on
  Yoga C940 unless plugged in before boot

Status in Linux:
  Confirmed
Status in linux package in Ubuntu:
  Confirmed

Bug description:
  I have thinkpad thunderbolt 3 dock gen2 dock I am trying to use with a
  New Lenovo Yoga C940 laptop.

  - The dock works fine when plugged-in before boot.
  - The dock does NOT work when plugged after the system booted.
  - The dock does NOT work when plugged-in at boot, subsequently unplugged and 
plugged back in.

  When it fails, it fails with memory allocation messages such as:

  [  342.507320] pci 0000:2b:00.0: BAR 14: no space for [mem size 0x0c200000]
  [  342.507323] pci 0000:2b:00.0: BAR 14: failed to assign [mem size 
0x0c200000]

  Things I tried:
  - Kernel mainline 5.4.12, same symptoms
  - Kernel mainline 5.5.-rc6, 
  same symptoms.
  - Plugging it after powering up the laptop, but at the grub screen before 
boot.  In this case the dock works fine after boot.

  
  Other potentially useful information to narrow it down:

  - The tests were done with only an ethernet cable and power plugged into the 
dock to minimize the number of moving parts...
  - Dock and laptop both have the very latest firmware as of 2020-01-17.
  - The displayport part of the dock always work, but all other ports (USB, 
ethernet, card readers fail) when plugged-in after boot.
  - Doesn't seem to be a thunderbolt authorization problem:
  benoitg@benoitg-Yoga-C940:~$ boltctl 
   ? Lenovo ThinkPad Thunderbolt 3 Dock
     ?? type:          peripheral
     ?? name:          ThinkPad Thunderbolt 3 Dock
     ?? vendor:        Lenovo
     ?? uuid:          001730c5-7042-0801-ffff-ffffffffffff
     ?? status:        authorized
     ?  ?? domain:     c06e823d-af8a-8680-ffff-ffffffffffff
     ?  ?? authflags:  none
     ?? authorized:    Sun Jan 19 17:41:04 2020
     ?? connected:     Sun Jan 19 17:41:04 2020
     ?? stored:        Thu Jan 16 07:27:43 2020
        ?? policy:     iommu
        ?? key:        no

  ProblemType: Bug
  DistroRelease: Ubuntu 19.10
  Package: linux-image-5.3.0-26-generic 5.3.0-26.28
  ProcVersionSignature: Ubuntu 5.3.0-26.28-generic 5.3.13
  Uname: Linux 5.3.0-26-generic x86_64
  ApportVersion: 2.20.11-0ubuntu8.2
  Architecture: amd64
  AudioDevicesInUse:
   USER        PID ACCESS COMMAND
   /dev/snd/controlC0:  benoitg    1182 F.... pulseaudio
  CurrentDesktop: KDE
  Date: Sun Jan 19 12:38:17 2020
  InstallationDate: Installed on 2020-01-16 (3 days ago)
  InstallationMedia: Kubuntu 19.10 "Eoan Ermine" - Release amd64 (20191017)
  MachineType: LENOVO 81Q9
  ProcFB: 0 i915drmfb
  ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.3.0-26-generic 
root=UUID=078b76d6-6b72-4de4-9e10-f6ea33d9bc1a ro
  RelatedPackageVersions:
   linux-restricted-modules-5.3.0-26-generic N/A
   linux-backports-modules-5.3.0-26-generic  N/A
   linux-firmware                            1.183.3
  SourcePackage: linux
  UpgradeStatus: No upgrade log present (probably fresh install)
  dmi.bios.date: 08/22/2019
  dmi.bios.vendor: LENOVO
  dmi.bios.version: AUCN45WW
  dmi.board.asset.tag: NO Asset Tag
  dmi.board.name: LNVNB161216
  dmi.board.vendor: LENOVO
  dmi.board.version: SDK0J40709 WIN
  dmi.chassis.asset.tag: NO Asset Tag
  dmi.chassis.type: 31
  dmi.chassis.vendor: LENOVO
  dmi.chassis.version: Lenovo Yoga C940-14IIL
  dmi.modalias: 
dmi:bvnLENOVO:bvrAUCN45WW:bd08/22/2019:svnLENOVO:pn81Q9:pvrLenovoYogaC940-14IIL:rvnLENOVO:rnLNVNB161216:rvrSDK0J40709WIN:cvnLENOVO:ct31:cvrLenovoYogaC940-14IIL:
  dmi.product.family: Yoga C940-14IIL
  dmi.product.name: 81Q9
  dmi.product.sku: LENOVO_MT_81Q9_BU_idea_FM_Yoga C940-14IIL
  dmi.product.version: Lenovo Yoga C940-14IIL
  dmi.sys.vendor: LENOVO

To manage notifications about this bug go to:
https://bugs.launchpad.net/linux/+bug/1860284/+subscriptions


-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to