Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

asus-switcheroo: Add delay after powering on device

Not sure how long this delay should be, but I've see dmesg errors
about failing to transition the device to D0 that I expect might
be due to lack of delay after powering the device on.  This seems
to get rid of it.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
  • Loading branch information...
commit e005845713cab92fe121c339fe6aba82e3b9846e 1 parent 42cede5
@awilliam authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 asus-switcheroo.c
View
10 asus-switcheroo.c
@@ -11,6 +11,7 @@
* the COPYING file in the top-level directory.
*/
+#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/acpi.h>
#include <linux/slab.h>
@@ -155,7 +156,7 @@ static int asus_switcheroo_switchto(enum vga_switcheroo_client_id id)
static int asus_switcheroo_power_state(enum vga_switcheroo_client_id id,
enum vga_switcheroo_state state)
{
- int dsm_arg;
+ int ret, dsm_arg;
if (id == VGA_SWITCHEROO_IGD)
return 0;
@@ -165,7 +166,12 @@ static int asus_switcheroo_power_state(enum vga_switcheroo_client_id id,
else
dsm_arg = DSM_POWER_STAMINA;
- return asus_switcheroo_dsm_call(dsm_handle, DSM_POWER, dsm_arg);
+ ret = asus_switcheroo_dsm_call(dsm_handle, DSM_POWER, dsm_arg);
+
+ if (state == VGA_SWITCHEROO_ON)
+ msleep(10);
+
+ return ret;
}
static int asus_switcheroo_handler_init(void)
Please sign in to comment.
Something went wrong with that request. Please try again.