OSDN Git Service

hwmon: (aquacomputer_d5next) Add selective 200ms delay after sending ctrl report
authorAleksa Savic <savicaleksa83@gmail.com>
Mon, 7 Aug 2023 17:20:03 +0000 (19:20 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 10 Aug 2023 04:09:47 +0000 (21:09 -0700)
commit56b930dcd88c2adc261410501c402c790980bdb5
tree1e29455b1098e36ad0bcb750e569c45eaff1fcde
parentf38963b9cd0645a336cf30c5da2e89e34e34fec3
hwmon: (aquacomputer_d5next) Add selective 200ms delay after sending ctrl report

Add a 200ms delay after sending a ctrl report to Quadro,
Octo, D5 Next and Aquaero to give them enough time to
process the request and save the data to memory. Otherwise,
under heavier userspace loads where multiple sysfs entries
are usually set in quick succession, a new ctrl report could
be requested from the device while it's still processing the
previous one and fail with -EPIPE. The delay is only applied
if two ctrl report operations are near each other in time.

Reported by a user on Github [1] and tested by both of us.

[1] https://github.com/aleksamagicka/aquacomputer_d5next-hwmon/issues/82

Fixes: 752b927951ea ("hwmon: (aquacomputer_d5next) Add support for Aquacomputer Octo")
Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com>
Link: https://lore.kernel.org/r/20230807172004.456968-1-savicaleksa83@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/aquacomputer_d5next.c