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

From: Noralf TrÃnnes
Date: Thu Apr 16 2015 - 18:09:47 EST



Den 15.04.2015 21:00, skrev Stefan Wahren:
Hi Noralf,

Am 15.04.2015 um 11:56 schrieb Noralf TrÃnnes:
Add slave transfer capability to BCM2835 dmaengine driver.
This patch is pulled from the bcm2708-dmaengine driver in the
Raspberry Pi repo. The work was done by Gellert Weisz.

Tested with the bcm2835-mmc driver from the same repo.

why not with the upstream kernel?


See my answer to Alexander Stein.

+ unsigned int i, j, splitct, max_size;

I think "split_cnt" would be better.

+ es = BCM2835_DMA_DATA_TYPE_S32;

Looks like "es" is never used.

+ break;
+ default:

A dev_err() might be useful here.

+ d->frames += 1 + len / max_size;

If it's correct this should be more intuitive:

d->frames += len / max_size + 1;

+ for_each_sg(sgl, sgent, sg_len, i) {
+ dma_addr_t addr = sg_dma_address(sgent);
+ unsigned int len = sg_dma_len(sgent);
+
+ for (j = 0; j < len; j += max_size) {

It should be possible to move declaration of "j" down here.

+ if (sync_type != 0)

if (sync_type) ?


Thanks for your comments Stefan, I'll make a new version of the patch.


Noralf.

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