I feel that some bottom-line check is needed if we keep the linear position over the buffer size even without the period irq. If the app doesn't care, OK fine, the driver shouldn't care, too. But then it doesn't make sense to keep the linear position, either.
But if we can keep the linear position using the light-weight jiffies check, it's probably OK to keep it rather than changing the hw_ptr behaviour.
Well, but the point of the patch is to avoid wakeups as much as possible. The jiffies-check adds an unconditional wakeup for each buffer size, thus it's against the purpose of the patch.
I don't see any wakeup.
The CPU is woken up. This is to be avoided.
Nope. No timers are used. The jiffies check and hw_ptr correction should be done from the avail_update call invoked from an application.
ok, so I re-implemented all the points found in the reviews except for this thread. There's already some code to see if we go beyond the buffer boundaries, so I am not sure what the 'linear position' means. Do I need to implement anything specific to check the validity of the hw_ptr values? I am not clear if I need to do anything beyond the fix attached, and I don't honestly understand all these checks with jiffies. Thanks. -Pierre