From: Guenter Roeck <linux@roeck-us.net>
To: Marius Zachmann <mail@mariuszachmann.de>
Cc: Jean Delvare <jdelvare@suse.com>,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
linux-input@vger.kernel.org
Subject: Re: [PATCH v2] hwmon: corsair-cpro: fix ccp_probe, add delay [HID related]
Date: Mon, 17 Aug 2020 08:35:33 -0700 [thread overview]
Message-ID: <20200817153533.GA243558@roeck-us.net> (raw)
In-Reply-To: <20200817070040.7952-1-mail@mariuszachmann.de>
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 <mail@mariuszachmann.de>
Let's just ask the HID maintainers. Is this expected, and the correct fix ?
Thanks,
Guenter
> ---
> 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 <linux/bitops.h>
> #include <linux/completion.h>
> +#include <linux/delay.h>
> #include <linux/hid.h>
> #include <linux/hwmon.h>
> #include <linux/kernel.h>
> @@ -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
next prev parent reply other threads:[~2020-08-17 15:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-17 7:00 [PATCH v2] hwmon: corsair-cpro: fix ccp_probe, add delay Marius Zachmann
2020-08-17 15:35 ` Guenter Roeck [this message]
2020-08-18 13:12 ` [PATCH v2] hwmon: corsair-cpro: fix ccp_probe, add delay [HID related] Marius Zachmann
2020-08-18 13:42 ` Guenter Roeck
2020-08-18 17:51 ` Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200817153533.GA243558@roeck-us.net \
--to=linux@roeck-us.net \
--cc=benjamin.tissoires@redhat.com \
--cc=jdelvare@suse.com \
--cc=jikos@kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mail@mariuszachmann.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).