1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-06-29 20:34:19 +02:00
openwrt/package
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
..
base-files base-files: add wrapper for procd service list command 2022-03-19 16:13:58 +01:00
boot mediatek: Add support for Xiaomi Redmi Router AX6S 2022-03-20 18:33:39 +00:00
devel strace: Update to version 5.16 2022-02-01 21:25:02 +01:00
firmware cypress-firmware: update it to version 5.4.18-2021_0812 2022-03-19 16:13:58 +01:00
kernel ltq-vdsl-mei: add locking to interrupt handler 2022-03-21 12:28:37 +00:00
libs ncurses: update to 6.3 2022-03-19 17:42:29 +01:00
network ltq-vdsl-app: set MAC address for vectoring error reports 2022-03-21 12:28:34 +00:00
system procd: move service command to procd 2022-03-19 16:13:58 +01:00
utils util-linux: add lsns 2022-03-05 21:05:45 +01:00
Makefile