From owner-freebsd-usb@FreeBSD.ORG Tue Jun 3 16:58:03 2014 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A0C3F1A; Tue, 3 Jun 2014 16:58:03 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 131EF2FAD; Tue, 3 Jun 2014 16:58:03 +0000 (UTC) Received: from laptop015.home.selasky.org (unknown [176.74.213.204]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 82D0A1FE027; Tue, 3 Jun 2014 18:58:01 +0200 (CEST) Message-ID: <538DFEA8.3090607@selasky.org> Date: Tue, 03 Jun 2014 18:58:16 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: sbruno@freebsd.org Subject: Re: Lenovo T61, USB fails to power on after resume References: <1401807398.96874.3.camel@bruno> <538DEFD3.2010406@selasky.org> <1401813374.1114.0.camel@bruno> In-Reply-To: <1401813374.1114.0.camel@bruno> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 16:58:03 -0000 On 06/03/14 18:36, Sean Bruno wrote: > On Tue, 2014-06-03 at 17:54 +0200, Hans Petter Selasky wrote: >> On 06/03/14 16:56, Sean Bruno wrote: >>> Noted that on resume, the USB ports on my T61 don't seem to be active. >>> >>> How should I go about debugging this? >>> >>> sean >> >> Hi, >> >> The USB stack performs the same EHCI/OHCI/UHCI/XHCI reset which is does >> during power on, when it resumes. Ensure the ports are powered. +5V. >> Might be a BIOS/PCI/ACPI issue. >> >> --HPS >> > > > Is there something in the output of usbconfig that I can poke at to see > if the hardware *thinks* it is powered on? > > sean > > Yes, there is the port status. struct usb_port_status { uWord wPortStatus; #define UPS_CURRENT_CONNECT_STATUS 0x0001 #define UPS_PORT_ENABLED 0x0002 #define UPS_SUSPEND 0x0004 #define UPS_OVERCURRENT_INDICATOR 0x0008 #define UPS_RESET 0x0010 #define UPS_PORT_L1 0x0020 /* USB 2.0 only */ /* The link-state bits are valid for Super-Speed USB HUBs */ #define UPS_PORT_LINK_STATE_GET(x) (((x) >> 5) & 0xF) #define UPS_PORT_LINK_STATE_SET(x) (((x) & 0xF) << 5) #define UPS_PORT_LS_U0 0x00 #define UPS_PORT_LS_U1 0x01 #define UPS_PORT_LS_U2 0x02 #define UPS_PORT_LS_U3 0x03 #define UPS_PORT_LS_SS_DIS 0x04 #define UPS_PORT_LS_RX_DET 0x05 #define UPS_PORT_LS_SS_INA 0x06 #define UPS_PORT_LS_POLL 0x07 #define UPS_PORT_LS_RECOVER 0x08 #define UPS_PORT_LS_HOT_RST 0x09 #define UPS_PORT_LS_COMP_MODE 0x0A #define UPS_PORT_LS_LOOPBACK 0x0B #define UPS_PORT_LS_RESUME 0x0F #define UPS_PORT_POWER 0x0100 #define UPS_PORT_POWER_SS 0x0200 /* super-speed only */ #define UPS_LOW_SPEED 0x0200 #define UPS_HIGH_SPEED 0x0400 #define UPS_OTHER_SPEED 0x0600 /* currently FreeBSD specific */ #define UPS_PORT_TEST 0x0800 #define UPS_PORT_INDICATOR 0x1000 #define UPS_PORT_MODE_DEVICE 0x8000 /* currently FreeBSD specific */ uWord wPortChange; #define UPS_C_CONNECT_STATUS 0x0001 #define UPS_C_PORT_ENABLED 0x0002 #define UPS_C_SUSPEND 0x0004 #define UPS_C_OVERCURRENT_INDICATOR 0x0008 #define UPS_C_PORT_RESET 0x0010 #define UPS_C_PORT_L1 0x0020 /* USB 2.0 only */ #define UPS_C_BH_PORT_RESET 0x0020 /* USB 3.0 only */ #define UPS_C_PORT_LINK_STATE 0x0040 #define UPS_C_PORT_CONFIG_ERROR 0x0080 } __packed; It is probed regularly by the UHUB driver and the port status is printed in dmesg. Turn on like this: sysctl hw.usb.uhub.debug=16 By resetting the root HUB, you can write new power on bits: usbconfig -d X.1 set_config 255 usbconfig -d X.1 set_config 0 --HPS