Date: Mon, 16 Jun 2014 12:41:29 -0700 From: Adrian Chadd <adrian@freebsd.org> To: freebsd-current <freebsd-current@freebsd.org> Subject: Re: [patch] USB after second suspend/resume on ThinkPads. Message-ID: <CAJ-VmokBaCg6Gr5E4=nA%2BZ=gaxdZGkxz-FzFYn1Ki83LPo_S%2Bg@mail.gmail.com> In-Reply-To: <20140616192155.GE13481@brick.home> References: <20140616192155.GE13481@brick.home>
next in thread | previous in thread | raw e-mail | index | archive | help
Hey cool! I'll go test this out soon. Would you mind throwing it in a bugzilla ticket? -a On 16 June 2014 12:21, Edward Tomasz Napiera=C5=82a <trasz@freebsd.org> wro= te: > 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. > > (Btw, has anyone encountered the problem on hardware other than ThinkPads= ?) > > > Index: sys/dev/acpi_support/acpi_ibm.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 > --- sys/dev/acpi_support/acpi_ibm.c (revision 267417) > +++ sys/dev/acpi_support/acpi_ibm.c (working copy) > @@ -169,6 +169,9 @@ struct acpi_ibm_softc { > int light_get_supported; > int light_set_supported; > > + /* USB power workaround */ > + ACPI_HANDLE power_handle; > + > /* led(4) interface */ > struct cdev *led_dev; > int led_busy; > @@ -365,6 +368,7 @@ acpi_ibm_attach(device_t dev) > { > struct acpi_ibm_softc *sc; > devclass_t ec_devclass; > + ACPI_STATUS status; > > ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); > > @@ -448,6 +452,17 @@ acpi_ibm_attach(device_t dev) > if (sc->light_set_supported) > sc->led_dev =3D led_create_state(ibm_led, sc, "thinklight= ", sc->light_val); > > + /* > + * Obtain a handle to the power resource available on many models= . > + * This must be turned on manually upon resume. Otherwise the sys= tem > + * may, for instance, resume from S3 with usb(4) powered down. > + */ > + status =3D AcpiGetHandle(sc->handle, "\\_SB.PCI0.LPC.EC.PUBS", &s= c->power_handle); > + if (ACPI_FAILURE(status)) { > + device_printf(dev, "Failed to get power handle\n"); > + return (status); > + } > + > return (0); > } > > @@ -476,6 +491,7 @@ static int > acpi_ibm_resume(device_t dev) > { > struct acpi_ibm_softc *sc =3D device_get_softc(dev); > + ACPI_STATUS status; > > ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); > > @@ -495,6 +511,15 @@ acpi_ibm_resume(device_t dev) > > acpi_ibm_sysctl_set(sc, i, val); > } > + if (sc->power_handle !=3D NULL) { > + status =3D AcpiEvaluateObject(sc->power_handle, > + "_ON", NULL, NULL); > + if (ACPI_FAILURE(status)) { > + device_printf(dev, "failed to switch %s on - %s\n= ", > + acpi_name(sc->power_handle), > + AcpiFormatException(status)); > + } > + } > ACPI_SERIAL_END(ibm); > > return (0); > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org= "
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-VmokBaCg6Gr5E4=nA%2BZ=gaxdZGkxz-FzFYn1Ki83LPo_S%2Bg>