Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3080010pxa; Tue, 18 Aug 2020 06:13:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFKtSAo62QeAIUmwxlwut637kWoewlaj9AWV+UaBW+mREvxSU+bGkSk1b6chMqy2eJX6l0 X-Received: by 2002:a17:906:f912:: with SMTP id lc18mr19558240ejb.226.1597756413001; Tue, 18 Aug 2020 06:13:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597756412; cv=none; d=google.com; s=arc-20160816; b=RI6oWLMnGVoxB7l1Kf/gNPsTHcBXkIfpF2e5TFjFCs8bvd91VS6f/JlDFBtx3r/8ZJ opYwUNtQCRdtWvSc0AFi0tlLqocfLOSEmI9CjNGiqP/d33Y0Vt5cwn2SN8Z4ylsqFU3C 7mR0zgS5d3dKIKM2Oi0d/U2DxlRPEgxLbBLfW9lq0m+/RyejNe19El7O6tWe+7RHPVqy 819U59KrYT0QdyoVRn2LgB9dFnDFg66cLib7goz/L9Yo2M6V54CDETaEKb1yBrxq+zDP DfjUA9xTa2X2yYhbtI+TX1eCAI3vuScefy3bdWqkERpsioUAQhDBkC1F29Ie95ifXUbC 73NA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=fE9Cvax/9g9C06erfDLu76YV0Q6ncyiv4OoYw1Zc7TE=; b=xOVLSm00+LTtIkqIy/GyF2lxTxJg5EX8jxq23I1dgINQT7MGpVwDcXcD8rolxJO7Yx IFUDRCE0tvoOSYkL6dTVn1oNbdHHsogrbLCfj/6I+8wul6v7MMtZ3o05TiCNtJKw3NLB JdLuj4bISJVDHS5dEZLsMvusnGQQgC+zzcHuw8RFjQVhTUICbDR+joQlGONzghukZT4w dDw5W28KSOnsXGX556uUEVVN1nQ5bsiEyu8ey+zmB7GA8lkI1YQEBo9tb8+k4OLDSQW3 wmCMdXkwCGHIo8UNohbq06una1FK/fc/ix0gsgSs8BTS69lwlrJe8BH05brn2fHlYGY5 aZYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rs7si14015847ejb.195.2020.08.18.06.13.05; Tue, 18 Aug 2020 06:13:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726482AbgHRNM2 (ORCPT + 99 others); Tue, 18 Aug 2020 09:12:28 -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 >