linux_dsm_epyc7002/drivers/net/wireless/rtl818x/rtl8187
Stanislaw Gruszka b6213e413a rtl8187: fix regression on MIPS without coherent DMA
This patch fixes regression caused by commit a16dad7763 "MIPS: Fix
potencial corruption". That commit fixes one corruption scenario in
cost of adding another one, which actually start to cause crashes
on Yeeloong laptop when rtl8187 driver is used.

For correct DMA read operation on machines without DMA coherence, kernel
have to invalidate cache, such it will refill later with new data that
device wrote to memory, when that data is needed to process. We can only
invalidate full cache line. Hence when cache line includes both dma
buffer and some other data (written in cache, but not yet in main
memory), the other data can not hit memory due to invalidation. That
happen on rtl8187 where struct rtl8187_priv fields are located just
before and after small buffers that are passed to USB layer and DMA
is performed on them.

To fix the problem we align buffers and reserve space after them to make
them match cache line.

This patch does not resolve all possible MIPS problems entirely, for
that we have to assure that we always map cache aligned buffers for DMA,
what can be complex or even not possible. But patch fixes visible and
reproducible regression and seems other possible corruptions do not
happen in practice, since Yeeloong laptop works stable without rtl8187
driver.

Bug report:
https://bugzilla.kernel.org/show_bug.cgi?id=54391

Reported-by: Petr Pisar <petr.pisar@atlas.cz>
Bisected-by: Tom Li <biergaizi2009@gmail.com>
Reported-and-tested-by: Tom Li <biergaizi2009@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Acked-by: Larry Finger <Larry.Finger@lwfinger.next>
Acked-by: Hin-Tak Leung <htl10@users.sourceforge.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 14:58:12 -05:00
..
dev.c wireless: delete non-required instances of include <linux/init.h> 2014-01-03 15:37:01 -05:00
leds.c rtl8187: ->brightness_set can not sleep 2012-06-08 13:43:57 -04:00
leds.h
Makefile
rfkill.c
rfkill.h
rtl8187.h rtl8187: fix regression on MIPS without coherent DMA 2014-02-13 14:58:12 -05:00
rtl8225.c wireless: delete non-required instances of include <linux/init.h> 2014-01-03 15:37:01 -05:00
rtl8225.h Update e-mail address for Andrea Merello (resubmit) 2013-08-26 14:10:40 -04:00