dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Radhey Shyam Pandey <radheys@xilinx.com>
To: Sebastian von Ohr <vonohr@smaract.com>,
	"vkoul@kernel.org" <vkoul@kernel.org>,
	Appana Durga Kedareswara Rao <appanad@xilinx.com>,
	Michal Simek <michals@xilinx.com>
Cc: "dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
	Anirudha Sarangi <anirudh@xilinx.com>
Subject: RE: [PATCH] dmaengine: xilinx_dma: Add missing check for empty list
Date: Thu, 9 Apr 2020 07:40:26 +0000	[thread overview]
Message-ID: <BYAPR02MB56385DD6F0CDCE77FB5B6D68C7C10@BYAPR02MB5638.namprd02.prod.outlook.com> (raw)
In-Reply-To: <20200408151926.11709-1-vonohr@smaract.com>

> -----Original Message-----
> From: Sebastian von Ohr <vonohr@smaract.com>
> Sent: Wednesday, April 8, 2020 8:49 PM
> To: Radhey Shyam Pandey <radheys@xilinx.com>; vkoul@kernel.org;
> Appana Durga Kedareswara Rao <appanad@xilinx.com>; Michal Simek
> <michals@xilinx.com>
> Cc: dmaengine@vger.kernel.org
> Subject: RE: [PATCH] dmaengine: xilinx_dma: Add missing check for empty
> list
> 
> I've attached a patch below. When using this patch with the xilinx-
> v2019.2.01
> tag I get a kernel panic immediately when loading the module. Maybe the
> exact
> components on the FPGA are also important. I have one AXI DMA
> component with
> scatter/gather enabled, read/write widths set to 64bit and a max burst size
> of 16.
> 
> 
> diff --git a/drivers/dma/xilinx/axidmatest.c
> b/drivers/dma/xilinx/axidmatest.c
> index 3d88982c9f7e..757bab152e0a 100644
> --- a/drivers/dma/xilinx/axidmatest.c
> +++ b/drivers/dma/xilinx/axidmatest.c
> @@ -407,6 +407,7 @@ static int dmatest_slave_func(void *data)
>  		dma_async_issue_pending(tx_chan);
>  		dma_async_issue_pending(rx_chan);
> 
> +		dma_sync_wait(tx_chan, tx_cookie);
>  		tx_tmo = wait_for_completion_timeout(&tx_cmp, tx_tmo);
> 
>  		status = dma_async_is_tx_complete(tx_chan, tx_cookie,
> @@ -428,6 +429,7 @@ static int dmatest_slave_func(void *data)
>  			continue;
>  		}
> 
> +		dma_sync_wait(rx_chan, rx_cookie);
>  		rx_tmo = wait_for_completion_timeout(&rx_cmp, rx_tmo);
>  		status = dma_async_is_tx_complete(rx_chan, rx_cookie,
>  							NULL, NULL);

Still, the issue is not reproduced, but as you also mentioned it might depend 
on design, exact timing on events, etc.  The patch checks active list empty state
before accessing it so that looks correct. In my test,  it doesn't break any of 
the existing functionality so adding a tested-by tag. 

Tested-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>




  reply	other threads:[~2020-04-09  7:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-03 13:05 [PATCH] dmaengine: xilinx_dma: Add missing check for empty list Sebastian von Ohr
2020-03-06 13:34 ` Vinod Koul
2020-03-06 13:57   ` Radhey Shyam Pandey
2020-03-11  9:16     ` Vinod Koul
2020-04-07  7:52     ` Sebastian von Ohr
2020-04-07 16:03       ` Radhey Shyam Pandey
2020-04-08  7:12         ` Sebastian von Ohr
2020-04-08 14:06           ` Radhey Shyam Pandey
2020-04-08 15:19             ` Sebastian von Ohr
2020-04-09  7:40               ` Radhey Shyam Pandey [this message]
2020-04-15 16:12 ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BYAPR02MB56385DD6F0CDCE77FB5B6D68C7C10@BYAPR02MB5638.namprd02.prod.outlook.com \
    --to=radheys@xilinx.com \
    --cc=anirudh@xilinx.com \
    --cc=appanad@xilinx.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=michals@xilinx.com \
    --cc=vkoul@kernel.org \
    --cc=vonohr@smaract.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).