From owner-freebsd-usb@FreeBSD.ORG Mon Nov 19 21:07:51 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1FA22BA8; Mon, 19 Nov 2012 21:07:51 +0000 (UTC) (envelope-from florian.a.jung@web.de) Received: from mout.web.de (mout.web.de [212.227.15.4]) by mx1.freebsd.org (Postfix) with ESMTP id B42368FC18; Mon, 19 Nov 2012 21:07:50 +0000 (UTC) Received: from [172.17.0.179] ([131.188.24.12]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0Lsy7e-1T7MZX0Qtm-011xUu; Mon, 19 Nov 2012 22:07:13 +0100 Message-ID: <50AA9F80.4000500@web.de> Date: Mon, 19 Nov 2012 22:07:12 +0100 From: Florian Jung User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20120726 Iceowl/1.0b1 Icedove/3.0.11 MIME-Version: 1.0 To: Hans Petter Selasky Subject: Re: usb/173722: XHCI driver bug after suspend to ram (ACPI S3 mode) References: <201211191536.qAJFajns006251@red.freebsd.org> <201211191921.13989.hselasky@c2i.net> <50AA86CB.2080007@web.de> <201211192052.35438.hselasky@c2i.net> In-Reply-To: <201211192052.35438.hselasky@c2i.net> X-Enigmail-Version: 1.0.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig64F0B7CF7B9CE9B2E0868F3C" X-Provags-ID: V02:K0:UiTqBCtfCNLjkponEKuVmaAgMFL3xm/it8PdVyBwif8 3DOWWFDsV9atpnEQLFvJmtA5iF0aK0Eo2tbCWgwNr4JyO2Sr69 xxWRAzQ6Z+sWSmpEJ0lK9LBy/nWYRLzAkmjSKmhxN1uCEelwZ+ +56L7J6qRMfYskRreeA6OdEW8w81YBhMpPWnPfmitEALrTUz/h +LOuF+FW0tQLQxruxz2nA== Cc: freebsd-gnats-submit@freebsd.org, freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 21:07:51 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig64F0B7CF7B9CE9B2E0868F3C Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Am 19.11.2012 20:52, schrieb Hans Petter Selasky: > 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 amd= 64 >>>> >>>>> 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" messa= ges. >>>> - replug the harddisk >>>> - it still does not work. >>> >>> If you unplug the harddisk before the suspend, does it work afterward= s >>> 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 unloadin= g >> it before suspend and re-loading it afterwards solves the problem. >> >> the "xhci_interrupt: host controller halted"-messages don't appear, an= d >> i can use my harddisk afterwards. >> >> looks like xhci is failing to reinitalize properly after suspend? >> >> greetings, >> flo >=20 > Hi, >=20 > Do you have a USB 3.0 compatible BIOS? >=20 > I think we might need to halt the XHCI as part of the resume process. C= an you=20 > try this patch: >=20 > diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhc= i.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=20 > 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; >=20 >=20 > --HPS >=20 Hi i have a USB3.0-compatible BIOS. uhm, i am unable to apply this patch. my xhci.c file looks pretty different, there is no xhci_set_hw_power_sleep function, but there are xhci_suspend() and xhci_resume(). both are empty and contain only a /* XXX TODO */ uname -r now reports 9.0-RELEASE-p4, btw, i must have mistyped that :/ i've set up my freebsd system ~2 months ago, and ran freebsd-update fetch install today. that are the kernel sources i'm using. there is a line: __FBSDID("$FreeBSD: release/9.0.0/sys/dev/usb/controller/xhci.c 226904 2011-10-29 12:39:05Z hselasky $"); do i have to download different sources (how?), or did you diff against the wrong kernel tree? (sorry, i'm a freeBSD-newbie ;) ) thanks flo --------------enig64F0B7CF7B9CE9B2E0868F3C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQEcBAEBAgAGBQJQqp+AAAoJEHPd9QK/nPqlkbMH/0rXXl56OCqLswtxO2o0iUg/ /Pw6covi1+z2K8nugwp5oPic2lC73WmdVd2jT2m57LPlGuBqR7XxAaFKtk16us9Y pqOvinKjKcv8q+GKDk7G8TmEn512Nm8/7e9Wsd3BdMLuvx0w0keqExnEbGCsjtao OUb94RdgOUbI8zS2054/moLhmhiwDix4gf2UEVyWSlyAmcWE6zoCpXTD/fK9X/x4 i2PL6cM4wbIIgsDmzfaS6/gv1NVCHqw3ltTrpSFsinT4jQYatgvAqLam0Cp+EqwI c17bkXedl7eS9X4jCj5G8vfR7OOu3xQtN3FUscpJN+pgKCpenD86/o3pEI4n+ZQ= =ob+r -----END PGP SIGNATURE----- --------------enig64F0B7CF7B9CE9B2E0868F3C--