Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2095395pxa; Sun, 16 Aug 2020 23:55:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGaOtCJ2DXJYy2DsHdy88DdJ2MR1Nbd1FKRgVdQ2wykMahV84P/25V1cc2l4uGUwYozQmm X-Received: by 2002:a17:906:b2d0:: with SMTP id cf16mr13606257ejb.514.1597647334293; Sun, 16 Aug 2020 23:55:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597647334; cv=none; d=google.com; s=arc-20160816; b=azoQptZJTL/kSOwLWV4GHOID3MplK32Ji/ymdeuVi4nH9hJoZDHqL7FhhkbSoa+4Ft RWvSGIpO5I3VxcmS/no/OCIgwMDqj1PeGvdL7rQrhXfbVjRGMyTuIkKwxFr0Z16+KIN8 9y50ajQgwVAsAdIy8eRGJ0kPkI8MMzTpq6lSPfloYFWWV/cY+2VZnEIVNQxkx8QNQBmN 9p3gSwDJmq3eAyDQO5wzi6svBeSz2o0IQMcUv+18JEkCGfnSLmYJanPdyjKnCWj6tAyr OJbQGT0ZgZhzKY6Q23LCTVsRMmqJjwhDp7nVSaSkV2GIFP7kKEp5rj0Xn5ja+DT37KTm 8vxg== 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 :message-id:date:subject:cc:to:from; bh=7d/F8q2DZtmKSDfyL72QEIi4Hnghkvz3tgj3AiYVSmw=; b=zdhUlHLi/gyPEsB6B/tE+7+ejQk0tTpCWUK+DrNafWEhPXWWoEp+a3UDnMX2i8zTkc hwwaDERQMKqZs+rMCLaq2vHXwMOgv2Ljx24s8wvYeWFP8edA06BKbVdWtRjy5+bMpgQU SgIJBGKwhr90+WXBmw0atgO1qI52C5d2q1pLMhWhzTgquSDKWueksDR4n3OL/YtO3Fbp /VVTgVo8PKLXUfgfveN7Kr3GRI+iCHVmqg0+trsvNgZhErmX215FYe3lslFuQG1LgT8E xMDzureK2benIyGsLl7mUZlNd8Vx1m0uiMZk8M8N2cUYVgZIpllkcI5JPhfShHBTAkzl WOug== 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 lv25si10845670ejb.396.2020.08.16.23.55.11; Sun, 16 Aug 2020 23:55:34 -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 S1726366AbgHQGyg (ORCPT + 99 others); Mon, 17 Aug 2020 02:54:36 -0400 Received: from ms-10.1blu.de ([178.254.4.101]:55070 "EHLO ms-10.1blu.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726196AbgHQGyf (ORCPT ); Mon, 17 Aug 2020 02:54:35 -0400 Received: from [78.43.71.214] (helo=marius.fritz.box) by ms-10.1blu.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k7Z2O-0005sJ-9z; Mon, 17 Aug 2020 08:54:32 +0200 From: Marius Zachmann To: Guenter Roeck Cc: Marius Zachmann , Jean Delvare , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] hwmon: corsair-cpro: fix ccp_probe, add delay Date: Mon, 17 Aug 2020 08:54:28 +0200 Message-Id: <20200817065428.5974-1-mail@mariuszachmann.de> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Con-Id: 241080 X-Con-U: 0-mail 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 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 --- drivers/hwmon/corsair-cpro.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/corsair-cpro.c b/drivers/hwmon/corsair-cpro.c index 591929ec217a..6359409e6c71 100644 --- a/drivers/hwmon/corsair-cpro.c +++ b/drivers/hwmon/corsair-cpro.c @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -513,8 +514,8 @@ 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); /* make sure, events can be received */ - /* temp and fan connection status only updates when device is powered on */ ret = get_temp_cnct(ccp); if (ret) goto out_hw_close; -- 2.28.0