Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2098602pxa; Mon, 17 Aug 2020 00:03:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyauVo2eza/S9qv1GspxCQzetYEDK6wcoIXflnVJ15aL75Vkat+aAVKqTgAfySVOmfEVZSC X-Received: by 2002:aa7:dd91:: with SMTP id g17mr14182741edv.186.1597647828785; Mon, 17 Aug 2020 00:03:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597647828; cv=none; d=google.com; s=arc-20160816; b=OgKC7ILU3FU4ryIqg74XPNM/e9bv3BwGuEhjl263R6kF1tTMD5ZZHKMngO0sBfl1yv +v1m6M2KxrbJP6BXGNI7AsdC987BiEk9gP0XfuqMUDQ4rg6P1g0VN8px1KlsozW3P1cM kUY654Jk7Mx6bNWOgBcSCxNt648KGEQmqjtXl4oOwToBcEVxmnoakKQ3VvZ3eI0wMbBK kLE9Y7lz6EzxcqIE6Oy1mAUHaunDyfDztZi896gzKW8QV3tWgmh31IOvzL8Cw/I6OEIr M4AUe1r06+aK8IYiHb5TXwLl941WrP/ZowV1uvGvxPAoe4zpQoKEJSu5a7VLKiGHjJ2b Ju6Q== 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=3lJIWxGL6kM4CW8da3qJ60TWCYiYjy/T4MnSmg74otI=; b=pJqJgq4vMc89gW6DPysV24knW3981BT4XBSc9w5DPSP8VxlONCyBp9sUcYThmW/5h8 Z2Up5J9oaIGitP4wzzZsFqG+cHVG25vgU7tcIumvDxcudPDNCd+ImmiC+92xWaprRgRu IbrHbln4igLPOlVDVeceyq1Cbs9UOi1Tab5zydmRDhFitVcd7JNiicRvh2dN3B7D13IX 8l+gMGWU7vE1KlHEI1x9ZEJP5I1D8sh7VzGFX9Ghg4bv8pYxRsOwO+d6tsXotyzrRMSC tiuyItHeR54eAh6EZRnjI6OlEzJl2mzYwk1qd2UR9VbbLAHlWQ9GpXo9GeUsavhu0Kar N+8A== 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 bo27si10535093edb.0.2020.08.17.00.03.25; Mon, 17 Aug 2020 00:03:48 -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 S1726798AbgHQHBs (ORCPT + 99 others); Mon, 17 Aug 2020 03:01:48 -0400 Received: from ms-10.1blu.de ([178.254.4.101]:40302 "EHLO ms-10.1blu.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726613AbgHQHAr (ORCPT ); Mon, 17 Aug 2020 03:00:47 -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 1k7Z8N-00009O-MZ; Mon, 17 Aug 2020 09:00:43 +0200 From: Marius Zachmann To: Guenter Roeck Cc: Marius Zachmann , Jean Delvare , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] hwmon: corsair-cpro: fix ccp_probe, add delay Date: Mon, 17 Aug 2020 09:00:40 +0200 Message-Id: <20200817070040.7952-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 --- 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