Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17893990ybl; Thu, 2 Jan 2020 14:15:20 -0800 (PST) X-Google-Smtp-Source: APXvYqwq6l8JktjF5yqyDQToauWgRP2aY1bTd/yZCT+8O+JERLDpEEHCPuADJUZxEVz95amRX2k+ X-Received: by 2002:a9d:3bc4:: with SMTP id k62mr86309977otc.186.1578003320891; Thu, 02 Jan 2020 14:15:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578003320; cv=none; d=google.com; s=arc-20160816; b=O6pCf1cBwk2x1sAk1wy8sssI4+2gUxjeJSOS4s+E3MNavti752OT+gKq+7tnQxZCxh M69HJH1yTDzryuXVyFayXspLWR3iAQ6a4QXc9yZME6iWvults5Ani4eJCF1lxyOWqKqV l5IhneFa5/9ipjiQWCLZt7BQsaMtAfoaAR16CdiXWiJl3lfeX/K++ZGHsre4YDbFgyf0 TbYgL119LCxvD6NG4u0aWnQkYYiTNb7HUEeghhg71dqNDw/ofuMbmtR/U6pjHE4+A24A luFpauStNb9qbf8m8W3vKm3k/75VJ0/7N04vEg4tSsbK0XPFButlR6cxqWn1W3yd/QlI /tsA== 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=J9A4o2K2iqhfJUtmLriAcRX+3ztW8CZjhcHoU3mVSrs=; b=PPEFA7r0pmeMQi4+L9Twp6/3A7tE+ydO9FehLSBNTgHSRk3Aem8UOeb1GiP+L/23J3 2WP1pvGxDG9DqgZnrnjXpygq4sn+ga6Csi9nKn2s8Bj/edMH4exrAdambSPi69IsQiQI nFbH+HiS3cO7LAO9MZLwIJ1sMbbnaR2j+tUIlfiaeumkZV0PwsMi3lGCCDt4KA7q3Q2d 0n71NHG98hnI1MLM/yzGsipxuvcElgT7ay+J9KkR87VWjEaoCfN2+gVp+4VBLfuwKSsB FDcROFLmNZT/LA4q0JDyt2LqSsnlOzuEq+K9mjPhAxnhJbGJ587GV8SPem8wT58PooC2 v6dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jOBxelNw; 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 e22si24066547otj.38.2020.01.02.14.15.08; Thu, 02 Jan 2020 14:15:20 -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; dkim=pass header.i=@kernel.org header.s=default header.b=jOBxelNw; 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 S1727233AbgABWOC (ORCPT + 99 others); Thu, 2 Jan 2020 17:14:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:54096 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727486AbgABWOA (ORCPT ); Thu, 2 Jan 2020 17:14:00 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 22FDE22B48; Thu, 2 Jan 2020 22:13:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003239; bh=dugGQh+eRwzgWQhTrmU1/HMjtDc/HVySpNxi+iizGws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jOBxelNwJyKzjDbxMu2/hJvATlGjN5XYFR/WNx9C1nVWRSmrGvUsNN3k0MqYlHF8c aqBd+8UJrWGUYcnhgUJHWoyFlju7dxBM2j5xGLHsCKM3lltukaj9/YWt/gEbTjEj6k 4z0ro8N7uxXpruJPOr8qG/JQCzxYv7QLyimJxDNg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Jiri Kosina , Sasha Levin Subject: [PATCH 5.4 077/191] HID: logitech-hidpp: Silence intermittent get_battery_capacity errors Date: Thu, 2 Jan 2020 23:05:59 +0100 Message-Id: <20200102215838.172022489@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Hans de Goede [ Upstream commit 61005d65b6c7dcf61c19516e6ebe5acc02d2cdda ] My Logitech M185 (PID:4038) 2.4 GHz wireless HID++ mouse is causing intermittent errors like these in the log: [11091.034857] logitech-hidpp-device 0003:046D:4038.0006: hidpp20_batterylevel_get_battery_capacity: received protocol error 0x09 [12388.031260] logitech-hidpp-device 0003:046D:4038.0006: hidpp20_batterylevel_get_battery_capacity: received protocol error 0x09 [16613.718543] logitech-hidpp-device 0003:046D:4038.0006: hidpp20_batterylevel_get_battery_capacity: received protocol error 0x09 [23529.938728] logitech-hidpp-device 0003:046D:4038.0006: hidpp20_batterylevel_get_battery_capacity: received protocol error 0x09 We are already silencing error-code 0x09 (HIDPP_ERROR_RESOURCE_ERROR) errors in other places, lets do the same in hidpp20_batterylevel_get_battery_capacity to remove these harmless, but scary looking errors from the dmesg output. Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/hid-logitech-hidpp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index 8e91e2f06cb4..cd9193078525 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c @@ -1102,6 +1102,9 @@ static int hidpp20_batterylevel_get_battery_capacity(struct hidpp_device *hidpp, ret = hidpp_send_fap_command_sync(hidpp, feature_index, CMD_BATTERY_LEVEL_STATUS_GET_BATTERY_LEVEL_STATUS, NULL, 0, &response); + /* Ignore these intermittent errors */ + if (ret == HIDPP_ERROR_RESOURCE_ERROR) + return -EIO; if (ret > 0) { hid_err(hidpp->hid_dev, "%s: received protocol error 0x%02x\n", __func__, ret); -- 2.20.1