lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <79890342.HV0Al07Iil@marius>
Date:   Tue, 18 Aug 2020 15:12:22 +0200
From:   Marius Zachmann <mail@...iuszachmann.de>
To:     Guenter Roeck <linux@...ck-us.net>
Cc:     Jean Delvare <jdelvare@...e.com>, linux-hwmon@...r.kernel.org,
        linux-kernel@...r.kernel.org, Jiri Kosina <jikos@...nel.org>,
        Benjamin Tissoires <benjamin.tissoires@...hat.com>,
        linux-input@...r.kernel.org
Subject: Re: [PATCH v2] hwmon: corsair-cpro: fix ccp_probe, add delay [HID related]

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 <mail@...iuszachmann.de>
> 
> 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 <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
> 




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ