* [PATCH] HID: usbhid: fix suspend timeout due to RUNNING bits
@ 2011-09-03 0:07 Benson Leung
2011-09-13 1:29 ` Benson Leung
0 siblings, 1 reply; 4+ messages in thread
From: Benson Leung @ 2011-09-03 0:07 UTC (permalink / raw)
To: jkosina, linux-usb, linux-input, linux-kernel; +Cc: bleung
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@chromium.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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] HID: usbhid: fix suspend timeout due to RUNNING bits
2011-09-03 0:07 [PATCH] HID: usbhid: fix suspend timeout due to RUNNING bits Benson Leung
@ 2011-09-13 1:29 ` Benson Leung
0 siblings, 0 replies; 4+ messages in thread
From: Benson Leung @ 2011-09-13 1:29 UTC (permalink / raw)
To: jkosina, linux-usb, linux-input, linux-kernel; +Cc: bleung
Ping. Would someone in linux-usb take a look at this fix?
Thanks,
Benson
On Fri, Sep 2, 2011 at 5:07 PM, Benson Leung <bleung@chromium.org> wrote:
> 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@chromium.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
>
>
--
Benson Leung
Software Engineer, Chrom* OS
bleung@chromium.org
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] HID: usbhid: fix suspend timeout due to RUNNING bits
@ 2011-09-13 1:29 ` Benson Leung
0 siblings, 0 replies; 4+ messages in thread
From: Benson Leung @ 2011-09-13 1:29 UTC (permalink / raw)
To: jkosina, linux-usb, linux-input, linux-kernel; +Cc: bleung
Ping. Would someone in linux-usb take a look at this fix?
Thanks,
Benson
On Fri, Sep 2, 2011 at 5:07 PM, Benson Leung <bleung@chromium.org> wrote:
> 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@chromium.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
>
>
--
Benson Leung
Software Engineer, Chrom* OS
bleung@chromium.org
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] HID: usbhid: fix suspend timeout due to RUNNING bits
2011-09-13 1:29 ` Benson Leung
(?)
@ 2011-09-13 6:50 ` Jiri Kosina
-1 siblings, 0 replies; 4+ messages in thread
From: Jiri Kosina @ 2011-09-13 6:50 UTC (permalink / raw)
To: Benson Leung; +Cc: linux-usb, linux-input, linux-kernel
On Mon, 12 Sep 2011, Benson Leung wrote:
> Ping. Would someone in linux-usb take a look at this fix?
Benson,
it hasn't been lost, it's in my queue, just not processed yet.
Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-09-13 6:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-03 0:07 [PATCH] HID: usbhid: fix suspend timeout due to RUNNING bits Benson Leung
2011-09-13 1:29 ` Benson Leung
2011-09-13 1:29 ` Benson Leung
2011-09-13 6:50 ` Jiri Kosina
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.