hw/dma/xilinx_axidma: Check DMASR.HALTED to prevent infinite loop.
commit31afe04586efeccb80cc36ffafcd0e32a3245ffb
authorTommy Wu <tommy.wu@sifive.com>
Thu, 25 May 2023 09:37:51 +0000 (25 10:37 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 30 May 2023 14:50:16 +0000 (30 15:50 +0100)
tree94b4399f6016f60c293f988526ab8f265b676f33
parent8cefcc3b7127f1c497aa832378fe69453fb9db2c
hw/dma/xilinx_axidma: Check DMASR.HALTED to prevent infinite loop.

When we receive a packet from the xilinx_axienet and then try to s2mem
through the xilinx_axidma, if the descriptor ring buffer is full in the
xilinx axidma driver, we’ll assert the DMASR.HALTED in the
function : stream_process_s2mem and return 0. In the end, we’ll be stuck in
an infinite loop in axienet_eth_rx_notify.

This patch checks the DMASR.HALTED state when we try to push data
from xilinx axi-enet to xilinx axi-dma. When the DMASR.HALTED is asserted,
we will not keep pushing the data and then prevent the infinte loop.

Signed-off-by: Tommy Wu <tommy.wu@sifive.com>
Reviewed-by: Edgar E. Iglesias <edgar@zeroasic.com>
Reviewed-by: Frank Chang <frank.chang@sifive.com>
Message-id: 20230519062137.1251741-1-tommy.wu@sifive.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/dma/xilinx_axidma.c