Re: [PATCH] HID: pidff: bound the unit exponent rescaling loop

From: Shengzhuo Wei

Date: Mon Nov 02 2026 - 11:41:03 EST


Hi Tomasz,

Thanks for testing and reviewing the patch.

> Should we maybe add a warning to the driver that the time exponent might
> be out of a sane range? Sane range being, say, 10 to 0? This of course
> would have to happen during init stage not to spam dmesg.

For the initialization-time warning, would -8 to 0 be a reasonable
exponent range?

- -8 is the lowest exponent in the commonly used signed 4-bit HID
encoding.
- 0 allows a time unit of one second.
- Positive exponents 1 through 7 would give time units of ten seconds
or more, which seem unusually coarse for force-feedback effects.

This would only be a warning threshold: the driver would still accept
the device and leave the rescaling behavior unchanged.

Does that match what you had in mind, or would you prefer a different
range?

Thanks,
Shengzhuo