Re: [PATCH] dmaengine: dmatest: Add support for completion polling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10-06-19, 14:12, Peter Ujfalusi wrote:
> 
> 
> On 10/06/2019 10.04, Vinod Koul wrote:
> >>> I think we should view DMA_PREP_INTERRUPT from client pov, but
> >>> controller cannot get away with disabling interrupts IMO.
> >>
> >> What happens if client is issuing a DMA memcpy (short one) while
> >> interrupts are disabled?
> >>
> >> The user for this is:
> >> drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
> >>
> >> commit: f5b9930b85dc6319fd6bcc259e447eff62fc691c
> >>
> >> The interrupt based completion is not going to work in some cases, the
> >> DMA driver should obey that the missing DMA_PREP_INTERRUPT really
> >> implies that interrupts can not be used.
> > 
> > well yes but how do we *assume* completion and issue subsequent txns?
> > Does driver create a task and poll?
> 
> The client driver will poll on tx_status, like using dma_sync_wait().
> The DMA driver is expected to check if the transfer is completed by
> other means than relying on the interrupt for transfer completion.
> 
> >>
> >>> Assuming I had enough caffeine before I thought process, then client would
> >>> poll descriptor status using cookie and should free up once the cookie
> >>> is freed, makes sense?
> >>
> >> OK, so clients are expected to call dmaengine_terminate_*
> >> unconditionally after the transfer is completed, right?
> > 
> > How do you know/detect transfer is completed?
> 
> This is a bit tricky and depends on the DMA hardware.
> For sDMA (omap-dma) we already do this by checking the channel status.
> The channel will be switched to idle if the transfer is completed.

Well we are talking about DMA and doing this kind of things doesn't make
sense to me. Why not do memcpy/pio instead. DMA is designed to finish
txn fast and move to next one, if we cannot do that, I would say lets
not use dmaengine in those cases! Keeping dmaengine idle is not really
good design.

> EDMA on the other hand does not provide straight forward way to check if
> the transfer is completed w/o interrupts, however we can see it if the
> CC loaded the closing dummy paRAM slot (address is 0).
> 
> If I want to enable this for UDMAP then I would check the return ring if
> I got back the descriptor or not.
> 
> >> If we use interrupts then the handler would anyway free up the
> >> descriptor, so terminating should not do any harm, if we can not have
> >> interrupts then terminate will clear up the completed descriptor
> >> proactively.
> > 
> > yes terminate part is fine.
> 
> OK, so I don't need to change this patch for dmatest, right?
> 
> I'll prepare the EDMA patch and an update for omap-dma as well.
> 
> >> In any case I have updated the EDMA patch to do the same thing in case
> >> of polling w/o interrupts as it would do in the completion irq handler,
> >> and similar approach prepared for omap-dma as well.
> >>
> >> - Péter
> >>
> >> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> >> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
> > 
> 
> - Péter
> 
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

-- 
~Vinod



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux