From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Nicholas Mc Guire <der.herr@hofr.at>
Cc: Arnd Bergmann <arnd@arndb.de>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
Wolfram Sang <wsa@the-dreams.de>,
Vinod Koul <vinod.koul@intel.com>,
linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
Nicholas Mc Guire <hofrat@osadl.org>,
Brian Norris <computersforpeace@gmail.com>,
David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH 2/4] mtd: sh_flctl: drop unused variable
Date: Mon, 04 May 2015 10:53:28 +0300 [thread overview]
Message-ID: <3139913.OhcnyJWC3N@avalon> (raw)
In-Reply-To: <20150504060346.GB26350@opentech.at>
Hi Nicholas,
On Monday 04 May 2015 08:03:46 Nicholas Mc Guire wrote:
> On Mon, 04 May 2015, Vinod Koul wrote:
> > On Sun, May 03, 2015 at 10:33:43PM +0300, Laurent Pinchart wrote:
> > > On Saturday 02 May 2015 09:57:08 Nicholas Mc Guire wrote:
> > > > shdma_tx_submit() called via dmaengine_submit() returns the assigned
> > > > cookie but this is not used here so the variable and assignment can
> > > > be dropped.
> > > >
> > > > Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> > >
> > > I would rephrase the commit message to avoid mentioning
> > > shdma_tx_submit() as that's not relevant. Something like
> > > "dmaengine_submit() returns the assigned cookie but this is not used
> > > here so the variable and assignment can be dropped."
> >
> > And I am bit surrised about taht. Ideally the driver should use the cookie
> > to check the status later on...
>
> looking at other drivers it seems like the drivers should call
> dma_submit_error(cookie); on the received cookie - which does:
> return cookie < 0 ? cookie : 0;
> but doing that after dmaengine_submit() which actually already queued the
> this request in shdma_base.cc:shdma_tx_submit()
Don't take shdma into account. There's no guarantee that the DMA engine will
be an SH DMAC on all platforms where the flctl driver will be used.
Furthermore, the shdma implementation might change in the future. You should
consider the DMA engine API only and comply with its requirements.
> might not be that helpful
> and looking at dma_cookie_assign() I do not see how the condition that
> dma_submit_error is checking for ever could occur as it can't go below
> cookie = DMA_MIN_COOKIE which is defined to 1 (include/linux/dmaengine.h)
>
> As other drivers seem to not be doing more with the returned cookie than
> calling dma_submit_error() on it this seems ok here ...but I'm not that
> deep into this - my starting point was a simple API inconsisteny in the
> use of wait_for_completion_timeout() :)
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2015-05-04 7:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-02 7:57 [PATCH 1/4] mtd: sh_flctl: let flctl_dma_fifo0_transfer return 0 on success Nicholas Mc Guire
2015-05-02 7:57 ` [PATCH 2/4] mtd: sh_flctl: drop unused variable Nicholas Mc Guire
2015-05-03 19:33 ` Laurent Pinchart
2015-05-04 5:17 ` Vinod Koul
2015-05-04 6:03 ` Nicholas Mc Guire
2015-05-04 7:53 ` Laurent Pinchart [this message]
2015-05-10 13:49 ` Nicholas Mc Guire
2015-05-02 7:57 ` [PATCH 3/4] mtd: sh_flctl: fix function parameter alignment Nicholas Mc Guire
2015-05-02 7:57 ` [PATCH 4/4] mtd: sh_flctl: fix wrapped condition alignment Nicholas Mc Guire
2015-05-04 5:21 ` Vinod Koul
2015-05-04 5:43 ` Nicholas Mc Guire
2015-05-04 7:05 ` Joe Perches
2015-05-03 19:35 ` [PATCH 1/4] mtd: sh_flctl: let flctl_dma_fifo0_transfer return 0 on success Laurent Pinchart
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=3139913.OhcnyJWC3N@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=arnd@arndb.de \
--cc=computersforpeace@gmail.com \
--cc=der.herr@hofr.at \
--cc=dwmw2@infradead.org \
--cc=hofrat@osadl.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=vinod.koul@intel.com \
--cc=wsa@the-dreams.de \
/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