FreeBSD Bugzilla – Attachment 143900 Details for
Bug 191155
[usb] [patch] Fix USB operation after second suspend/resume
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
fix
second_suspend2.diff (text/plain), 1.83 KB, created by
Edward Tomasz Napierala
on 2014-06-18 12:51:01 UTC
(
hide
)
Description:
fix
Filename:
MIME Type:
Creator:
Edward Tomasz Napierala
Created:
2014-06-18 12:51:01 UTC
Size:
1.83 KB
patch
obsolete
>diff --git a/sys/dev/acpi_support/acpi_ibm.c b/sys/dev/acpi_support/acpi_ibm.c >index 4160112..1d83acc 100644 >--- a/sys/dev/acpi_support/acpi_ibm.c >+++ b/sys/dev/acpi_support/acpi_ibm.c >@@ -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,20 @@ acpi_ibm_attach(device_t dev) > if (sc->light_set_supported) > sc->led_dev = 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 system >+ * may, for instance, resume from S3 with usb(4) powered down. >+ */ >+ status = AcpiGetHandle(sc->handle, "\\_SB.PCI0.LPC.EC.PUBS", &sc->power_handle); >+ if (ACPI_FAILURE(status)) { >+ if (bootverbose) { >+ device_printf(dev, "Failed to get power handle: %s\n", >+ AcpiFormatException(status)); >+ } >+ sc->power_handle = NULL; >+ } >+ > return (0); > } > >@@ -476,6 +494,7 @@ static int > acpi_ibm_resume(device_t dev) > { > struct acpi_ibm_softc *sc = device_get_softc(dev); >+ ACPI_STATUS status; > > ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); > >@@ -495,6 +514,15 @@ acpi_ibm_resume(device_t dev) > > acpi_ibm_sysctl_set(sc, i, val); > } >+ if (sc->power_handle != NULL) { >+ status = 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);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 191155
: 143900