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@xxxxxxxxxx> > > > > > > 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@xxxxxxxxxx> > > > Signed-off-by: Tejas Upadhyay <tejasu@xxxxxxxxxx> > > > Signed-off-by: Michal Simek <michal.simek@xxxxxxxxxx> > > > Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx> > > > > ... > > > > > +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