]> git.baikalelectronics.ru Git - kernel.git/commit
usb: mtu3: add memory barrier before set GPD's HWO
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Sat, 18 Dec 2021 09:57:47 +0000 (17:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Dec 2021 08:05:44 +0000 (09:05 +0100)
commit768753d2ecea679ef2b4001ed6168054655f5300
tree602a8f6ab6e97a5192df7f8159ee92d53e4e0f7e
parent72df6b7765a1984344c40eef2c062ddcace15e00
usb: mtu3: add memory barrier before set GPD's HWO

There is a seldom issue that the controller access invalid address
and trigger devapc or emimpu violation. That is due to memory access
is out of order and cause gpd data is not correct.
Add mb() to prohibit compiler or cpu from reordering to make sure GPD
is fully written before setting its HWO.

Fixes: a3302ba81173 ("usb: mtu3: supports new QMU format")
Cc: stable@vger.kernel.org
Reported-by: Eddie Hung <eddie.hung@mediatek.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20211218095749.6250-2-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/mtu3/mtu3_qmu.c