android_kernel_xiaomi_sm7250/drivers/dma
Andy Shevchenko 87cb81e69b dmaengine: dmatest: Fix iteration non-stop logic
commit b9f960201249f20deea586b4ec814669b4c6b1c0 upstream.

Under some circumstances, i.e. when test is still running and about to
time out and user runs, for example,

	grep -H . /sys/module/dmatest/parameters/*

the iterations parameter is not respected and test is going on and on until
user gives

	echo 0 > /sys/module/dmatest/parameters/run

This is not what expected.

The history of this bug is interesting. I though that the commit
  2d88ce76eb ("dmatest: add a 'wait' parameter")
is a culprit, but looking closer to the code I think it simple revealed the
broken logic from the day one, i.e. in the commit
  0a2ff57d6f ("dmaengine: dmatest: add a maximum number of test iterations")
which adds iterations parameter.

So, to the point, the conditional of checking the thread to be stopped being
first part of conjunction logic prevents to check iterations. Thus, we have to
always check both conditions to be able to stop after given iterations.

Since it wasn't visible before second commit appeared, I add a respective
Fixes tag.

Fixes: 2d88ce76eb ("dmatest: add a 'wait' parameter")
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20200424161147.16895-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-06 08:13:32 +02:00
..
bestcomm
dw
dw-axi-dmac
hsu
ioat
ipu
mediatek
ppc4xx
qcom
sh
ti
xilinx
acpi-dma.c
altera-msgdma.c
amba-pl08x.c
at_hdmac_regs.h
at_hdmac.c
at_xdmac.c
bcm2835-dma.c
bcm-sba-raid.c
coh901318_lli.c
coh901318.c dmaengine: coh901318: Fix a double lock bug in dma_tc_handle() 2020-03-11 14:15:12 +01:00
coh901318.h
dma-axi-dmac.c
dma-jz4740.c
dma-jz4780.c
dmaengine.c
dmaengine.h
dmatest.c dmaengine: dmatest: Fix iteration non-stop logic 2020-05-06 08:13:32 +02:00
ep93xx_dma.c
fsl_raid.c
fsl_raid.h
fsl-edma.c
fsldma.c
fsldma.h
idma64.c
idma64.h
img-mdc-dma.c
imx-dma.c
imx-sdma.c dmaengine: imx-sdma: remove dma_slave_config direction usage and leave sdma_event_enable() 2020-03-11 14:15:08 +01:00
iop-adma.c
k3dma.c
Kconfig
lpc18xx-dmamux.c
Makefile
mic_x100_dma.c
mic_x100_dma.h
mmp_pdma.c
mmp_tdma.c
moxart-dma.c
mpc512x_dma.c
mv_xor_v2.c
mv_xor.c
mv_xor.h
mxs-dma.c
nbpfaxi.c
of-dma.c
owl-dma.c
pch_dma.c
pl330.c
pxa_dma.c
s3c24xx-dma.c
sa11x0-dma.c
sirf-dma.c
sprd-dma.c
st_fdma.c
st_fdma.h
ste_dma40_ll.c
ste_dma40_ll.h
ste_dma40.c
stm32-dma.c
stm32-dmamux.c
stm32-mdma.c
sun4i-dma.c
sun6i-dma.c
tegra20-apb-dma.c dmaengine: tegra-apb: Prevent race conditions of tasklet vs free list 2020-03-11 14:15:04 +01:00
tegra210-adma.c
timb_dma.c
TODO
txx9dmac.c
txx9dmac.h
virt-dma.c
virt-dma.h
xgene-dma.c
zx_dma.c