linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: wacom: Do not repeatedly attempt to set device mode on error
@ 2015-08-05 22:45 Jason Gerecke
  2015-08-10 12:31 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages in thread
From: Jason Gerecke @ 2015-08-05 22:45 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires
  Cc: linux-input, Ping Cheng, Aaron Skomra, Jason Gerecke,
	Jason Gerecke

As an extension of aef3156d7, there is no sense in repeatedly calling the
'wacom_set_report' and 'wacom_get_report' functions if they return an
error. Getting an error from them implies that the device is out to lunch:
either a hard error code was returned or repeated attempts at recovering
from a "soft" error all failed. In either case, doing even more retries is
not likely to resolve whatever is wrong.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
---
 drivers/hid/wacom_sys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 20d15c5..6edb7d1 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -335,7 +335,7 @@ static int wacom_set_device_mode(struct hid_device *hdev, int report_id,
 		if (error >= 0)
 			error = wacom_get_report(hdev, HID_FEATURE_REPORT,
 			                         rep_data, length, 1);
-	} while ((error < 0 || rep_data[1] != mode) && limit++ < WAC_MSG_RETRIES);
+	} while (error >= 0 && rep_data[1] != mode && limit++ < WAC_MSG_RETRIES);
 
 	kfree(rep_data);
 
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] HID: wacom: Do not repeatedly attempt to set device mode on error
  2015-08-05 22:45 [PATCH] HID: wacom: Do not repeatedly attempt to set device mode on error Jason Gerecke
@ 2015-08-10 12:31 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2015-08-10 12:31 UTC (permalink / raw)
  To: Jason Gerecke
  Cc: Benjamin Tissoires, linux-input, Ping Cheng, Aaron Skomra,
	Jason Gerecke

On Wed, 5 Aug 2015, Jason Gerecke wrote:

> As an extension of aef3156d7, there is no sense in repeatedly calling the
> 'wacom_set_report' and 'wacom_get_report' functions if they return an
> error. Getting an error from them implies that the device is out to lunch:
> either a hard error code was returned or repeated attempts at recovering
> from a "soft" error all failed. In either case, doing even more retries is
> not likely to resolve whatever is wrong.
> 
> Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>

Applied to for-4.3/upstream.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-10 12:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-05 22:45 [PATCH] HID: wacom: Do not repeatedly attempt to set device mode on error Jason Gerecke
2015-08-10 12:31 ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).