From owner-freebsd-usb@freebsd.org Fri May 7 14:15:42 2021 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B848B62F7DB for ; Fri, 7 May 2021 14:15:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FcCCf483gz4gGC; Fri, 7 May 2021 14:15:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id A9726260B7D; Fri, 7 May 2021 16:15:40 +0200 (CEST) Subject: Re: Flickering connection to UPS (again, but now I'm sure it is Ok under Windows) To: lev@FreeBSD.org, freebsd-usb@freebsd.org References: <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> From: Hans Petter Selasky Message-ID: <0814e5e8-45dd-14c8-3206-40eab0dc286e@selasky.org> Date: Fri, 7 May 2021 16:14:25 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: <9a7b3be1-d606-cca6-d6c0-7ebefdfd4753@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4FcCCf483gz4gGC X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 May 2021 14:15:42 -0000 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: 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: at usbus2, cfg=0 md=HOST spd=HIGH > (480Mbps) pwr=SAVE (0mA) > ugen0.2: at usbus0, cfg=0 md=HOST > spd=FULL (12Mbps) pwr=ON (50mA) > ugen1.2: at usbus1, cfg=0 md=HOST > spd=HIGH (480Mbps) pwr=SAVE (0mA) > ugen2.2: at usbus2, cfg=0 md=HOST > spd=HIGH (480Mbps) pwr=SAVE (0mA) > ugen0.3: at usbus0, cfg=0 md=HOST > spd=FULL (12Mbps) pwr=ON (100mA) > ugen0.4: at usbus0, cfg=0 md=HOST > spd=FULL (12Mbps) pwr=ON (100mA) > ugen0.5: at usbus0, cfg=0 md=HOST > spd=HIGH (480Mbps) pwr=ON (500mA) > > ugen1.1: 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: at usbus2, cfg=0 md=HOST spd=HIGH > (480Mbps) pwr=SAVE (0mA) > ugen0.2: at usbus0, cfg=0 md=HOST > spd=FULL (12Mbps) pwr=ON (50mA) > ugen1.2: at usbus1, cfg=0 md=HOST > spd=HIGH (480Mbps) pwr=SAVE (0mA) > ugen2.2: at usbus2, cfg=0 md=HOST > spd=HIGH (480Mbps) pwr=SAVE (0mA) > ugen0.3: at usbus0, cfg=0 md=HOST > spd=FULL (12Mbps) pwr=ON (100mA) > ugen0.4: at usbus0, cfg=0 md=HOST > spd=FULL (12Mbps) pwr=ON (100mA) > ugen0.5: at usbus0, cfg=0 md=HOST > spd=HIGH (480Mbps) pwr=ON (500mA) > ugen0.6: 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: 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