aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mvebu
diff options
context:
space:
mode:
authorJan Hoffmann <jan@3e8.eu>2022-03-13 22:14:38 +0100
committerDaniel Golle <daniel@makrotopia.org>2022-03-21 12:28:37 +0000
commit17004245534731ab03c9a8683208e84d9c399979 (patch)
treed0074e9db382c88d6e3ab98d57c977fed5943933 /target/linux/mvebu
parentb35d33c8b8a7b96f06179982b5d944cde7234004 (diff)
downloadupstream-17004245534731ab03c9a8683208e84d9c399979.tar.gz
upstream-17004245534731ab03c9a8683208e84d9c399979.tar.bz2
upstream-17004245534731ab03c9a8683208e84d9c399979.zip
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>
Diffstat (limited to 'target/linux/mvebu')
0 files changed, 0 insertions, 0 deletions