openwrt/package/kernel/lantiq/ltq-vdsl-mei/patches
Jan Hoffmann 1700424553 ltq-vdsl-mei: add locking to interrupt handler
Some users noticed repeated resyncs at random intervals, which go away
when the MEI driver is configured to use polling instead of interrupts.
Debugging shows that this seems to be caused by concurrent calls to
MEI_ReadMailbox (in the interrupt handler) and MEI_WriteMailbox. This
appears to be mostly triggered when there is an interrupt for vectoring
error reports.

In polling mode, calls to MEI_ReadMailbox are protected by the same
semaphore as is used in MEI_WriteMailbox. When interrupts are used,
MEI_WriteMailbox appears to rely on MEI_DisableDeviceInt and
MEI_EnableDeviceInt to provide mutual exclusion with the interrupt
handler. These functions mask/unmask interrupts, and there is an
additional check of the mask in the interrupt handler itself. However,
this is not sufficient on systems with SMP, as the interrupt handler
may be running in parallel, and could already be past the interrupt
mask check at this point.

This adds a lock to the interrupt handler, and also acquires this lock
in MEI_DisableDeviceInt. This should make sure that after a call to
MEI_DisableDeviceInt the interrupt is masked, and the interrupt handler
is either not running, has alread finished its work, or is still before
the interrupt mask check, and is thus going to detect the change.

Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2022-03-21 12:28:37 +00:00
..
001-fix-compile.patch ltq-vdsl-mei: Fix section mismatch 2018-03-18 14:06:00 +01:00
010-warnings.patch ltq-vdsl-mei: update mei driver to version 1.5.17.6 2016-09-20 22:43:43 +02:00
020-not-leak-cflags.patch lantiq: ltq-vdsl-mei: Do not leak user space CFLAGS into kernel space 2018-03-03 00:53:35 +01:00
030-no-static-linking.patch ltq-vdsl-mei: Remove static linking 2022-01-21 23:09:24 +01:00
100-compat.patch ltq-vdsl-mei: enable vectoring error sample callback 2022-03-21 12:28:31 +00:00
101_no-date-time.patch lantiq: ltq-vdsl-mei: add kernel 5.10 compatiblity 2021-04-12 23:23:09 +02:00
110-reset-g_tx_link_rate-on-showtime-exit.patch ltq-vdsl-mei: reset g_tx_link_rate on showtime exit 2018-06-09 16:32:39 +02:00
200-interrupt-lock.patch ltq-vdsl-mei: add locking to interrupt handler 2022-03-21 12:28:37 +00:00