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

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday, June 18, 2014 12:13:15 pm Edward Tomasz Napiera=C5=82a wrote:
> On 0618T0947, John Baldwin wrote:
> > On Monday, June 16, 2014 3:21:55 pm Edward Tomasz Napiera=C5=82a 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.
> >=20
> > Good find.  Have you thought about a more generic fix for this wherein =
you=20
> > track power resources and flip them on during resume in ACPI before doi=
ng
> > DEVICE_RESUME() on the root bus?
>=20
> Thing is, after resume this device claims to be on already.  The following
> simple hack was enough to make it work:

Ahh, I think I see.  Try this instead:

Index: sys/dev/acpica/acpi_powerres.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=2D-- acpi_powerres.c	(revision 267550)
+++ acpi_powerres.c	(working copy)
@@ -645,7 +645,7 @@ acpi_pwr_switch_power(void)
 			      acpi_name(rp->ap_resource), status));
 	    /* XXX is this correct?  Always switch if in doubt? */
 	    continue;
=2D	} else if (rp->ap_state =3D=3D ACPI_PWR_UNK)
+	} else
 	    rp->ap_state =3D cur;
=20
 	/*
@@ -689,7 +689,7 @@ acpi_pwr_switch_power(void)
 			      acpi_name(rp->ap_resource), status));
 	    /* XXX is this correct?  Always switch if in doubt? */
 	    continue;
=2D	} else if (rp->ap_state =3D=3D ACPI_PWR_UNK)
+	} else
 	    rp->ap_state =3D cur;
=20
 	/*

(We were ignoring what _STA told us and believed it was ON because we had
 cached that state previously.)

=2D-=20
John Baldwin



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