From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1FC3C2D0B1 for ; Tue, 4 Feb 2020 14:57:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A1A9720674 for ; Tue, 4 Feb 2020 14:57:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727279AbgBDO5w (ORCPT ); Tue, 4 Feb 2020 09:57:52 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:46488 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1727275AbgBDO5w (ORCPT ); Tue, 4 Feb 2020 09:57:52 -0500 Received: (qmail 1705 invoked by uid 2102); 4 Feb 2020 09:57:50 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 4 Feb 2020 09:57:50 -0500 Date: Tue, 4 Feb 2020 09:57:50 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Lauri Jakku cc: oneukum@suse.com, , , , , Subject: Re: [PATCH v4] USB: HID: random timeout failures tackle try. In-Reply-To: <20200204144634.7622-1-lja@iki.fi> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org On Tue, 4 Feb 2020, Lauri Jakku wrote: > -- v1 ------------------------------------------------------------ > send, 20ms apart, control messages, if error is timeout. > > There is multiple reports of random behaviour of USB HID devices. > > I have mouse that acts sometimes quite randomly, I debugged with > logs others have published that there is HW timeouts that leave > device in state that it is errorneus. > > To fix this I introduced retry mechanism in root of USB HID drivers. > > Fix does not slow down operations at all if there is no -ETIMEDOUT > got from control message sending. If there is one, then sleep 20ms > and try again. Retry count is 20 witch translates maximium of 400ms > before giving up. > > NOTE: This does not sleep anymore then before, if all is golden. How do other operating systems handle these problems? Perhaps we should use the same approach. Also, if this problem only affects USB HID devices, why not put the fix in the usbhid driver rather than the USB core? Alan Stern