Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11793177pjo; Thu, 2 Jan 2020 14:22:38 -0800 (PST) X-Google-Smtp-Source: APXvYqzmKE6gGQj23obeEqjdQ5Wr6DX0YftH4aMc1FdgtQ3DPFrPjWWVh7V/RsnllBmFL1gFj72X X-Received: by 2002:aca:dc8b:: with SMTP id t133mr3213375oig.98.1578003757927; Thu, 02 Jan 2020 14:22:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578003757; cv=none; d=google.com; s=arc-20160816; b=LIjwtg0glJbW2iKpoNqZk941VG4bRIQImPdrnCNiI7b8yGiuYk6DTFBsGfppMkVM50 TnOuGMsFngsKkPuYwSDUcPSUrC/k3C3tAZymd9Pv2j3kHkGdnWGKlJIsqk3Ky6G+0Jzb kCf0yVxnBDRbkWXuYsnp4bi00w07IB0haAo5i5qrD2bBY/bIanUyss/EYOp4sxzbM0Md 3Cq8wKi2/0m0dhBqp6TB+akHBwNXN3odg4MXhLIw06nj45C7qfdLiKf5t7X5/wNNrDzy Q1zYilp1/4E2HYh52qucg0NskDUCEyS8iiUW3ADWiiYS8ZZmJ33c/5WGLLKkErt1lNuJ mWbg== 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=ZrFn+e+HvDCbwmoCKWXUR1SIffmGPwPZ92Shkc9J4dg=; b=olOdW9IBUwpCm58tLomEJPuKyp0ja9nn1tH+XiHJGIYOOTLgbzyL0g/o4bz2A95SQV UjOZBxLK0GDqrP6ZZ/m5b8bLc6v98q0aHGVD2nqwWPahAiW5LRbNASwOdnREPoR6lSco 9mHIRjScKU2CFbfNun0dEzXSfhPr9xl9xuqwqN6bpJZxfHi/K96PNG2oAxF3mlx48aZZ 5S0NDZhGc20ZEdjSAmBnF4nTyf+ziztE+VRiTBqg1cn1IwHJ8klMRXbLJWoE2tnLcsqn Buk6ONZMZFHojmS+V6uE6TpanD6YtLh9M5KVyuinD5SgieOoM5NX/Ka/hyjN0PuXM7E/ AShw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KwXloE12; 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 v3si10213195oth.104.2020.01.02.14.22.26; Thu, 02 Jan 2020 14:22:37 -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=KwXloE12; 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 S1728150AbgABWVv (ORCPT + 99 others); Thu, 2 Jan 2020 17:21:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:41292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728549AbgABWVo (ORCPT ); Thu, 2 Jan 2020 17:21:44 -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 AA5E520863; Thu, 2 Jan 2020 22:21:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003704; bh=IMnRsSSckyMOsSAOuTqewPq4T1YIvHzAbfUt8u6pdeo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KwXloE12DRKMzD4hDy+CSzS2w1lcbs7h7QcLaHqhdsqvmkjYde0Yc7cgjSb5hNIHP groPbA9YZAb2k/865zWKQASXH1NVyO8zMXuo0lXN1D5jq5WT1+MWue4Ac9BI9XxC+P wtzpbZ2eyVAMzJ5N0s+GPjnR4rKn3LGD4SurC1jA= 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 4.19 046/114] HID: logitech-hidpp: Silence intermittent get_battery_capacity errors Date: Thu, 2 Jan 2020 23:06:58 +0100 Message-Id: <20200102220033.733967047@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220029.183913184@linuxfoundation.org> References: <20200102220029.183913184@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 034c883e57fa..504e8917b06f 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c @@ -978,6 +978,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