From patchwork Thu Jan 24 01:52:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chris@cnpbagwell.com X-Patchwork-Id: 2027651 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 62EB5E00CF for ; Thu, 24 Jan 2013 01:52:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752727Ab3AXBwp (ORCPT ); Wed, 23 Jan 2013 20:52:45 -0500 Received: from mail-ob0-f178.google.com ([209.85.214.178]:51552 "EHLO mail-ob0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752241Ab3AXBwp (ORCPT ); Wed, 23 Jan 2013 20:52:45 -0500 Received: by mail-ob0-f178.google.com with SMTP id eh20so9099338obb.9 for ; Wed, 23 Jan 2013 17:52:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=OetW1Z/cErophbYgr3zuwMctZnguQtZTRHfVQDmPWQg=; b=n8wvkf6mykrYqbcsS1NADNvO6NioTajOna10XM0pxaBCewd7CSet0n9Z/86v8JVVtn Aa5OJPd/PZXFLIQmGbyHkfOqgB1++Im39RjusXkkosa3LsDUiQ90WytPVb+62Y9LeukQ H3gdalQ9P8XQ26aSWLgpcxPfoDrwhGjzyhzWZueGirdjYPmhvPkJUf5OFeyxtVxj3DKJ f4F2fqjKW7K8qCs82cCXTRO6E7sAqkPot8qZuvUP5EFjoHHD/VmlXPwAQxsPTDUeFOT1 hqtpIi1t51D+r9OWHdYFDQDq87AO+gzS8sTA2wID6WY3haTjtIc3EE9hjOtWbCJ8noeg +o3g== X-Received: by 10.60.25.227 with SMTP id f3mr243764oeg.17.1358992364622; Wed, 23 Jan 2013 17:52:44 -0800 (PST) Received: from localhost.localdomain (adsl-68-95-254-154.dsl.rcsntx.swbell.net. [68.95.254.154]) by mx.google.com with ESMTPS id aw4sm17428960oec.9.2013.01.23.17.52.42 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 23 Jan 2013 17:52:43 -0800 (PST) From: chris@cnpbagwell.com To: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com, pinglinux@gmail.com, killertofu@gmail.com Cc: Chris Bagwell Subject: [PATCH] Input: wacom - fix wacom_set_report retry logic Date: Wed, 23 Jan 2013 19:52:36 -0600 Message-Id: <1358992356-7898-1-git-send-email-chris@cnpbagwell.com> X-Mailer: git-send-email 1.8.1 X-Gm-Message-State: ALoCoQnajmFQkYUtOFMMO+0lpBNrPQR/PqltPhrZUtQWblH/n31VWNnYqjQZ2BsI1om/7rkiVZma Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Chris Bagwell 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 --- drivers/input/tablet/wacom_sys.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index f92d34f..aaf23ae 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 if (!rep_data) return error; - rep_data[0] = report_id; - rep_data[1] = mode; - do { + rep_data[0] = report_id; + rep_data[1] = mode; + error = wacom_set_report(intf, WAC_HID_FEATURE_REPORT, report_id, rep_data, length, 1); if (error >= 0)