From patchwork Fri Apr 8 21:30:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Dyer X-Patchwork-Id: 8786351 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 46EF0C0553 for ; Fri, 8 Apr 2016 21:30:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5640A202EB for ; Fri, 8 Apr 2016 21:30:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E2945202E9 for ; Fri, 8 Apr 2016 21:30:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759005AbcDHVaA (ORCPT ); Fri, 8 Apr 2016 17:30:00 -0400 Received: from zencphosting06.zen.co.uk ([82.71.204.9]:58289 "EHLO zencphosting06.zen.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758973AbcDHVaA (ORCPT ); Fri, 8 Apr 2016 17:30:00 -0400 Received: from [80.229.148.18] (port=58894 helo=[192.168.1.108]) by zencphosting06.zen.co.uk with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.86_1) (envelope-from ) id 1aodyU-0007gN-NZ; Fri, 08 Apr 2016 22:29:56 +0100 Subject: Re: [PATCH] Revert "Input: atmel_mxt_ts - disable interrupt for 50ms after reset" To: Tom Rini References: <1460069545-10322-1-git-send-email-trini@konsulko.com> <5707756E.30506@itdev.co.uk> <20160408121418.GT23166@bill-the-cat> <5707A376.2080404@itdev.co.uk> <20160408123913.GV23166@bill-the-cat> Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Olof Johansson , Dmitry Torokhov , Henrik Rydberg From: Nick Dyer Message-ID: <570822DA.9090203@itdev.co.uk> Date: Fri, 8 Apr 2016 22:30:02 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <20160408123913.GV23166@bill-the-cat> X-OutGoing-Spam-Status: No, score=0.2 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - zencphosting06.zen.co.uk X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - itdev.co.uk X-Get-Message-Sender-Via: zencphosting06.zen.co.uk: authenticated_id: nick.dyer@itdev.co.uk X-Authenticated-Sender: zencphosting06.zen.co.uk: nick.dyer@itdev.co.uk Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 2016-04-08 13:39, Tom Rini wrote: >>>> I have a Pixel 2 here - can you advise how to reproduce? >>> >>> I (and a bunch of other folks, the linux-samus people now point people >>> at using mxt-app every boot to reset the device) see this every time I >>> either suspend the laptop or do a warm boot into a new kernel (I didn't >>> try kexec but it too is probably broken). Note that I'm not using >>> mainline to boot ChromeOS but I've got a regular Linux distro in ROOT-C. >> >> OK. I will try it. My Pixel is running Ubuntu with a mainline kernel, so >> should be able to repro. > > Thanks. Happy to test patches when you get there and feel free to shoot > me patches to have more info get dumped out or whatever if needed. Could you try the below patch to correctly acquire the IRQ after soft reset on systems using IRQF_TRIGGER_FALLING. Appears to work correctly on my Pixel 2 during a brief test. A workaround also seems to be to reconfig T18 COMMSCONFIG to enable the RETRIGEN bit using mxt-app: mxt-app -W -T18 44 mxt-app --backup Tested-by: Tom Rini --- drivers/input/touchscreen/atmel_mxt_ts.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) -- 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 diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 2160512e..5af7907 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -1093,6 +1093,19 @@ static int mxt_t6_command(struct mxt_data *data, u16 cmd_offset, return 0; } +static int mxt_acquire_irq(struct mxt_data *data) +{ + int error; + + enable_irq(data->irq); + + error = mxt_process_messages_until_invalid(data); + if (error) + return error; + + return 0; +} + static int mxt_soft_reset(struct mxt_data *data) { struct device *dev = &data->client->dev; @@ -1111,7 +1124,7 @@ static int mxt_soft_reset(struct mxt_data *data) /* Ignore CHG line for 100ms after reset */ msleep(100); - enable_irq(data->irq); + mxt_acquire_irq(data); ret = mxt_wait_for_completion(data, &data->reset_completion, MXT_RESET_TIMEOUT); @@ -1466,19 +1479,6 @@ static int mxt_update_cfg(struct mxt_data *data, const struct firmware *cfg) return ret; } -static int mxt_acquire_irq(struct mxt_data *data) -{ - int error; - - enable_irq(data->irq); - - error = mxt_process_messages_until_invalid(data); - if (error) - return error; - - return 0; -} - static int mxt_get_info(struct mxt_data *data) { struct i2c_client *client = data->client;