public inbox for linux-hwmon@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwmon: corsair-cpro: fix ccp_probe, add delay
@ 2020-08-17  6:54 Marius Zachmann
  0 siblings, 0 replies; only message in thread
From: Marius Zachmann @ 2020-08-17  6:54 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Marius Zachmann, Jean Delvare, linux-hwmon, linux-kernel

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 <mail@mariuszachmann.de>
---
 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 <linux/bitops.h>
 #include <linux/completion.h>
+#include <linux/delay.h>
 #include <linux/hid.h>
 #include <linux/hwmon.h>
 #include <linux/kernel.h>
@@ -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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-17  6:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-17  6:54 [PATCH] hwmon: corsair-cpro: fix ccp_probe, add delay Marius Zachmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox