Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3932218imm; Mon, 8 Oct 2018 11:54:35 -0700 (PDT) X-Google-Smtp-Source: ACcGV63lmHTR9tFskdw0a+x4om8AzoRT87LzwBI/yrK7JHIrLQiZHZX/Bpsy0C80VSTMWGraWJfo X-Received: by 2002:a63:5f03:: with SMTP id t3-v6mr22638452pgb.68.1539024874987; Mon, 08 Oct 2018 11:54:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539024874; cv=none; d=google.com; s=arc-20160816; b=LJ0B9xON5BDTBI+BS6lK7f0eap8qLjZyYahcEEhVYDIopYPbgHCUN3+mbq/N3MsRxx 5SbhnwH2G5398dFxwEtAu9FuAxeZPNBUcKyInKYaxkSNROgE7awVHDyXSXXlDAUTY2S4 BxMuEIfM4gLm6wbpr6rN0tm8k9QA0Pv5uwAHUpdkvLsJptjjyjy+zX3qfSzBabJOI1wR UwZkxsQ/L68OPLtiCFfcNZCYyv1WfzUa5vQdSczZLB2NJxXSXFlDGpcqNCR8tYD6/eTy KLRguKPpP9itYtQo4SV2M+XMUdgqgQZXcu+SlkraCN/iw8h2pabUjosXfHhWyF3aO0cL Mj5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1YYEc/Xni0ecnxKsHsa/RFSnI0Y+Prfh39quij/b8Mo=; b=SooqsWUvElw/FYqfBfTukEV3X+jCUwrdjqt9mowvUW1URm0XWmdEf5pNlRrCdf8MSY qsRcsl6eRufq+y1MBeptwdDJ8DDkAlsuJiRQu7sZccuY6biUufX5suXV0w1sh+432BWf PWAPCk2SHIJcGuGCt1cjs+r30mgF6umemLBrzQjqI/cQ9KSgNmKhZUFo7cnrpjzfcnLy vxfrpqy83gbZTwXzsdb2/ANQbxLZW3HWfSfU2mfWuqzm62qvE1mGG14mmmPXXpZWPmoA pZEiRlNv2NQKr1TzvRWVe82bEg1No4mhMLftR8Q6lXMY9EPNHo7EGh7ImHNthzD/byKg kt7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fR3E3GMq; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11-v6si15463984pgl.40.2018.10.08.11.54.20; Mon, 08 Oct 2018 11:54:34 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=fR3E3GMq; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732900AbeJICHU (ORCPT + 99 others); Mon, 8 Oct 2018 22:07:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:57872 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727670AbeJICHU (ORCPT ); Mon, 8 Oct 2018 22:07:20 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 31AB520645; Mon, 8 Oct 2018 18:54:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539024851; bh=bBrBJCIE8cROmmmruAs4S82mrt0HLjpYDoGoUOseqYg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fR3E3GMqa4f9/+jOSdjOgqi23XDF5sAqXvg235eGOxIR3iRbydnr+L+gZitzasSxO slhkO6Ha7/Ula+R1tYUArNxtl7F4oEXdKqy1GzQ4rtudYynBfe9OqN4OTlBqki13D5 qTWisU3CSn4nYeOWxqlNSkG+OQADb6w42R4LHlaw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anisse Astier , Benjamin Tissoires , Hans de Goede , =?UTF-8?q?Philip=20M=C3=BCller?= , Jiri Kosina Subject: [PATCH 4.18 167/168] HID: i2c-hid: disable runtime PM operations on hantick touchpad Date: Mon, 8 Oct 2018 20:32:27 +0200 Message-Id: <20181008175626.405792150@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008175620.043587728@linuxfoundation.org> References: <20181008175620.043587728@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Anisse Astier commit 807588ac92018bde88a1958f546438e840eb0158 upstream. This hantick HTIX5288 touchpad can quickly fall in a wrong state if there are too many open/close operations. This will either make it stop reporting any input, or will shift all the input reads by a few bytes, making it impossible to decode. Here, we never release the probed touchpad runtime pm while the driver is loaded, which should disable all runtime pm suspend/resumes. This fast repetition of sleep/wakeup is also more likely to happen when using runtime PM, which is why the quirk is done there, and not for all power downs, which would include suspend or module removal. Signed-off-by: Anisse Astier Cc: stable@vger.kernel.org Acked-by: Benjamin Tissoires Reviewed-by: Hans de Goede Tested-by: Philip Müller Signed-off-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/hid/i2c-hid/i2c-hid.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c @@ -48,6 +48,7 @@ #define I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV BIT(0) #define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET BIT(1) #define I2C_HID_QUIRK_RESEND_REPORT_DESCR BIT(2) +#define I2C_HID_QUIRK_NO_RUNTIME_PM BIT(3) /* flags */ #define I2C_HID_STARTED 0 @@ -169,7 +170,8 @@ static const struct i2c_hid_quirks { { USB_VENDOR_ID_WEIDA, USB_DEVICE_ID_WEIDA_8755, I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV }, { I2C_VENDOR_ID_HANTICK, I2C_PRODUCT_ID_HANTICK_5288, - I2C_HID_QUIRK_NO_IRQ_AFTER_RESET }, + I2C_HID_QUIRK_NO_IRQ_AFTER_RESET | + I2C_HID_QUIRK_NO_RUNTIME_PM }, { USB_VENDOR_ID_SIS_TOUCH, USB_DEVICE_ID_SIS10FB_TOUCH, I2C_HID_QUIRK_RESEND_REPORT_DESCR }, { 0, 0 } @@ -1106,7 +1108,9 @@ static int i2c_hid_probe(struct i2c_clie goto err_mem_free; } - pm_runtime_put(&client->dev); + if (!(ihid->quirks & I2C_HID_QUIRK_NO_RUNTIME_PM)) + pm_runtime_put(&client->dev); + return 0; err_mem_free: @@ -1132,7 +1136,8 @@ static int i2c_hid_remove(struct i2c_cli struct i2c_hid *ihid = i2c_get_clientdata(client); struct hid_device *hid; - pm_runtime_get_sync(&client->dev); + if (!(ihid->quirks & I2C_HID_QUIRK_NO_RUNTIME_PM)) + pm_runtime_get_sync(&client->dev); pm_runtime_disable(&client->dev); pm_runtime_set_suspended(&client->dev); pm_runtime_put_noidle(&client->dev);