[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1315008447-11012-1-git-send-email-bleung@chromium.org>
Date: Fri, 2 Sep 2011 17:07:27 -0700
From: Benson Leung <bleung@...omium.org>
To: jkosina@...e.cz, linux-usb@...r.kernel.org,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: bleung@...omium.org
Subject: [PATCH] HID: usbhid: fix suspend timeout due to RUNNING bits
hid_submit_ctrl and hid_submit_out should return error
codes when HID_REPORTED_IDLE is set by hid_suspend.
This will allow the output and control completion
handlers to clear HID_OUT_RUNNING and HID_CTRL_RUNNING
so hid_suspend succeeds.
Previously, if there were outstanding out messages
or control messages while hid_suspend was called,
hid_suspend would fail because usbhid_wait_io would time
out.
This condition happens with USB keyboards with both capslock and
numlock leds enabled at suspend time. Control requests
will come down to the hid-core to disable both leds, with
hid_suspend being called between the two being submitted.
Signed-off-by: Benson Leung <bleung@...omium.org>
---
drivers/hid/usbhid/hid-core.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index a9fa294..cf5c106 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -326,6 +326,8 @@ static int hid_submit_out(struct hid_device *hid)
return -1;
}
usbhid->last_out = jiffies;
+ } else {
+ return -1;
}
return 0;
@@ -385,6 +387,8 @@ static int hid_submit_ctrl(struct hid_device *hid)
return -1;
}
usbhid->last_ctrl = jiffies;
+ } else {
+ return -1;
}
return 0;
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists