dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Eugeniu Rosca <roscaeugeniu@gmail.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	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>,
	"open list:SERIAL DRIVERS" <linux-serial@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	dmaengine@vger.kernel.org, Eugeniu Rosca <erosca@de.adit-jv.com>
Subject: Re: [PATCH] dmaengine: rcar-dmac: Reject zero-length slave DMA requests
Date: Fri, 28 Jun 2019 14:10:01 +0200	[thread overview]
Message-ID: <CAMuHMdUpPEdz3aDXo90XQ7b-jP2ErxwqLKgmEFUhhuB-oBzrDA@mail.gmail.com> (raw)
In-Reply-To: <20190626181459.GA31913@x230>

Hi Eugeniu,

On Wed, Jun 26, 2019 at 8:15 PM Eugeniu Rosca <roscaeugeniu@gmail.com> wrote:
> 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:

I'm not such a big fan of WARN()...

> [    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

Which would be followed by

    sh-sci e6e88000.serial: Failed preparing Tx DMA descriptor

pointing to the sh-sci driver, right?

The id=19 points to channel 0x13, i.e. SCIF2, according to
arch/arm64/boot/dts/renesas/r8a7795.dtsi.

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

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2019-06-28 12:10 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
2019-06-28 12:10   ` Geert Uytterhoeven [this message]
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=CAMuHMdUpPEdz3aDXo90XQ7b-jP2ErxwqLKgmEFUhhuB-oBzrDA@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --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=roscaeugeniu@gmail.com \
    --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).