mbox series

[v5,0/3] dmaengine: ti: edma: Polled completion support

Message ID 20190716082655.1620-1-peter.ujfalusi@ti.com (mailing list archive)
Headers show
Series dmaengine: ti: edma: Polled completion support | expand

Message

Peter Ujfalusi July 16, 2019, 8:26 a.m. UTC
Hi,

Changes since v4:
- Split the DMA_COMPLETE and !txstate check as Vinod suggested

Change since v3:
- fix DMA pointer tracking for memcpy
- completion polling is only done when it is asked by not providing
  DMA_PREP_INTERRUPT for memcpy

Changes since v2:
- Fix typo in the comment for patch 0

Changes since v1:
- Cleanup patch for the array register handling
- typo fixed in patch2 commit message

The code around the array register access was pretty confusing for the first
look, so clean them up first then use the cleaner way in the polled handling.

When a DMA client driver does not set the DMA_PREP_INTERRUPT because it
does not want to use interrupts for DMA completion or because it can not
rely on DMA interrupts due to executing the memcpy when interrupts are
disabled it will poll the status of the transfer.

Since we can not tell from any EDMA register that the transfer is
completed, we can only know that the paRAM set has been sent to TPTC for
processing we need to check the residue of the transfer, if it is 0 then
the transfer is completed.

The polled completion can bve tested by applying:
https://patchwork.kernel.org/patch/10966499/

Enabling the memcpy for EDMA and run the dmatest with polled = 1.

Or, enable the EDMA memcpy support and boot up any dra7 family device with
display enabled. The workaround for DMM errata i878 uses polled DMA memcpy.

Regards,
Peter
---
Peter Ujfalusi (3):
  dmaengine: ti: edma: Clean up the 2x32bit array register accesses
  dmaengine: ti: edma: Correct the residue calculation (fix for memcpy)
  dmaengine: ti: edma: Support for polled (memcpy) completion

 drivers/dma/ti/edma.c | 174 ++++++++++++++++++++++++++++--------------
 1 file changed, 117 insertions(+), 57 deletions(-)

Comments

Vinod Koul July 29, 2019, 6:42 a.m. UTC | #1
On 16-07-19, 11:26, Peter Ujfalusi wrote:
> Hi,
> 
> Changes since v4:
> - Split the DMA_COMPLETE and !txstate check as Vinod suggested
> 
> Change since v3:
> - fix DMA pointer tracking for memcpy
> - completion polling is only done when it is asked by not providing
>   DMA_PREP_INTERRUPT for memcpy
> 
> Changes since v2:
> - Fix typo in the comment for patch 0
> 
> Changes since v1:
> - Cleanup patch for the array register handling
> - typo fixed in patch2 commit message
> 
> The code around the array register access was pretty confusing for the first
> look, so clean them up first then use the cleaner way in the polled handling.
> 
> When a DMA client driver does not set the DMA_PREP_INTERRUPT because it
> does not want to use interrupts for DMA completion or because it can not
> rely on DMA interrupts due to executing the memcpy when interrupts are
> disabled it will poll the status of the transfer.
> 
> Since we can not tell from any EDMA register that the transfer is
> completed, we can only know that the paRAM set has been sent to TPTC for
> processing we need to check the residue of the transfer, if it is 0 then
> the transfer is completed.
> 
> The polled completion can bve tested by applying:
> https://patchwork.kernel.org/patch/10966499/
> 
> Enabling the memcpy for EDMA and run the dmatest with polled = 1.
> 
> Or, enable the EDMA memcpy support and boot up any dra7 family device with
> display enabled. The workaround for DMM errata i878 uses polled DMA memcpy.

Applied, thanks. Fixed typo in 2nd patch while at it
Peter Ujfalusi July 29, 2019, 7:22 a.m. UTC | #2
Vinod,

On 29/07/2019 9.42, Vinod Koul wrote:
> On 16-07-19, 11:26, Peter Ujfalusi wrote:
>> Hi,
>>
>> Changes since v4:
>> - Split the DMA_COMPLETE and !txstate check as Vinod suggested
>>
>> Change since v3:
>> - fix DMA pointer tracking for memcpy
>> - completion polling is only done when it is asked by not providing
>>   DMA_PREP_INTERRUPT for memcpy
>>
>> Changes since v2:
>> - Fix typo in the comment for patch 0
>>
>> Changes since v1:
>> - Cleanup patch for the array register handling
>> - typo fixed in patch2 commit message
>>
>> The code around the array register access was pretty confusing for the first
>> look, so clean them up first then use the cleaner way in the polled handling.
>>
>> When a DMA client driver does not set the DMA_PREP_INTERRUPT because it
>> does not want to use interrupts for DMA completion or because it can not
>> rely on DMA interrupts due to executing the memcpy when interrupts are
>> disabled it will poll the status of the transfer.
>>
>> Since we can not tell from any EDMA register that the transfer is
>> completed, we can only know that the paRAM set has been sent to TPTC for
>> processing we need to check the residue of the transfer, if it is 0 then
>> the transfer is completed.
>>
>> The polled completion can bve tested by applying:
>> https://patchwork.kernel.org/patch/10966499/
>>
>> Enabling the memcpy for EDMA and run the dmatest with polled = 1.
>>
>> Or, enable the EDMA memcpy support and boot up any dra7 family device with
>> display enabled. The workaround for DMM errata i878 uses polled DMA memcpy.
> 
> Applied, thanks. Fixed typo in 2nd patch while at it

Thank you! I was about to send v6 with the fixed typo.

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Peter Ujfalusi July 29, 2019, 7:24 a.m. UTC | #3
Vinod,

On 29/07/2019 9.42, Vinod Koul wrote:
> On 16-07-19, 11:26, Peter Ujfalusi wrote:
>> Hi,
>>
>> Changes since v4:
>> - Split the DMA_COMPLETE and !txstate check as Vinod suggested
>>
>> Change since v3:
>> - fix DMA pointer tracking for memcpy
>> - completion polling is only done when it is asked by not providing
>>   DMA_PREP_INTERRUPT for memcpy
>>
>> Changes since v2:
>> - Fix typo in the comment for patch 0
>>
>> Changes since v1:
>> - Cleanup patch for the array register handling
>> - typo fixed in patch2 commit message
>>
>> The code around the array register access was pretty confusing for the first
>> look, so clean them up first then use the cleaner way in the polled handling.
>>
>> When a DMA client driver does not set the DMA_PREP_INTERRUPT because it
>> does not want to use interrupts for DMA completion or because it can not
>> rely on DMA interrupts due to executing the memcpy when interrupts are
>> disabled it will poll the status of the transfer.
>>
>> Since we can not tell from any EDMA register that the transfer is
>> completed, we can only know that the paRAM set has been sent to TPTC for
>> processing we need to check the residue of the transfer, if it is 0 then
>> the transfer is completed.
>>
>> The polled completion can bve tested by applying:
>> https://patchwork.kernel.org/patch/10966499/

Should I resend this patch so the polled mode can be tested in upstream?

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Vinod Koul July 29, 2019, 7:33 a.m. UTC | #4
On 29-07-19, 10:24, Peter Ujfalusi wrote:
> Vinod,
> 
> On 29/07/2019 9.42, Vinod Koul wrote:
> > On 16-07-19, 11:26, Peter Ujfalusi wrote:
> >> Hi,
> >>
> >> Changes since v4:
> >> - Split the DMA_COMPLETE and !txstate check as Vinod suggested
> >>
> >> Change since v3:
> >> - fix DMA pointer tracking for memcpy
> >> - completion polling is only done when it is asked by not providing
> >>   DMA_PREP_INTERRUPT for memcpy
> >>
> >> Changes since v2:
> >> - Fix typo in the comment for patch 0
> >>
> >> Changes since v1:
> >> - Cleanup patch for the array register handling
> >> - typo fixed in patch2 commit message
> >>
> >> The code around the array register access was pretty confusing for the first
> >> look, so clean them up first then use the cleaner way in the polled handling.
> >>
> >> When a DMA client driver does not set the DMA_PREP_INTERRUPT because it
> >> does not want to use interrupts for DMA completion or because it can not
> >> rely on DMA interrupts due to executing the memcpy when interrupts are
> >> disabled it will poll the status of the transfer.
> >>
> >> Since we can not tell from any EDMA register that the transfer is
> >> completed, we can only know that the paRAM set has been sent to TPTC for
> >> processing we need to check the residue of the transfer, if it is 0 then
> >> the transfer is completed.
> >>
> >> The polled completion can bve tested by applying:
> >> https://patchwork.kernel.org/patch/10966499/
> 
> Should I resend this patch so the polled mode can be tested in upstream?

Yes sure
Vinod Koul July 29, 2019, 7:33 a.m. UTC | #5
On 29-07-19, 10:22, Peter Ujfalusi wrote:
> Vinod,
> 
> On 29/07/2019 9.42, Vinod Koul wrote:
> > On 16-07-19, 11:26, Peter Ujfalusi wrote:
> >> Hi,
> >>
> >> Changes since v4:
> >> - Split the DMA_COMPLETE and !txstate check as Vinod suggested
> >>
> >> Change since v3:
> >> - fix DMA pointer tracking for memcpy
> >> - completion polling is only done when it is asked by not providing
> >>   DMA_PREP_INTERRUPT for memcpy
> >>
> >> Changes since v2:
> >> - Fix typo in the comment for patch 0
> >>
> >> Changes since v1:
> >> - Cleanup patch for the array register handling
> >> - typo fixed in patch2 commit message
> >>
> >> The code around the array register access was pretty confusing for the first
> >> look, so clean them up first then use the cleaner way in the polled handling.
> >>
> >> When a DMA client driver does not set the DMA_PREP_INTERRUPT because it
> >> does not want to use interrupts for DMA completion or because it can not
> >> rely on DMA interrupts due to executing the memcpy when interrupts are
> >> disabled it will poll the status of the transfer.
> >>
> >> Since we can not tell from any EDMA register that the transfer is
> >> completed, we can only know that the paRAM set has been sent to TPTC for
> >> processing we need to check the residue of the transfer, if it is 0 then
> >> the transfer is completed.
> >>
> >> The polled completion can bve tested by applying:
> >> https://patchwork.kernel.org/patch/10966499/
> >>
> >> Enabling the memcpy for EDMA and run the dmatest with polled = 1.
> >>
> >> Or, enable the EDMA memcpy support and boot up any dra7 family device with
> >> display enabled. The workaround for DMM errata i878 uses polled DMA memcpy.
> > 
> > Applied, thanks. Fixed typo in 2nd patch while at it
> 
> Thank you! I was about to send v6 with the fixed typo.

Simpler typos are ok to fix while applying