From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Vinod Koul <vkoul@kernel.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Viresh Kumar <vireshk@kernel.org>,
dmaengine@vger.kernel.org,
Dan Williams <dan.j.williams@intel.com>
Subject: [v2,2/7] dmaengine: dw: Remove misleading is_private property
Date: Wed, 5 Dec 2018 19:18:05 +0100 [thread overview]
Message-ID: <20181205181805.GA21205@kroah.com> (raw)
On Wed, Dec 05, 2018 at 10:08:50PM +0530, Vinod Koul wrote:
> On 05-12-18, 18:28, Andy Shevchenko wrote:
> > The commit a9ddb575d6d6
> >
> > ("dmaengine: dw_dmac: Enhance device tree support")
> >
> > introduces is_private property in uncertain understanding what does it mean.
> >
> > First of all, documentation defines DMA_PRIVATE capability as
> >
> > Documentation/crypto/async-tx-api.txt:
> > The DMA_PRIVATE capability flag is used to tag dma devices that should not be
> > used by the general-purpose allocator. It can be set at initialization time
> > if it is known that a channel will always be private. Alternatively,
> > it is set when dma_request_channel() finds an unused "public" channel.
> >
> > A couple caveats to note when implementing a driver and consumer:
> > 1/ Once a channel has been privately allocated it will no longer be
> > considered by the general-purpose allocator even after a call to
> > dma_release_channel().
> > 2/ Since capabilities are specified at the device level a dma_device with
> > multiple channels will either have all channels public, or all channels
> > private.
> >
> > Documentation/driver-api/dmaengine/provider.rst:
> > - DMA_PRIVATE
> > The devices only supports slave transfers, and as such isn't available
> > for async transfers.
> >
> > The capability had been introduced by the commit 59b5ec21446b
> >
> > ("dmaengine: introduce dma_request_channel and private channels")
> >
> > and some code didn't changed from that times ever.
> >
> > Taking into consideration above and the fact that on all known platforms
> > Synopsys DesignWare DMA engine is attached to serve slave transfers,
> > the DMA_PRIVATE capability must be enabled for this device unconditionally.
> > Otherwise, as rightfully noticed in drivers/dma/at_xdmac.c:
> > /*
> > * Without DMA_PRIVATE the driver is not able to allocate more than
> > * one channel, second allocation fails in private_candidate.
> > */
> > because of of a caveats mentioned in above documentation excerpts.
> >
> > So, remove conditional around DMA_PRIVATE followed by removal leftovers.
> >
> > If someone wonders, DMA_PRIVATE can be not used if and only if the all channels
> > of the DMA controller are supposed to serve memory-to-memory like operations.
> > For example, EP93xx has two controllers, one of which can only perform
> > memory-to-memory transfers
> >
> > Note, this change doesn't affect dmatest to be able to test such controllers.
> >
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (maintainer:SERIAL DRIVERS)
> > Cc: Dan Williams <dan.j.williams@intel.com>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> > Documentation/devicetree/bindings/dma/snps-dma.txt | 2 --
> > drivers/dma/dw/core.c | 4 +---
> > drivers/dma/dw/pci.c | 1 -
> > drivers/dma/dw/platform.c | 3 ---
> > drivers/tty/serial/8250/8250_lpss.c | 1 -
>
> Need ack from greg before applying this
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
next reply other threads:[~2018-12-05 18:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-05 18:18 Greg Kroah-Hartman [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-12-05 16:38 [v2,2/7] dmaengine: dw: Remove misleading is_private property Vinod Koul
2018-12-05 16:28 Andy Shevchenko
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=20181205181805.GA21205@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=vireshk@kernel.org \
--cc=vkoul@kernel.org \
/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).