From: Nicholas Graumann Date: Tue, 15 Oct 2019 14:48:23 +0000 (+0530) Subject: dmaengine: xilinx_dma: Print debug message when no free tx segments X-Git-Tag: v5.5-rc1~78^2~32 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=722b9e6d7e49b1dc429f9b65680b325c1ce9a763;p=users%2Fjedix%2Flinux-maple.git dmaengine: xilinx_dma: Print debug message when no free tx segments The driver should not run out of tx segments in normal operation. But, if the user attempts to prepare a transaction with a large sg list, the driver may not have enough free segments to accommodate the request. Log a message at the debug level to inform the user in case they are experiencing issues. Signed-off-by: Nicholas Graumann Signed-off-by: Radhey Shyam Pandey Link: https://lore.kernel.org/r/1571150904-3988-7-git-send-email-radhey.shyam.pandey@xilinx.com Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c index d81f387cfcc7..93471a6199ce 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -612,6 +612,9 @@ xilinx_axidma_alloc_tx_segment(struct xilinx_dma_chan *chan) } spin_unlock_irqrestore(&chan->lock, flags); + if (!segment) + dev_dbg(chan->dev, "Could not find free tx segment\n"); + return segment; }