From owner-freebsd-usb@FreeBSD.ORG Mon Nov 19 20:00:01 2012 Return-Path: Delivered-To: freebsd-usb@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9C5346BB for ; Mon, 19 Nov 2012 20:00:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 747268FC14 for ; Mon, 19 Nov 2012 20:00:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJK01xd042746 for ; Mon, 19 Nov 2012 20:00:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id qAJK014c042743; Mon, 19 Nov 2012 20:00:01 GMT (envelope-from gnats) Date: Mon, 19 Nov 2012 20:00:01 GMT Message-Id: <201211192000.qAJK014c042743@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org Cc: From: Hans Petter Selasky Subject: Re: usb/173722: XHCI driver bug after suspend to ram (ACPI S3 mode) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Hans Petter Selasky List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 20:00:01 -0000 The following reply was made to PR usb/173722; it has been noted by GNATS. From: Hans Petter Selasky To: Florian Jung Cc: freebsd-usb@freebsd.org, freebsd-gnats-submit@freebsd.org Subject: Re: usb/173722: XHCI driver bug after suspend to ram (ACPI S3 mode) Date: Mon, 19 Nov 2012 20:52:35 +0100 On Monday 19 November 2012 20:21:47 Florian Jung wrote: > Am 19.11.2012 19:21, schrieb Hans Petter Selasky: > > On Monday 19 November 2012 16:36:45 Florian Jung wrote: > >>> Number: 173722 > >>> Category: usb > >>> Synopsis: XHCI driver bug after suspend to ram (ACPI S3 mode) > >>> Confidential: no > >>> Severity: non-critical > >>> Priority: low > >>> Responsible: freebsd-usb > >>> State: open > >>> Quarter: > >>> Keywords: > >>> Date-Required: > >>> Class: sw-bug > >>> Submitter-Id: current-users > >>> Arrival-Date: Mon Nov 19 15:40:00 UTC 2012 > >>> Closed-Date: > >>> Last-Modified: > >>> Originator: Florian Jung > >>> Release: 9.0-RELEASE-p3 > >>> Organization: > >> > >>> Environment: > >> FreeBSD beastie 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 #0: Tue Jun 12 > >> 02:52:29 UTC 2012 > >> root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 > >> > >>> Description: > >> After entering and waking up from suspend to ram aka ACPI S3 state, the > >> dmesg get flooded with "xhci_interrupt: host controller halted", and my > >> USB3.0 device stops working. > >> > >> (It is a external hard disk drive, and the device node just vanished and > >> won't re-appear) > >> > >> My USB2.0 and 1.x devices however do still work. > >> > >> It seems that i can provoke the generation of these "xhci_interrupt: > >> host controller halted" messages by typing on my USB-2.0-Keyboard or by > >> moving my USB-2.0-Mouse. > >> > >>> How-To-Repeat: > >> - Start up FreeBSD > >> - Plug in USB3.0 Harddisk > >> - It will work. > >> - sudo acpiconf -S 3 > >> - re-awake the computer > >> - ls /dev/ tells you that the harddisk is gone > >> - dmesg tells you the "xhci_interrupt: host controller halted" messages. > >> - replug the harddisk > >> - it still does not work. > > > > If you unplug the harddisk before the suspend, does it work afterwards > > then? > > > > --HPS > > No, that causes the same problem. > I don't even need to attach it: boot freebsd, enter acpi s3, wake up, > and then plug in the disk leads to the same problem. > > i have found out that compiling XHCI has loadable module, and unloading > it before suspend and re-loading it afterwards solves the problem. > > the "xhci_interrupt: host controller halted"-messages don't appear, and > i can use my harddisk afterwards. > > looks like xhci is failing to reinitalize properly after suspend? > > greetings, > flo Hi, Do you have a USB 3.0 compatible BIOS? I think we might need to halt the XHCI as part of the resume process. Can you try this patch: diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index 756b1ed..576ed71 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -578,6 +578,8 @@ xhci_set_hw_power_sleep(struct usb_bus *bus, uint32_t state) xhci_halt_controller(sc); break; case USB_HW_POWER_RESUME: + DPRINTF("Halting the XHCI\n"); + xhci_halt_controller(sc); DPRINTF("Starting the XHCI\n"); xhci_start_controller(sc); break; --HPS