lantiq: nand: don't yield while holding spinlock
authorThomas Nixon <tom@tomn.co.uk>
Sun, 26 Mar 2023 10:19:21 +0000 (10:19 +0000)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 2 Apr 2023 15:08:45 +0000 (17:08 +0200)
commitd3b47909b199b876f67a0387b5545cb73bd6b815
tree4323973b3d9b749796f2e443baec7e5b282199a4
parent4467cf8e418e8003324990541b199d313b7c9235
lantiq: nand: don't yield while holding spinlock

The nand driver normally while waiting for the device to become ready;
this is normally fine, but xway_nand holds the ebu_lock spinlock, and
this can cause lockups if other threads which use ebu_lock are
interleaved. Fix this by waiting instead of polling.

This mainly showed up as crashes in ath9k_pci_owl_loader (see
https://github.com/openwrt/openwrt/issues/9829 ), but turning on
spinlock debugging shows this happening in other places too.

This doesn't seem to measurably impact boot time.

Tested on bt_homehub-v5a with 5.10 and 5.15.

Signed-off-by: Thomas Nixon <tom@tomn.co.uk>
[Add commit description into patch]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/lantiq/patches-5.10/0400-mtd-rawnand-xway-don-t-yield-while-holding-spinlock.patch [new file with mode: 0644]
target/linux/lantiq/patches-5.15/0400-mtd-rawnand-xway-don-t-yield-while-holding-spinlock.patch [new file with mode: 0644]