From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Vinod Koul <vkoul@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
Andy Gross <agross@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Baolin Wang <baolin.wang7@gmail.com>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Chunyan Zhang <zhang.lyra@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Hyun Kwon <hyun.kwon@xilinx.com>,
Jaroslav Kysela <perex@perex.cz>,
Jon Hunter <jonathanh@nvidia.com>,
Lars-Peter Clausen <lars@metafoo.de>,
Laxman Dewangan <ldewangan@nvidia.com>,
Manivannan Sadhasivam <mani@kernel.org>,
Mark Brown <broonie@kernel.org>,
Michal Simek <michal.simek@xilinx.com>,
Nicolas Saenz Julienne <nsaenz@kernel.org>,
Orson Zhai <orsonzhai@gmail.com>,
Robert Jarzmik <robert.jarzmik@free.fr>,
Scott Branden <sbranden@broadcom.com>,
Takashi Iwai <tiwai@suse.com>,
Thierry Reding <thierry.reding@gmail.com>,
ALSA Development Mailing List <alsa-devel@alsa-project.org>,
bcm-kernel-feedback-list <bcm-kernel-feedback-list@broadcom.com>,
dmaengine@vger.kernel.org,
dri-devel <dri-devel@lists.freedesktop.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
linux-arm-msm <linux-arm-msm@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-mmc <linux-mmc@vger.kernel.org>,
linux-mtd <linux-mtd@lists.infradead.org>,
"moderated list:BROADCOM BCM2835 ARM ARCHITECTURE"
<linux-rpi-kernel@lists.infradead.org>,
"open list:SERIAL DRIVERS" <linux-serial@vger.kernel.org>,
linux-spi <linux-spi@vger.kernel.org>,
linux-staging@lists.linux.dev,
"open list:TEGRA ARCHITECTURE SUPPORT"
<linux-tegra@vger.kernel.org>
Subject: Re: [PATCH 08/11] dmaengine: xilinx_dpdma: stop using slave_id field
Date: Mon, 15 Nov 2021 15:05:50 +0200 [thread overview]
Message-ID: <YZJbLol1llm+puDT@pendragon.ideasonboard.com> (raw)
In-Reply-To: <CAK8P3a27rPBVbU-PrYR0BE4KV2DyJk7FoXaeDS=FU1=_RSwoQQ@mail.gmail.com>
Hi Arnd,
On Mon, Nov 15, 2021 at 01:38:07PM +0100, Arnd Bergmann wrote:
> On Mon, Nov 15, 2021 at 12:49 PM Laurent Pinchart wrote:
> > On Mon, Nov 15, 2021 at 11:21:30AM +0100, Arnd Bergmann wrote:
> > > On Mon, Nov 15, 2021 at 10:14 AM Laurent Pinchart wrote:
> > > > On Mon, Nov 15, 2021 at 09:54:00AM +0100, Arnd Bergmann wrote:
> > > > > @@ -1285,11 +1287,13 @@ static int xilinx_dpdma_config(struct dma_chan *dchan,
> > > > > spin_lock_irqsave(&chan->lock, flags);
> > > > >
> > > > > /*
> > > > > - * Abuse the slave_id to indicate that the channel is part of a video
> > > > > - * group.
> > > > > + * Abuse the peripheral_config to indicate that the channel is part
> > > >
> > > > Is it still an abuse, or is this now the right way to pass custom data
> > > > to the DMA engine driver ?
> > >
> > > It doesn't make the driver any more portable, but it's now being
> > > more explicit about it. As far as I can tell, this is the best way
> > > to pass data that cannot be expressed through the regular interfaces
> > > in DT and the dmaengine API.
> > >
> > > Ideally there would be a generic way to pass this flag, but I couldn't
> > > figure out what this is actually doing, or whether there is a better
> > > way. Maybe Vinod has an idea.
> >
> > I don't think we need a generic API in this case. The DMA engine is
> > specific to the display device, I don't foresee a need to mix-n-match.
>
> Right. I wonder if there is even a point in using the dmaengine API
> in that case, I think for other single-purpose drivers we tend to just
> integrate the functionality in the client driver. No point changing this
> now of course, but it does feel odd.
I agree, and that's what I would have done as well, if it wasn't for the
fact that the DMA engine also supports a second client for audio. This
isn't supported in upstream yet. We could still have created an ad-hoc
solution, possibly based on the components framework, but the DMA engine
subsystem wasn't a bad fit.
> From my earlier reading of the driver, my impression was that this
> is just a memory-to-memory device, so it could be used that way
> as well, but does need a flag when working on the video memory.
> I couldn't quite make sense of that though.
It's only memory-to-device (video and audio). See figures 33-1 and 33-16
in https://www.xilinx.com/support/documentation/user_guides/ug1085-zynq-ultrascale-trm.pdf
> > > /*
> > > * Use the peripheral_config to indicate that the channel is part
> > > * of a video group. This requires matching use of the custom
> > > * structure in each driver.
> > > */
> > > pconfig = config->peripheral_config;
> > > if (WARN_ON(config->peripheral_size != 0 &&
> > > config->peripheral_size != sizeof(*pconfig)))
> > > return -EINVAL;
> >
> > How about
> >
> > if (WARN_ON(config->peripheral_config &&
> > config->peripheral_size != sizeof(*pconfig)))
> >
> > >
> > > spin_lock_irqsave(&chan->lock, flags);
> > > if (chan->id <= ZYNQMP_DPDMA_VIDEO2 &&
> > > config->peripheral_size == sizeof(*pconfig))
> >
> > And here you can test pconfig != NULL.
>
> Good idea. Changed now, using 'if (pconfig)' without the '!= NULL'
> in both expressions.
Sounds good to me.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2021-11-15 13:06 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-15 8:53 [PATCH 00/11] dmaengine: kill off dma_slave_config->slave_id Arnd Bergmann
2021-11-15 8:53 ` [PATCH 01/11] ASoC: dai_dma: remove slave_id field Arnd Bergmann
2021-11-15 10:14 ` Lars-Peter Clausen
2021-11-15 10:42 ` Arnd Bergmann
2021-11-15 11:53 ` Lars-Peter Clausen
2021-11-15 14:46 ` Dmitry Osipenko
2021-11-15 15:15 ` Arnd Bergmann
2021-11-15 8:53 ` [PATCH 02/11] spi: pic32: stop setting dma_config->slave_id Arnd Bergmann
2021-11-15 13:29 ` Mark Brown
2021-11-15 8:53 ` [PATCH 03/11] mmc: bcm2835: stop setting chan_config->slave_id Arnd Bergmann
2021-11-15 9:55 ` nicolas saenz julienne
2021-11-15 13:09 ` Ulf Hansson
2021-11-15 8:53 ` [PATCH 04/11] dmaengine: shdma: remove legacy slave_id parsing Arnd Bergmann
2021-11-15 9:09 ` Laurent Pinchart
2021-11-15 8:53 ` [PATCH 05/11] dmaengine: pxa/mmp: stop referencing config->slave_id Arnd Bergmann
2021-11-15 8:53 ` [PATCH 06/11] dmaengine: sprd: " Arnd Bergmann
2021-11-16 2:34 ` Baolin Wang
2021-11-15 8:53 ` [PATCH 07/11] dmaengine: qcom-adm: stop abusing slave_id config Arnd Bergmann
2021-11-19 12:42 ` kernel test robot
2021-11-25 7:57 ` kernel test robot
2021-11-25 8:25 ` Arnd Bergmann
2021-11-25 9:32 ` Vinod Koul
2021-11-15 8:54 ` [PATCH 08/11] dmaengine: xilinx_dpdma: stop using slave_id field Arnd Bergmann
2021-11-15 9:14 ` Laurent Pinchart
2021-11-15 10:21 ` Arnd Bergmann
2021-11-15 11:49 ` Laurent Pinchart
2021-11-15 12:38 ` Arnd Bergmann
2021-11-15 13:05 ` Laurent Pinchart [this message]
2021-11-15 13:39 ` Arnd Bergmann
2021-11-16 4:28 ` Vinod Koul
2021-11-15 8:54 ` [PATCH 09/11] dmaengine: tegra20-apb: stop checking config->slave_id Arnd Bergmann
2021-11-15 8:54 ` [PATCH 10/11] staging: ralink-gdma: stop using slave_id config Arnd Bergmann
2021-11-15 9:55 ` Sergio Paracuellos
2021-11-15 10:23 ` Arnd Bergmann
2021-11-15 8:54 ` [PATCH 11/11] dmaengine: remove slave_id config field Arnd Bergmann
2021-11-15 9:18 ` 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=YZJbLol1llm+puDT@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=agross@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=baolin.wang7@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bjorn.andersson@linaro.org \
--cc=broonie@kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=hyun.kwon@xilinx.com \
--cc=jonathanh@nvidia.com \
--cc=lars@metafoo.de \
--cc=ldewangan@nvidia.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linux-tegra@vger.kernel.org \
--cc=mani@kernel.org \
--cc=michal.simek@xilinx.com \
--cc=nsaenz@kernel.org \
--cc=orsonzhai@gmail.com \
--cc=perex@perex.cz \
--cc=robert.jarzmik@free.fr \
--cc=sbranden@broadcom.com \
--cc=thierry.reding@gmail.com \
--cc=tiwai@suse.com \
--cc=vkoul@kernel.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).