Re: usb-c port power not reset correctly (can't connect any device after a phone was connected)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Le 09/10/2023 à 20:56, jlmxyz a écrit :

Le 09/10/2023 à 19:58, Greg KH a écrit :
On Mon, Oct 09, 2023 at 12:50:54PM +0200, jlmxyz wrote:
Hi,

my hardware :https://wiki.gentoo.org/wiki/Lenovo_Yoga_900
I use the pre-built gentoo linux kernel,
Linux jlmyoga900 6.5.5-gentoo-dist #1 SMP PREEMPT_DYNAMIC Sat Sep 23 17:31:47 -00 2023 x86_64 Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz GenuineIntel GNU/Linux


output of lsusb, phone connected on usb-c port, phone in "share connection virtual network adaptater mode"
$ lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
     |__ Port 3: Dev 12, If 0, Class=Wireless, Driver=rndis_host, 5000M
     |__ Port 3: Dev 12, If 1, Class=CDC Data, Driver=rndis_host, 5000M
     |__ Port 3: Dev 12, If 2, Class=Vendor Specific Class, Driver=, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
     |__ Port 6: Dev 2, If 0, Class=Video, Driver=uvcvideo, 480M
     |__ Port 6: Dev 2, If 1, Class=Video, Driver=uvcvideo, 480M
     |__ Port 7: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
     |__ Port 7: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M

output of lsusb, micro sd card connected on usb-c port using usb-A-usb-c adaptater (works on the phone),
$ lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
     |__ Port 6: Dev 2, If 0, Class=Video, Driver=uvcvideo, 480M
     |__ Port 6: Dev 2, If 1, Class=Video, Driver=uvcvideo, 480M
     |__ Port 7: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
     |__ Port 7: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M

output of lsusb, micro sd card connected on usb-A port,
$ lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
     |__ Port 2: Dev 13, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
     |__ Port 6: Dev 2, If 0, Class=Video, Driver=uvcvideo, 480M
     |__ Port 6: Dev 2, If 1, Class=Video, Driver=uvcvideo, 480M
     |__ Port 7: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
     |__ Port 7: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M

output of dmesg
---- connecting the phone
[371134.453914] xhci_hcd 0000:00:14.0: WARN Set TR Deq Ptr cmd failed due to incorrect slot or ep state.
[371162.893880] usb usb2-port3: config error
[371163.527330] usb 2-3: new SuperSpeed USB device number 11 using xhci_hcd [371163.544872] usb 2-3: New USB device found, idVendor=04e8, idProduct=685d, bcdDevice= 4.14 [371163.544881] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[371163.544885] usb 2-3: Product: SM-N975F
[371163.544888] usb 2-3: Manufacturer: samsung
[371163.544890] usb 2-3: SerialNumber: RF8M73LKC5E
[371181.443775] usb 2-3: USB disconnect, device number 11
[371181.700584] usb 2-3: new SuperSpeed USB device number 12 using xhci_hcd [371181.718597] usb 2-3: New USB device found, idVendor=04e8, idProduct=6864, bcdDevice= 4.14 [371181.718606] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[371181.718610] usb 2-3: Product: SM-N975F
[371181.718613] usb 2-3: Manufacturer: samsung
[371181.718615] usb 2-3: SerialNumber: RF8M73LKC5E
[371181.843263] usbcore: registered new interface driver cdc_ether
[371181.850720] rndis_host 2-3:1.0 usb0: register 'rndis_host' at usb-0000:00:14.0-3, RNDIS device, 02:24:0a:73:0e:02
[371181.851343] usbcore: registered new interface driver rndis_host
[371181.905461] rndis_host 2-3:1.0 enp0s20f0u3: renamed from usb0
[371275.791820] usb 2-3: USB disconnect, device number 12
[371275.791890] rndis_host 2-3:1.0 enp0s20f0u3: unregister 'rndis_host' usb-0000:00:14.0-3, RNDIS device
----- disconnecting the phone connecting the usb masstorage usb-c port
----- disconnecting the masstorage usb-c - connecting same device on usb-A port next to it [371352.897323] usb 2-2: new SuperSpeed USB device number 13 using xhci_hcd [371352.916934] usb 2-2: New USB device found, idVendor=11b0, idProduct=3307, bcdDevice= 0.13 [371352.916949] usb 2-2: New USB device strings: Mfr=3, Product=4, SerialNumber=2
[371352.916951] usb 2-2: Product: UHSII uSD Reader
[371352.916954] usb 2-2: Manufacturer: Kingston
[371352.916955] usb 2-2: SerialNumber: 202006001890
[371352.919919] usb-storage 2-2:1.0: USB Mass Storage device detected
[371352.939695] scsi host3: usb-storage 2-2:1.0
[371353.951776] scsi 3:0:0:0: Direct-Access     Kingston UHSII uSD Reader 0013 PQ: 0 ANSI: 6
[371353.952333] sd 3:0:0:0: Attached scsi generic sg1 type 0
[371354.333610] sd 3:0:0:0: [sdb] 500695040 512-byte logical blocks: (256 GB/239 GiB)
[371354.334277] sd 3:0:0:0: [sdb] Write Protect is off
[371354.334282] sd 3:0:0:0: [sdb] Mode Sense: 21 00 00 00
[371354.334902] sd 3:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[371354.338703]  sdb: sdb1
[371354.338841] sd 3:0:0:0: [sdb] Attached SCSI removable disk

there is no dmesg entry when connecting on the usb-c as if there was no power
I don't understand, it shows the phone connecting above.

yes the phone is connecting, everything is fine as long as it's the phone, this shows that the port is working


I tried on phone to change the device powering the port, but I always get error, when connecting the phone, even if it is in "charge only" mode, the battery icon don't show any charging information.... looks like the port is always powered by the phone and the first time the device powering the port is choosen in power negociation, the port will after remain in slave-power mode on the laptop....
Are you sure the phone is handling this properly?  Many times it will
refuse to connect to a host at all until you tell it is safe to do so
somehow (like change the USB mode.)

I will gladely help troubleshooting the issue, having a usb port less over 3 is really problematic
I don't understand this question, sorry.

greg k-h

the issue is that the usb masstorage that should be seen in dmesg between [371275.791890] and [371352.897323] has... not a single line in dmesg, on this port, nothing works appart the phone, usb masstorage? not working. usb jtag dongle? not working. usb uart? not working....

this looks like no device on this pc usb-c port is powered by the port, and on usb-c port the devices can select which is powering the communication, by default the phone will want to power the port since I can connect the masstorage dongle on it (and the masstorage dongle won't be detected unless powered)

this looks like once I connected a phone not in charging mode, the device powering the port is the phone, when I disconnect the phone, the pc port remains in "slave power" and then won't power the port anymore. When I plug the usb masstorage dongle on it, since the port isn't providing power, it don't power the dongle and then there is no detection of the dongle....

best regards

Hi,

the issue is getting worst since 2 kernel upgrade....

Linux jlmyoga900 6.6.11-gentoo-dist #1 SMP PREEMPT_DYNAMIC Wed Jan 10 19:01:59 -00 2024 x86_64 Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz GenuineIntel GNU/Linux

as shown in following log after reboot, I connect a Kingston UHSII uSD Reader on the usb-c port of the laptop, this works fine

then I try to connect the phone, now the phone never connect, it goes into charging but in usb settings of the phone I can't activate any mode... in the log we can see that it was detected as "USB Abstract Control Model driver for USB modems and ISDN adapters" and then disconnected then "Cannot enable. Maybe the USB cable is bad?" so I tested by reconnecting the kingston reader, but with the cable between, and this works, so this in not the cable....

the phone seems to want to control the link, I still don't know how to change on the laptop who control the link.... seems that laptop kernel don't accept config also

there is also "usb usb2-port3: config error" in the log, which I suspect to be linked with the phone wanting to control the link, since it was the error I was previously getting when trying to change the device controlling the link on phone in previous kernel....

now I can't connect the phone anymore but I'm able to connect "passive" devices such as usb-mass storage. this is the opposite of previous behavior and more annoying, since on previous behavior I could connect passive devices on another port...

[49873.068726] usb 2-3: new SuperSpeed USB device number 2 using xhci_hcd
[49873.090818] usb 2-3: New USB device found, idVendor=11b0, idProduct=3307, bcdDevice= 0.13 [49873.090842] usb 2-3: New USB device strings: Mfr=3, Product=4, SerialNumber=2
[49873.090853] usb 2-3: Product: UHSII uSD Reader
[49873.090861] usb 2-3: Manufacturer: Kingston
[49873.090869] usb 2-3: SerialNumber: 202003001154
[49873.202379] usb-storage 2-3:1.0: USB Mass Storage device detected
[49873.202766] scsi host3: usb-storage 2-3:1.0
[49873.203012] usbcore: registered new interface driver usb-storage
[49873.209569] usbcore: registered new interface driver uas
[49874.216208] scsi 3:0:0:0: Direct-Access     Kingston UHSII uSD Reader 0013 PQ: 0 ANSI: 6
[49874.217363] sd 3:0:0:0: Attached scsi generic sg1 type 0
[49874.705892] sd 3:0:0:0: [sdb] 60637184 512-byte logical blocks: (31.0 GB/28.9 GiB)
[49874.707743] sd 3:0:0:0: [sdb] Write Protect is off
[49874.707759] sd 3:0:0:0: [sdb] Mode Sense: 21 00 00 00
[49874.709009] sd 3:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[49874.716248]  sdb: sdb1 sdb2
[49874.716779] sd 3:0:0:0: [sdb] Attached SCSI removable disk
[49882.180378] usb 2-3: USB disconnect, device number 2
[49899.812016] usb usb2-port3: config error
[49901.284964] usb usb1-port8: Cannot enable. Maybe the USB cable is bad?
[49902.245231] usb usb1-port8: Cannot enable. Maybe the USB cable is bad?
[49902.245405] usb usb1-port8: attempt power cycle
[49903.278353] usb usb1-port8: Cannot enable. Maybe the USB cable is bad?
[49904.244944] usb usb1-port8: Cannot enable. Maybe the USB cable is bad?
[49904.245009] usb usb1-port8: unable to enumerate USB device
[49919.155476] usb usb2-port3: attempt power cycle
[49927.595251] usb usb2-port3: unable to enumerate USB device
[50091.975064] usb 2-2: new SuperSpeed USB device number 7 using xhci_hcd
[50091.996664] usb 2-2: New USB device found, idVendor=04e8, idProduct=685d, bcdDevice= 4.14 [50091.996687] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[50091.996698] usb 2-2: Product: SM-N975F
[50091.996707] usb 2-2: Manufacturer: samsung
[50091.996714] usb 2-2: SerialNumber: RF8M73LKC5E
[50092.125494] usbcore: registered new interface driver cdc_acm
[50092.125500] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[50106.225287] usb 2-2: USB disconnect, device number 7
[50129.468607] usb usb2-port2: attempt power cycle
[50137.908640] usb usb2-port2: unable to enumerate USB device
[50167.625588] usb usb2-port2: attempt power cycle
[50176.065425] usb usb2-port2: unable to enumerate USB device
[50201.808733] usb usb2-port2: attempt power cycle
[50210.252028] usb usb2-port2: unable to enumerate USB device
[50227.514986] usb usb1-port8: Cannot enable. Maybe the USB cable is bad?
[50228.478536] usb usb1-port8: Cannot enable. Maybe the USB cable is bad?
[50228.478724] usb usb1-port8: attempt power cycle
[50229.511773] usb usb1-port8: Cannot enable. Maybe the USB cable is bad?
[50230.471787] usb usb1-port8: Cannot enable. Maybe the USB cable is bad?
[50230.471985] usb usb1-port8: unable to enumerate USB device
[50631.048307] usb usb2-port3: config error
[50632.521689] usb usb1-port8: Cannot enable. Maybe the USB cable is bad?
[50633.488480] usb usb1-port8: Cannot enable. Maybe the USB cable is bad?
[50633.488716] usb usb1-port8: attempt power cycle
[50634.521697] usb usb1-port8: Cannot enable. Maybe the USB cable is bad?
[50635.485032] usb usb1-port8: Cannot enable. Maybe the USB cable is bad?
[50635.485230] usb usb1-port8: unable to enumerate USB device
[50677.431762] usb usb2-port3: attempt power cycle
[50685.878596] usb usb2-port3: unable to enumerate USB device
[50711.275252] usb usb2-port3: attempt power cycle
[50719.712017] usb usb2-port3: unable to enumerate USB device
[50744.065116] usb usb2-port3: attempt power cycle
[50752.518507] usb usb2-port3: unable to enumerate USB device
[50843.041708] usb 2-3: new SuperSpeed USB device number 35 using xhci_hcd
[50843.067354] usb 2-3: New USB device found, idVendor=11b0, idProduct=3307, bcdDevice= 0.13 [50843.067374] usb 2-3: New USB device strings: Mfr=3, Product=4, SerialNumber=2
[50843.067383] usb 2-3: Product: UHSII uSD Reader
[50843.067390] usb 2-3: Manufacturer: Kingston
[50843.067397] usb 2-3: SerialNumber: 202003001154
[50843.071378] usb-storage 2-3:1.0: USB Mass Storage device detected
[50843.071845] scsi host3: usb-storage 2-3:1.0
[50844.083219] scsi 3:0:0:0: Direct-Access     Kingston UHSII uSD Reader 0013 PQ: 0 ANSI: 6
[50844.084290] sd 3:0:0:0: Attached scsi generic sg1 type 0
[50844.572109] sd 3:0:0:0: [sdb] 60637184 512-byte logical blocks: (31.0 GB/28.9 GiB)
[50844.573623] sd 3:0:0:0: [sdb] Write Protect is off
[50844.573634] sd 3:0:0:0: [sdb] Mode Sense: 21 00 00 00
[50844.575025] sd 3:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[50844.580686]  sdb: sdb1 sdb2
[50844.581107] sd 3:0:0:0: [sdb] Attached SCSI removable disk


Best Regards

JL

Attachment: OpenPGP_0xC83BBBA444E1B7C3.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux