Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 May 2021 16:14:25 +0200
From:      Hans Petter Selasky <hps@selasky.org>
To:        lev@FreeBSD.org, freebsd-usb@freebsd.org
Subject:   Re: Flickering connection to UPS (again, but now I'm sure it is Ok under Windows)
Message-ID:  <0814e5e8-45dd-14c8-3206-40eab0dc286e@selasky.org>
In-Reply-To: <9a7b3be1-d606-cca6-d6c0-7ebefdfd4753@FreeBSD.org>
References:  <e90a1125-1c85-4344-2427-aa50158036fc@FreeBSD.org> <98420b49-dc9a-0a5f-bcfe-e0a0e11a5994@selasky.org> <0c52bcf1-3b1a-a746-9ac3-26bdb4c46354@FreeBSD.org> <6e52d05d-8668-8c38-6745-a4edec50741d@selasky.org> <9a7b3be1-d606-cca6-d6c0-7ebefdfd4753@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 5/7/21 1:55 PM, Lev Serebryakov wrote:
> On 06.05.2021 21:07, Hans Petter Selasky wrote:
> 
>> What does usbconfig say?
> Ok, now I have laptop with fresh CURRENT. Its usbconfig says 
> (without/with UPS):
> 
> ugen1.1: <Intel EHCI root HUB> at usbus1, cfg=0 md=HOST spd=HIGH 
> (480Mbps) pwr=SAVE (0mA)
> ugen0.1: <0x8086 XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER 
> (5.0Gbps) pwr=SAVE (0mA)
> ugen2.1: <Intel EHCI root HUB> at usbus2, cfg=0 md=HOST spd=HIGH 
> (480Mbps) pwr=SAVE (0mA)
> ugen0.2: <Generic EMV Smartcard Reader> at usbus0, cfg=0 md=HOST 
> spd=FULL (12Mbps) pwr=ON (50mA)
> ugen1.2: <vendor 0x8087 product 0x8008> at usbus1, cfg=0 md=HOST 
> spd=HIGH (480Mbps) pwr=SAVE (0mA)
> ugen2.2: <vendor 0x8087 product 0x8000> at usbus2, cfg=0 md=HOST 
> spd=HIGH (480Mbps) pwr=SAVE (0mA)
> ugen0.3: <vendor 0x138a product 0x0017> at usbus0, cfg=0 md=HOST 
> spd=FULL (12Mbps) pwr=ON (100mA)
> ugen0.4: <vendor 0x8087 product 0x07dc> at usbus0, cfg=0 md=HOST 
> spd=FULL (12Mbps) pwr=ON (100mA)
> ugen0.5: <SunplusIT INC. Integrated Camera> at usbus0, cfg=0 md=HOST 
> spd=HIGH (480Mbps) pwr=ON (500mA)
> 
> ugen1.1: <Intel EHCI root HUB> at usbus1, cfg=0 md=HOST spd=HIGH 
> (480Mbps) pwr=SAVE (0mA)
> ugen0.1: <0x8086 XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER 
> (5.0Gbps) pwr=SAVE (0mA)
> ugen2.1: <Intel EHCI root HUB> at usbus2, cfg=0 md=HOST spd=HIGH 
> (480Mbps) pwr=SAVE (0mA)
> ugen0.2: <Generic EMV Smartcard Reader> at usbus0, cfg=0 md=HOST 
> spd=FULL (12Mbps) pwr=ON (50mA)
> ugen1.2: <vendor 0x8087 product 0x8008> at usbus1, cfg=0 md=HOST 
> spd=HIGH (480Mbps) pwr=SAVE (0mA)
> ugen2.2: <vendor 0x8087 product 0x8000> at usbus2, cfg=0 md=HOST 
> spd=HIGH (480Mbps) pwr=SAVE (0mA)
> ugen0.3: <vendor 0x138a product 0x0017> at usbus0, cfg=0 md=HOST 
> spd=FULL (12Mbps) pwr=ON (100mA)
> ugen0.4: <vendor 0x8087 product 0x07dc> at usbus0, cfg=0 md=HOST 
> spd=FULL (12Mbps) pwr=ON (100mA)
> ugen0.5: <SunplusIT INC. Integrated Camera> at usbus0, cfg=0 md=HOST 
> spd=HIGH (480Mbps) pwr=ON (500mA)
> ugen0.6: <PPC Offline UPS> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) 
> pwr=ON (100mA)
> 
>> Can you enable host controller debugging:
>>
>> hw.usb.xhci.debug=17
>> hw.usb.ehci.debug=17
>> hw.usb.uhci.debug=17
>> hw.usb.ohci.debug=17
> 
> 900Kb of dump from first connect to last disconnect is here:
> http://lev.serebryakov.spb.ru/_sklad/ups-flickr-one-cycle.txt
> 

Hi Lev,

> ster kernel: xhci_roothub_exec: port status=0x000202a0
> May  7 14:39:08 hamster kernel: xhci_roothub_exec: type=0x23 request=0x01 wLen=0x0000 wValue=0x0010 wIndex=0x0002
> May  7 14:39:08 hamster kernel: xhci_roothub_exec: UR_CLEAR_PORT_FEATURE
> May  7 14:39:08 hamster kernel: xhci_device_state_change: 
> May  7 14:39:08 hamster kernel: ugen0.6: <PPC Offline UPS> at usbus0 (disconnected)

The value reported by XHCI PORTSC, 0x000202a0, indicates:

BIT5-8 : 5) Link is in the RxDetect State
BIT9 : Port Power (PP) – RWS. Default = ‘1’
BIT17 : Connect Status Change (CSC)

It is clear that the XHCI controller has received a disconnect event 
from the UPS.

Can you check the other OS'es where this supposedly does not happen, if 
the UPS device attaches to the XHCI or EHCI controller?

Did you start any driver for the UPS?

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0814e5e8-45dd-14c8-3206-40eab0dc286e>