Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp771455imp; Wed, 20 Feb 2019 08:43:30 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib1Rk5XPDyyyXQIx28HlQY2Rn+mqPueC+Yg5HUMGwXSgN7XQM4aZYr1dW4VvXbG9KkDMd76 X-Received: by 2002:a63:1845:: with SMTP id 5mr30443170pgy.108.1550681010510; Wed, 20 Feb 2019 08:43:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550681010; cv=none; d=google.com; s=arc-20160816; b=bg5PJEQNd8JMBupZuVn8lrM5DXBvh1BtGjSteHFs+knz/D4YvRfjeVmOjBIJ1h/7go RADTxlnVJP0RrXDg020TaNBTfRmUWOSjQvSs2+W/wMg8PexJfWs/0k5gpXJ2IGPcbl8K fFA2u31ZJIdMqttAgzmOqCHmeek6ND+3l43YgnDzIV7Xz2/7rAQ3JrhjCUfvmEgc+57Y odqLjpyi5vLqyIZa2DyWpErglmq9aDVBffrIqsU7A3vu+dl9jm0oUKrkezfYGVXFg+F9 R7vpVW6Vt7ATMehk07MY6PY8+J09ulm3zMqSiLupT931pDkZwVQul3onGllzSsbvrs+a dSIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from; bh=QJvl3xD8DI7ATIkbhbl96u1OU5KDGVQ4wC2TB5mibVA=; b=ifLURZwYg2LTxQSjwth1mb6ZBG0duCBXh9gQUp+YKtt7TYzA5j0zpcuD5fzTmRlM4V Pp8N2W+duw/nX5wPGFnWSsTw2E16/EB3cI8Ub/yd+VvstxTBHHVJWVpq1hXlHaoTcs/9 oPWdRCaP+TscK3SGxpMOJuHTGuvdn/8EUoXPAtx2uj38wbas96HvJQC3gtKhntN2X8Oz 61X6FduJqANW2HRA8Wko/OjuljBhO0w3R8PMy5WoNFwElcb290b5xP4RffYk3u1++aK8 1Q28ZdMMmkJr/WtXA8c9bdhGGDpNTVxNu0SX5dod2b1/CvDpXgpmXgCkKpLj10eFrOQq P97w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v5si18655451pgh.510.2019.02.20.08.43.15; Wed, 20 Feb 2019 08:43:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726994AbfBTQmH (ORCPT + 99 others); Wed, 20 Feb 2019 11:42:07 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:59226 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725877AbfBTQmG (ORCPT ); Wed, 20 Feb 2019 11:42:06 -0500 Received: from [194.204.107.10] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1gwUwe-0002E2-Bw; Wed, 20 Feb 2019 16:42:04 +0000 From: Aaron Ma To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Cheiny@synaptics.com, aduggan@synaptics.com, benjamin.tissoires@redhat.com, aaron.ma@canonical.com Subject: [PATCH 1/2] Input: synaptics-rmi4 - clear irqs before set irqs Date: Wed, 20 Feb 2019 17:41:59 +0100 Message-Id: <20190220164200.31044-1-aaron.ma@canonical.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rmi4 got spam data after S3 resume on some ThinkPads. Then TrackPoint lost when be detected by psmouse. Clear irqs status before set irqs will make TrackPoint back. BugLink: https://bugs.launchpad.net/bugs/1791427 Cc: Signed-off-by: Aaron Ma --- drivers/input/rmi4/rmi_driver.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c index fc3ab93b7aea..20631b272f43 100644 --- a/drivers/input/rmi4/rmi_driver.c +++ b/drivers/input/rmi4/rmi_driver.c @@ -374,6 +374,17 @@ static int rmi_driver_set_irq_bits(struct rmi_device *rmi_dev, struct device *dev = &rmi_dev->dev; mutex_lock(&data->irq_mutex); + + /* Dummy read in order to clear irqs */ + error = rmi_read_block(rmi_dev, + data->f01_container->fd.data_base_addr + 1, + data->irq_status, data->num_of_irq_regs); + if (error < 0) { + dev_err(dev, "%s: Failed to read interrupt status!", + __func__); + goto error_unlock; + } + bitmap_or(data->new_irq_mask, data->current_irq_mask, mask, data->irq_count); -- 2.17.1