linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chunyan Zhang <zhang.chunyan@linaro.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-mmc@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Mark Brown <broonie@kernel.org>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Sekhar Nori <nsekhar@ti.com>, Lyra Zhang <zhang.lyra@gmail.com>
Subject: Re: [PATCH RFC 1/3] mmc: sdhci: add support for using external DMA devices
Date: Wed, 7 Nov 2018 10:56:16 +0800	[thread overview]
Message-ID: <CAG2=9p8ELyjbOx1Ez2LExpYA4bDh_2RcD68e0EV0DHpaPwjXPg@mail.gmail.com> (raw)
In-Reply-To: <CAK8P3a2aUjLsP70zSjkavR4-mkV9iEVCw96Vces4N15Dno8SHw@mail.gmail.com>

On Tue, 6 Nov 2018 at 19:16, Arnd Bergmann <arnd@arndb.de> wrote:
>
> On 11/5/18, Chunyan Zhang <zhang.chunyan@linaro.org> wrote:
> > Some standard SD host controller can support both external dma
> > controllers as well as ADMA in which the controller acts as
> > DMA master.
> >
> > Currently the generic SDHCI code supports ADMA/SDMA integrated into
> > the host controller but does not have any support for external DMA
> > controllers implemented using dmaengine meaning that custom code is
> > needed for any systems that use a generic DMA controller with SDHCI.
> >
> > Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
>
> Looks good to me overall, but I think I found one small bug:
>
>
> > +     dma->rx_chan = dma_request_chan(mmc->parent, "rx");
> > +     if (IS_ERR(dma->rx_chan)) {
> > +             ret = PTR_ERR(dma->rx_chan);
> > +             if (ret == -EPROBE_DEFER && dma->tx_chan)
> > +                     dma_release_channel(dma->tx_chan);
> > +
> > +             dma->rx_chan = NULL;
> > +             pr_warn("Failed to request RX DMA channel.\n");
> > +     }
>
> The error handling looks wrong here: if you get EPROBE_DEFER,
> you want to skip the warning message. If you get any other error code,

Right, will address.

> you want the warning message and also the dma_release_channel()
> which should be unconditional here.

Will address.

Thanks for the review,
Chunyan

>
>         Arnd

  reply	other threads:[~2018-11-07  2:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-05  3:16 [PATCH RFC 0/3] Add support for using external dma in SDHCI Chunyan Zhang
2018-11-05  3:16 ` [PATCH RFC 1/3] mmc: sdhci: add support for using external DMA devices Chunyan Zhang
2018-11-06 11:16   ` Arnd Bergmann
2018-11-07  2:56     ` Chunyan Zhang [this message]
2018-11-07 14:13   ` Adrian Hunter
2018-11-05  3:16 ` [PATCH RFC 2/3] mmc: sdhci-omap: Add using external dma Chunyan Zhang
2018-11-05  4:25   ` Kishon Vijay Abraham I
2018-11-06 12:51     ` Arnd Bergmann
2018-11-07  3:00       ` Chunyan Zhang
2018-11-09  5:27       ` Kishon Vijay Abraham I
2018-11-19 16:32         ` Ulf Hansson
2018-11-05  3:16 ` [PATCH RFC 3/3] dt-bindings: sdhci-omap: Add example for using dmaengine Chunyan Zhang

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='CAG2=9p8ELyjbOx1Ez2LExpYA4bDh_2RcD68e0EV0DHpaPwjXPg@mail.gmail.com' \
    --to=zhang.chunyan@linaro.org \
    --cc=adrian.hunter@intel.com \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=ulf.hansson@linaro.org \
    --cc=zhang.lyra@gmail.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).