Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Jun 2014 18:13:15 +0200
From:      Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= <trasz@freebsd.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        jhibbits@freebsd.org, freebsd-current@freebsd.org
Subject:   Re: [patch] USB after second suspend/resume on ThinkPads.
Message-ID:  <20140618161315.GA3496@brick.home>
In-Reply-To: <201406180947.53141.jhb@freebsd.org>
References:  <20140616192155.GE13481@brick.home> <201406180947.53141.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 0618T0947, John Baldwin wrote:
> On Monday, June 16, 2014 3:21:55 pm Edward Tomasz NapieraƂa wrote:
> > Hi.  Patch below should fix a problem where USB stops working after
> > _second_ suspend/resume, which happens on various ThinkPad models.
> > Please test, and report both success stories and failures.  If nothing
> > comes up, I'll commit it in a week or so.
> 
> Good find.  Have you thought about a more generic fix for this wherein you 
> track power resources and flip them on during resume in ACPI before doing
> DEVICE_RESUME() on the root bus?

Thing is, after resume this device claims to be on already.  The following
simple hack was enough to make it work:

Index: sys/dev/acpica/acpi_powerres.c
===================================================================
--- sys/dev/acpica/acpi_powerres.c      (revision 267417)
+++ sys/dev/acpica/acpi_powerres.c      (working copy)
@@ -653,7 +653,7 @@ acpi_pwr_switch_power(void)
         * effort; we don't know what to do if it fails, so checking wouldn't
         * help much.
         */
-       if (rp->ap_state != ACPI_PWR_ON) {
+       if (rp->ap_state != ACPI_PWR_ON || 1) {
            status = AcpiEvaluateObject(rp->ap_resource, "_ON", NULL, NULL);
            if (ACPI_FAILURE(status)) {
                ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS,




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140618161315.GA3496>