All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>,
	dmaengine@vger.kernel.org, Michal Simek <michal.simek@xilinx.com>,
	Hyun Kwon <hyun.kwon@xilinx.com>,
	Tejas Upadhyay <tejasu@xilinx.com>,
	Satish Kumar Nagireddy <SATISHNA@xilinx.com>
Subject: Re: [PATCH v6 4/6] dmaengine: xilinx: dpdma: Add the Xilinx DisplayPort DMA engine driver
Date: Wed, 15 Jul 2020 12:24:03 +0530	[thread overview]
Message-ID: <20200715065403.GC34333@vkoul-mobl> (raw)
In-Reply-To: <20200711221644.GD5954@pendragon.ideasonboard.com>

On 12-07-20, 01:16, Laurent Pinchart wrote:
> Hi Peter,
> 
> On Thu, Jul 09, 2020 at 04:21:38PM +0300, Peter Ujfalusi wrote:
> > On 08/07/2020 23.19, Laurent Pinchart wrote:
> > > From: Hyun Kwon <hyun.kwon@xilinx.com>
> > > 
> > > The ZynqMP DisplayPort subsystem includes a DMA engine called DPDMA with
> > > 6 DMa channels (4 for display and 2 for audio). This driver exposes the
> > > DPDMA through the dmaengine API, to be used by audio (ALSA) and display
> > > (DRM) drivers for the DisplayPort subsystem.
> > > 
> > > Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com>
> > > Signed-off-by: Tejas Upadhyay <tejasu@xilinx.com>
> > > Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > 
> > ...
> > 
> > > +static void xilinx_dpdma_chan_queue_transfer(struct xilinx_dpdma_chan *chan)
> > > +{
> > > +	struct xilinx_dpdma_device *xdev = chan->xdev;
> > > +	struct xilinx_dpdma_sw_desc *sw_desc;
> > > +	struct xilinx_dpdma_tx_desc *desc;
> > > +	struct virt_dma_desc *vdesc;
> > > +	u32 reg, channels;
> > > +
> > > +	lockdep_assert_held(&chan->lock);
> > > +
> > > +	if (chan->desc.pending)
> > > +		return;
> > > +
> > > +	if (!chan->running) {
> > > +		xilinx_dpdma_chan_unpause(chan);
> > > +		xilinx_dpdma_chan_enable(chan);
> > > +		chan->first_frame = true;
> > > +		chan->running = true;
> > > +	}
> > > +
> > > +	if (chan->video_group)
> > > +		channels = xilinx_dpdma_chan_video_group_ready(chan);
> > > +	else
> > > +		channels = BIT(chan->id);
> > > +
> > > +	if (!channels)
> > > +		return;
> > > +
> > > +	vdesc = vchan_next_desc(&chan->vchan);
> > > +	if (!vdesc)
> > > +		return;
> > > +
> > > +	if (!chan->first_frame && !(vdesc->tx.flags & DMA_PREP_LOAD_EOT)) {
> > > +		/*
> > > +		 * The client forgot to set the DMA_PREP_LOAD_EOT flag. The DMA
> > > +		 * engine API requires the channel to silently ignore the
> > > +		 * descriptor, leaving the client waiting forever for the new
> > > +		 * descriptor to be processed.
> > > +		 */
> > 
> > This hardly going to happen. But if it does, a gentle dev_dbg() might
> > save some time for the user on debugging?

Correct!

Also this is not quite right place for this driver to check this. In
prep_ call this driver should check if the channel is idle and if not
DMA_PREP_LOAD_EOT would be mandatory to be set and return error.

> I think you know my opinion on this already :-) I believe we should have
> designed this API in a way that makes this error impossible, by dropping
> the DMA_PREP_LOAD_EOT flag and considering that the default case. That
> was rejected. Do we now need to work around the problem in drivers ?

Driver can do that easily, API can allow this as some hardware can have
allow this.

Thanks
-- 
~Vinod

  reply	other threads:[~2020-07-15  6:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-08 20:19 [PATCH v6 0/6] dma: Add Xilinx ZynqMP DPDMA driver Laurent Pinchart
2020-07-08 20:19 ` [PATCH v6 1/6] dt: bindings: dma: xilinx: dpdma: DT bindings for Xilinx DPDMA Laurent Pinchart
2020-07-08 20:19 ` [PATCH v6 2/6] dmaengine: virt-dma: Use lockdep to check locking requirements Laurent Pinchart
2020-07-09 13:07   ` Peter Ujfalusi
2020-07-11 19:53     ` Laurent Pinchart
2020-07-08 20:19 ` [PATCH v6 3/6] dmaengine: Add support for repeating transactions Laurent Pinchart
2020-07-09 13:25   ` Peter Ujfalusi
2020-07-08 20:19 ` [PATCH v6 4/6] dmaengine: xilinx: dpdma: Add the Xilinx DisplayPort DMA engine driver Laurent Pinchart
2020-07-09 13:21   ` Peter Ujfalusi
2020-07-11 22:16     ` Laurent Pinchart
2020-07-15  6:54       ` Vinod Koul [this message]
2020-07-15 10:59   ` Vinod Koul
2020-07-16  0:41     ` Laurent Pinchart
2020-07-16  5:21       ` Vinod Koul
2020-07-16 13:46         ` Laurent Pinchart
2020-07-17  5:59           ` Vinod Koul
2020-07-08 20:19 ` [PATCH v6 5/6] dmaengine: xilinx: dpdma: Add debugfs support Laurent Pinchart
2020-07-15 11:01   ` Vinod Koul
2020-07-16  0:42     ` Laurent Pinchart
2020-07-08 20:19 ` [PATCH v6 6/6] arm64: dts: zynqmp: Add DPDMA node 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=20200715065403.GC34333@vkoul-mobl \
    --to=vkoul@kernel.org \
    --cc=SATISHNA@xilinx.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=hyun.kwon@xilinx.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=michal.simek@xilinx.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=tejasu@xilinx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.