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=-9.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 20CB3C433DF for ; Tue, 18 Aug 2020 13:12:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0693F20706 for ; Tue, 18 Aug 2020 13:12:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726569AbgHRNM3 (ORCPT ); Tue, 18 Aug 2020 09:12:29 -0400 Received: from ms-10.1blu.de ([178.254.4.101]:59348 "EHLO ms-10.1blu.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726145AbgHRNM1 (ORCPT ); Tue, 18 Aug 2020 09:12:27 -0400 Received: from [78.43.71.214] (helo=marius.localnet) by ms-10.1blu.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k81Pb-00086x-EN; Tue, 18 Aug 2020 15:12:23 +0200 From: Marius Zachmann To: Guenter Roeck Cc: Jean Delvare , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org Subject: Re: [PATCH v2] hwmon: corsair-cpro: fix ccp_probe, add delay [HID related] Date: Tue, 18 Aug 2020 15:12:22 +0200 Message-ID: <79890342.HV0Al07Iil@marius> In-Reply-To: <20200817153533.GA243558@roeck-us.net> References: <20200817070040.7952-1-mail@mariuszachmann.de> <20200817153533.GA243558@roeck-us.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Con-Id: 241080 X-Con-U: 0-linux X-Originating-IP: 78.43.71.214 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18.08.20 at 17:35:33 CEST, Guenter Roeck wrote > On Mon, Aug 17, 2020 at 09:00:40AM +0200, Marius Zachmann wrote: > > Possibly because of the changes in usbhid/hid-core.c the first > > raw input report is not received during ccp_probe function and it will > > timeout. I am not sure, whether this behaviour is expected after > > hid_device_io_start or if I am missing something. > > As a solution this adds msleep(50) to ccp_probe so that all initial > > input reports can be received. > > > > Signed-off-by: Marius Zachmann > > Let's just ask the HID maintainers. Is this expected, and the correct fix ? > > Thanks, > Guenter > This seems to be a problem with "HID: usbhid: do not sleep when opening device". There is a bug report with some Logitech devices at the correct thread. These drivers also use hid_device_io_start and fail. Seems to me, this is the same problem and I retract this (not so beautiful) fix until this is sorted out. Thanks, Marius > > --- > > v2: > > - fix accidentally deleted comment > > > > --- > > drivers/hwmon/corsair-cpro.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/hwmon/corsair-cpro.c b/drivers/hwmon/corsair-cpro.c > > index 591929ec217a..c04fac1d820f 100644 > > --- a/drivers/hwmon/corsair-cpro.c > > +++ b/drivers/hwmon/corsair-cpro.c > > @@ -10,6 +10,7 @@ > > > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -513,6 +514,7 @@ static int ccp_probe(struct hid_device *hdev, const struct hid_device_id *id) > > init_completion(&ccp->wait_input_report); > > > > hid_device_io_start(hdev); > > + msleep(50); /* wait before events can be received */ > > > > /* temp and fan connection status only updates when device is powered on */ > > ret = get_temp_cnct(ccp); > > -- > > 2.28.0 >