dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eugeniu Rosca <roscaeugeniu@gmail.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Vinod Koul <vkoul@kernel.org>,
	Dan Williams <dan.j.williams@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	linux-serial@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	dmaengine@vger.kernel.org, Eugeniu Rosca <erosca@de.adit-jv.com>,
	Eugeniu Rosca <roscaeugeniu@gmail.com>
Subject: Re: [PATCH] dmaengine: rcar-dmac: Reject zero-length slave DMA requests
Date: Wed, 26 Jun 2019 20:14:59 +0200	[thread overview]
Message-ID: <20190626181459.GA31913@x230> (raw)
In-Reply-To: <20190624123818.20919-1-geert+renesas@glider.be>

Hi All,

On Mon, Jun 24, 2019 at 02:38:18PM +0200, Geert Uytterhoeven wrote:
[..]
> -	if (rchan->mid_rid < 0 || !sg_len) {
> +	if (rchan->mid_rid < 0 || !sg_len || !sg_dma_len(sgl)) {
>  		dev_warn(chan->device->dev,
>  			 "%s: bad parameter: len=%d, id=%d\n",
>  			 __func__, sg_len, rchan->mid_rid);

Just wanted to share the WARN output proposed by Wolfram in
https://patchwork.kernel.org/patch/11012991/#22721733
in case the issue discussed in [1] is reproduced with this patch:

[    2.065337] ------------[ cut here ]------------
[    2.065346] rcar_dmac_prep_slave_sg: <here-comes-the-warning-message>
[    2.065394] WARNING: CPU: 2 PID: 252 at drivers/dma/sh/rcar-dmac.c:1169 rcar_dmac_prep_slave_sg+0x50/0xc4
[    2.065397] Modules linked in:
[    2.065407] CPU: 2 PID: 252 Comm: kworker/2:1 Not tainted 5.2.0-rc6-00016-g2bfb85ba1481-dirty #26
[    2.065410] Hardware name: Renesas H3ULCB Kingfisher board based on r8a7795 ES2.0+ (DT)
[    2.065420] Workqueue: events sci_dma_tx_work_fn
[    2.065425] pstate: 40000005 (nZcv daif -PAN -UAO)
[    2.065430] pc : rcar_dmac_prep_slave_sg+0x50/0xc4
[    2.065434] lr : rcar_dmac_prep_slave_sg+0x50/0xc4
[    2.065436] sp : ffff0000112ebd00
[    2.065438] x29: ffff0000112ebd00 x28: 0000000000000000 
[    2.065443] x27: ffff8006fa367138 x26: ffff000010c5bce8 
[    2.065447] x25: 0000000738b1d000 x24: 0000000000000000 
[    2.065451] x23: ffff000010b76e00 x22: ffff000010a18000 
[    2.065455] x21: 0000000000000001 x20: ffff8006f9b5a080 
[    2.065459] x19: ffff0000107adc86 x18: 0000000000000000 
[    2.065462] x17: 0000000000000000 x16: 0000000000000000 
[    2.065466] x15: 0000000000000000 x14: 0000000000000000 
[    2.065469] x13: 0000000000040000 x12: ffff000010a35000 
[    2.065473] x11: ffff000010b12981 x10: 0000000000000040 
[    2.065477] x9 : 000000000000013e x8 : ffff000010b1b73b 
[    2.065481] x7 : 0000000000000000 x6 : 0000000000000001 
[    2.065484] x5 : ffff8006ff72f7c0 x4 : 0000000000000001 
[    2.065488] x3 : 0000000000000007 x2 : 0000000000000007 
[    2.065491] x1 : 878c73041cedc400 x0 : 0000000000000000 
[    2.065495] Call trace:
[    2.065500]  rcar_dmac_prep_slave_sg+0x50/0xc4
[    2.065504]  sci_dma_tx_work_fn+0xd8/0x1d4
[    2.065511]  process_one_work+0x1dc/0x394
[    2.065515]  worker_thread+0x21c/0x308
[    2.065520]  kthread+0x118/0x128
[    2.065527]  ret_from_fork+0x10/0x18
[    2.065530] ---[ end trace 75fc17d9000f1224 ]---

At first glance, it seems to give more details compared to:
rcar-dmac e7300000.dma-controller: rcar_dmac_prep_slave_sg: bad parameter: len=1, id=19

[1] https://patchwork.kernel.org/cover/11012981/

-- 
Best regards,
Eugeniu.

  parent reply	other threads:[~2019-06-26 18:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24 12:38 [PATCH] dmaengine: rcar-dmac: Reject zero-length slave DMA requests Geert Uytterhoeven
2019-06-24 12:49 ` Wolfram Sang
2019-06-25  4:38 ` Vinod Koul
2019-06-25  4:40 ` Vinod Koul
2019-06-26 18:14 ` Eugeniu Rosca [this message]
2019-06-28 12:10   ` Geert Uytterhoeven
2019-06-28 12:57     ` Wolfram Sang
2019-07-03 15:34     ` Eugeniu Rosca

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=20190626181459.GA31913@x230 \
    --to=roscaeugeniu@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=erosca@de.adit-jv.com \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=vkoul@kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=yoshihiro.shimoda.uh@renesas.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).