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


Groups > linux.kernel > #1294468

Re: [RESEND][PATCH v2] dmaengine: bcm2835: Add slave dma support

From Martin Sperl <kernel@martin.sperl.org>
Newsgroups linux.kernel
Subject Re: [RESEND][PATCH v2] dmaengine: bcm2835: Add slave dma support
Date 2015-12-18 08:30 +0100
Message-ID <qGXEe-2xG-3@gated-at.bofh.it> (permalink)
References <qGLjI-2Xy-11@gated-at.bofh.it> <qGWoN-1Qf-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> On 18.12.2015, at 07:05, Vinod Koul <vinod.koul@intel.com> wrote:
> 
> On Thu, Dec 17, 2015 at 07:11:48PM +0100, Martin Sperl wrote:
> 
>> +
>> +			/* Setup addresses */
>> +			if (d->dir == DMA_DEV_TO_MEM) {
>> +				control_block->info = BCM2835_DMA_D_INC |
>> +						      BCM2835_DMA_D_WIDTH |
>> +						      BCM2835_DMA_S_DREQ;
>> +				control_block->src = dev_addr;
>> +				control_block->dst = addr + (dma_addr_t)j;
>> +			} else {
>> +				control_block->info = BCM2835_DMA_S_INC |
>> +						      BCM2835_DMA_S_WIDTH |
>> +						      BCM2835_DMA_D_DREQ;
>> +				control_block->src = addr + (dma_addr_t)j;
>> +				control_block->dst = dev_addr;
>> +			}
>> +
>> +			/* Common part */
>> +			control_block->info |=
>> +				BCM2835_DMA_WAITS(BCM2835_DMA_WAIT_CYCLES);
>> +			control_block->info |= BCM2835_DMA_WAIT_RESP;
>> +
>> +			/* Enable */
>> +			if (i == sg_len - 1 && len - j <= max_size)
>> +				control_block->info |= BCM2835_DMA_INT_EN;
>> +
>> +			/* Setup synchronization */
>> +			if (sync_type)
>> +				control_block->info |= sync_type;
>> +
>> +			/* Setup DREQ channel */
>> +			if (c->dreq)
>> +				control_block->info |=
>> +					BCM2835_DMA_PER_MAP(c->dreq);
>> +
>> +			/* Length of a frame */
>> +			control_block->length = min(len - j, max_size);
>> +			d->size += control_block->length;
>> +
>> +			if (i < sg_len - 1 || len - j > max_size) {
>> +				/* Next block is the next frame. */
>> +				control_block->next =
>> +					d->control_block_base_phys +
>> +					sizeof(struct bcm2835_dma_cb) *
>> +					(i + split_cnt + 1);
>> +			} else {
>> +				/* Next block is empty. */
>> +				control_block->next = 0;
>> +			}
>> +
>> +			if (len - j > max_size)
>> +				split_cnt++;
> 
> Most of this part is common with the cyclic and seems copy paste. Can we
> use common routine to do common work please

I agree - can have a look - the big question is: how would I document the 
individual changes by Gellert Weisz and myself correctly?
* just a single patch with an attribution tag (which?) or just a commit message?
* Patchset with 2 patches: the original by Gellert Weisz (this)
  plus the modification to consolidate the code above?

Thanks,
	Martin--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[RESEND][PATCH v2] dmaengine: bcm2835: Add slave dma support Martin Sperl <kernel@martin.sperl.org> - 2015-12-17 19:20 +0100
  Re: [RESEND][PATCH v2] dmaengine: bcm2835: Add slave dma support Vinod Koul <vinod.koul@intel.com> - 2015-12-18 07:10 +0100
    Re: [RESEND][PATCH v2] dmaengine: bcm2835: Add slave dma support Martin Sperl <kernel@martin.sperl.org> - 2015-12-18 08:30 +0100
      Re: [RESEND][PATCH v2] dmaengine: bcm2835: Add slave dma support Vinod Koul <vinod.koul@intel.com> - 2015-12-18 09:10 +0100

csiph-web