From patchwork Sun Apr 23 04:58:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jake Merdich X-Patchwork-Id: 9694519 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 66D9F601AE for ; Sun, 23 Apr 2017 04:59:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6639227B2F for ; Sun, 23 Apr 2017 04:59:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5840D2810E; Sun, 23 Apr 2017 04:59:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1D3A27B2F for ; Sun, 23 Apr 2017 04:58:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933164AbdDWE66 (ORCPT ); Sun, 23 Apr 2017 00:58:58 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:35930 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752049AbdDWE65 (ORCPT ); Sun, 23 Apr 2017 00:58:57 -0400 Received: by mail-qt0-f196.google.com with SMTP id t52so16649826qtb.3 for ; Sat, 22 Apr 2017 21:58:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=merdich-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=gvnu31kt7eJygsJT7McxF19DZWOU1pVFG2cB0V03u9o=; b=wEtIWmHQVWu4pGzek8MzlAJce6wDmjAXv0Ukc2DkNHnyaZbzG/7LNo6ad6NhfQhmJQ ATqdjJ480j/5cD7YhjC7kgTPAs/M9GfRc9hHmX6eJT3pKFnicguay2mWyfBJtLP+c/6k dQskbkz8ioNywIavW+QJw9f3lauBEA4YpU2mkwCCtJkDcHEfmcxuviPWT4VqFp0Ts2Hi 8WYS+w9V7n+Fc3aL3A1750mv4RCyOomkxQ5e3B0eyor12THMsLsCfsZffb9Dz+fv8uyQ UEJ/rg8RuiZwO51Gm8tFQxkBZV+PoxCm9Yf3e5IY4LncGmgINIT6BVaeCiaYHfN/c0Hj GSmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gvnu31kt7eJygsJT7McxF19DZWOU1pVFG2cB0V03u9o=; b=Kf+d7GBRbUrEQCDXRaETvok1KXOTKG4PCTq1C+TjIiNd7zXsc6Od964ocRxf+R9RZy E20sWqQkVEQbY1wkQ44wYBziEZKQa9yA+Sh2LBDnkG4IkNQaPoxcLl7bGs5no/cyihmU Q0H6kV6p1SsUcd+diluQwjpss2tAmW1W7cncdjNGuFvff6b1xSU36rYC1luEDn+hdT9b xu7uhDgtzM4JXWvMQHkIwY3Df8heVPOZXryVz1yOS90ZNf0cwuKNmkaSANiEzgdT+shH nuVPlSQBKX6J7smlenECEUKK2iVk0qK5KVf6J8i5reKmyJsXkVYKDUSZ/xMWmntYdIWT LF6Q== X-Gm-Message-State: AN3rC/517bn4cgFUejhD4AFyKbL+cMHwDb2kgptXXpnn9/9doV1Jg78R NvKTg5bSXugxcMXG X-Received: by 10.200.49.170 with SMTP id h39mr19250138qte.154.1492923536111; Sat, 22 Apr 2017 21:58:56 -0700 (PDT) Received: from localhost (jmerdich-laptop.wifi.wpi.edu. [130.215.174.123]) by smtp.gmail.com with ESMTPSA id f56sm10075044qta.14.2017.04.22.21.58.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 22 Apr 2017 21:58:55 -0700 (PDT) From: Jake Merdich To: linux-input@vger.kernel.org Cc: Jake Merdich Subject: [PATCH] HID: rmi: fix PDT table garbling on Dell 9Q33 Date: Sun, 23 Apr 2017 00:58:42 -0400 Message-Id: <20170423045842.8892-1-jake@merdich.com> X-Mailer: git-send-email 2.12.2 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Dell 9Q33's touchpad has been getting invalid function addresses during the late stages of probing. This only occurs after the PDT was scanned multiple times, so it only popped up now that PDT scanning was unified in 0b2c7a89 (previously, hid-rmi.c scanned it only once). This slows down probing enough to always get good data, at the cost of ~1ms of sleep per function probe (value determined empirically), or about 20ms total when enumerating. If someone has a better idea of handling this (maybe caching the PDT's?), I'd be happy to test. Signed-off-by: Jake Merdich --- drivers/input/rmi4/rmi_driver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c index d64fc92858f2..8724ee241ee5 100644 --- a/drivers/input/rmi4/rmi_driver.c +++ b/drivers/input/rmi4/rmi_driver.c @@ -545,6 +545,9 @@ static int rmi_scan_pdt_page(struct rmi_device *rmi_dev, retval = callback(rmi_dev, ctx, &pdt_entry); if (retval != RMI_SCAN_CONTINUE) return retval; + + // Dell 9Q33 garbles data if scanned too quickly + usleep_range(500, 1000); } /*