openwrt/package/kernel/lantiq
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
..
ltq-adsl
ltq-adsl-fw
ltq-adsl-mei
ltq-atm
ltq-deu ltq-deu: disable arc4 algorithm 2022-01-06 00:23:15 +01:00
ltq-ifxos ltq-ifxos: update to 1.7.1 2022-01-08 00:49:59 +01:00
ltq-ptm
ltq-tapi
ltq-vdsl ltq-vdsl: move to the default device name /dev/dsl_cpe_api/0 2022-01-08 00:49:59 +01:00
ltq-vdsl-fw ltq-vdsl-fw: update w921v firmware download URL 2021-11-15 15:18:03 +00:00
ltq-vdsl-mei ltq-vdsl-mei: add locking to interrupt handler 2022-03-21 12:28:37 +00:00
ltq-vectoring ltq-vectoring: add driver 2022-03-21 12:28:26 +00:00
ltq-vmmc