diff options
author | Chris Bagwell <chris@cnpbagwell.com> | 2013-01-23 22:37:34 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-01-23 22:38:52 -0500 |
commit | 9937c026820baabd1e908a9c1e6bdc846293000a (patch) | |
tree | 461b2c70b16edf74c7d5444951133c534a007c93 /drivers | |
parent | b666263b71cb1f3b96fb79e69de7f119062b0da2 (diff) |
Input: wacom - fix wacom_set_report retry logic
Logic sets a value and then reads it back to make sure it worked
and retries write on failures. Since read and write share a buffer,
it needs to be set back up before writing though.
Issue is not seen a lot because 1) it doesn't need to retry for
a lot of tablets and 2) a lot of failures that need a retry are
from an -ETIMEDOUT and hopefully buffer is not touched in this case.
At least one user has shown logs with buffer being modified during
-ETIMEDOUT case with linux 3.7 kernel.
Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/input/tablet/wacom_sys.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index f92d34f45a1c..aaf23aeae2ea 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c | |||
@@ -553,10 +553,10 @@ static int wacom_set_device_mode(struct usb_interface *intf, int report_id, int | |||
553 | if (!rep_data) | 553 | if (!rep_data) |
554 | return error; | 554 | return error; |
555 | 555 | ||
556 | rep_data[0] = report_id; | ||
557 | rep_data[1] = mode; | ||
558 | |||
559 | do { | 556 | do { |
557 | rep_data[0] = report_id; | ||
558 | rep_data[1] = mode; | ||
559 | |||
560 | error = wacom_set_report(intf, WAC_HID_FEATURE_REPORT, | 560 | error = wacom_set_report(intf, WAC_HID_FEATURE_REPORT, |
561 | report_id, rep_data, length, 1); | 561 | report_id, rep_data, length, 1); |
562 | if (error >= 0) | 562 | if (error >= 0) |