1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-10-18 13:29:16 +02:00
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 lantiq: ltq-adsl: add kernel 5.10 compatiblity 2021-04-12 23:23:09 +02:00
ltq-adsl-fw
ltq-adsl-mei
ltq-atm ltq-atm/ltq-ptm: add kernel 5.10 compatiblity 2021-04-12 23:23:09 +02:00
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-atm/ltq-ptm: add kernel 5.10 compatiblity 2021-04-12 23:23:09 +02:00
ltq-tapi lantiq: ltq-tapi: add kernel 5.10 compatiblity 2021-04-12 23:23:09 +02:00
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 kernel: lantiq: fix Module.symvers handling 2021-02-18 08:43:08 +01:00