Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1415726

Re: [PATCH] dmaengine: bcm2835: Fix polling for completion of DMA with interrupts masked.

From Eric Anholt <eric@anholt.net>
Newsgroups linux.kernel
Subject Re: [PATCH] dmaengine: bcm2835: Fix polling for completion of DMA with interrupts masked.
Date 2016-06-07 08:20 +0200
Message-ID <rHiwO-7rh-3@gated-at.bofh.it> (permalink)
References <rG9vz-2XA-3@gated-at.bofh.it> <rGUkS-8lg-7@gated-at.bofh.it> <rH6Fj-7Xq-3@gated-at.bofh.it> <rHhAJ-6QQ-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Vinod Koul <vinod.koul@intel.com> writes:

> On Mon, Jun 06, 2016 at 10:33:18AM -0700, Eric Anholt wrote:
>> Vinod Koul <vinod.koul@intel.com> writes:
>> 
>> > On Fri, Jun 03, 2016 at 07:29:11PM -0700, Eric Anholt wrote:
>> >> The tx_status hook is supposed to be safe to call from interrupt
>> >> context, but it wouldn't ever return completion for the last transfer,
>> >> meaning you couldn't poll for DMA completion with interrupts masked.
>> >
>> > and why is that?
>> 
>> Maybe this was poorly worded.  How about:
>> 
>> The tx_status hook is supposed to be safe to call from interrupt
>> context.  However, the current transfer currently only gets marked
>> complete by the IRQ handler, so if interrupts were masked then polling
>> for completion would never finish.
>
> Sound better :)
>
>> 
>> >> This fixes IRQ handling for bcm2835's DSI1, which requires using the
>> >> DMA engine to write its registers due to a bug in the AXI bridge.
>> >> 
>> >> Signed-off-by: Eric Anholt <eric@anholt.net>
>> >> ---
>> >>  drivers/dma/bcm2835-dma.c | 24 +++++++++++++++++++-----
>> >>  1 file changed, 19 insertions(+), 5 deletions(-)
>> >> 
>> >> diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c
>> >> index 6149b27c33ad..320461c578e3 100644
>> >> --- a/drivers/dma/bcm2835-dma.c
>> >> +++ b/drivers/dma/bcm2835-dma.c
>> >> @@ -570,16 +570,16 @@ static enum dma_status bcm2835_dma_tx_status(struct dma_chan *chan,
>> >>  	struct virt_dma_desc *vd;
>> >>  	enum dma_status ret;
>> >>  	unsigned long flags;
>> >> +	u32 residue;
>> >>  
>> >>  	ret = dma_cookie_status(chan, cookie, txstate);
>> >> -	if (ret == DMA_COMPLETE || !txstate)
>> >> +	if (ret == DMA_COMPLETE)
>> >
>> > Why do you change this? txstate can be NULL, so no point calculating reside
>> > for those cases
>> 
>> The point was to go into the "Calculate where we're at in our current
>> DMA (if the current DMA is the one we're asking about status for)" path,
>> so that we could note when the DMA is complete even when there's no
>> txstate passed in.
>
> Can you explain what you mean by current DMA!
>
> The claulation is always done for 'descriptor' represnted by the cookie. So
> it doesnt not matter...!

By current I mean the current descriptor that has been submitted to the
hardware, in bcm2835_chan->desc.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] dmaengine: bcm2835: Fix polling for completion of DMA with interrupts masked. Eric Anholt <eric@anholt.net> - 2016-06-04 04:30 +0200
  Re: [PATCH] dmaengine: bcm2835: Fix polling for completion of DMA  with interrupts masked. Vinod Koul <vinod.koul@intel.com> - 2016-06-06 06:30 +0200
    Re: [PATCH] dmaengine: bcm2835: Fix polling for completion of DMA with interrupts masked. Eric Anholt <eric@anholt.net> - 2016-06-06 19:40 +0200
      Re: [PATCH] dmaengine: bcm2835: Fix polling for completion of DMA  with interrupts masked. Vinod Koul <vinod.koul@intel.com> - 2016-06-07 07:20 +0200
        Re: [PATCH] dmaengine: bcm2835: Fix polling for completion of DMA with interrupts masked. Eric Anholt <eric@anholt.net> - 2016-06-07 08:20 +0200
          Re: [PATCH] dmaengine: bcm2835: Fix polling for completion of DMA  with interrupts masked. Vinod Koul <vinod.koul@intel.com> - 2016-06-07 09:20 +0200
            Re: [PATCH] dmaengine: bcm2835: Fix polling for completion of DMA with interrupts masked. Eric Anholt <eric@anholt.net> - 2016-06-07 23:00 +0200

csiph-web