Re: [PATCH v8 3/9] Input: qcom-pmi8998-haptics - Add Qualcomm PMI8998 haptics driver
From: Dmitry Torokhov
Date: Tue Dec 01 2026 - 14:54:50 EST
On Tue, Dec 01, 2026 at 10:57:47AM +0100, David Heidelberg wrote:
> On 01/12/2026 05:48, Dmitry Torokhov wrote:
> > The biggest issue here is that the driver grew to over 2000 lines mostly
> > because it uses input_ff_create() and implements its own asynchronous FF
> > scheduler (effect array, request queue, spinlock, and multiple work
> > items). Since this hardware has no autonomous effect memory or replay
> > timer, please switch to input_ff_create_memless() like the other
> > vibrator drivers in drivers/input/misc/. That gives proper handling of
> > replay.delay, repeat counts, FF_GAIN, envelopes, and effect combining,
> > avoids hand-rolling partial FF_SINE and FF_CONSTANT support, and drops
> > the custom queue and work races (including the work()/erase() race
> > Sashiko pointed out).
>
> Hi Dmitry.
>
> What about our waveform buffer the HW has, I wouldn't be able to utilize it with
> ff-memless, if I'm correct. While I currently dislike the extra complexity, the
> problem why I went with this approach was mostly because ff-memless couldn't do
> much.
Right, the question is if we actually need to support this unless we
agree on and document what custom waveform means and whether there are
real users of it. If not, then I do not think it makes sense to keep the
custom effect scheduler that is also limited.
Also, why do we need qcom,play-mode in DT at all if the hardware can
switch modes per effect? Are there boards that can't use direct mode for
normal effects?
>
> >
> > As a heads up, I am looking into reworking the FF core and ff-memless to
> > better handle suspend, resume, and "slow" (sleepable) memoryless
> > devices. There is no need to wait on that work, though: a slim driver
> > built on the existing input_ff_create_memless() with a single
> > work_struct will be straightforward to adapt once those changes land.
>
> If I go for the memless, are there planned at least some changes to, f.e. use
> the waveform buffers, e.g. opposite of memless?
No, my changes are only about suspend/resume and sleepable playback for
memoryless devices which should simplify this driver quite a bit.
If we really need to support FF_CUSTOM then we'll have to stay with
input_ff_create() (or move over to it at a later time).
Thanks.
--
Dmitry