diff options
author | Álvaro Fernández Rojas <noltari@gmail.com> | 2016-12-02 11:50:26 +0100 |
---|---|---|
committer | Álvaro Fernández Rojas <noltari@gmail.com> | 2016-12-04 12:32:04 +0100 |
commit | 011f2c26f1b62e309f2eac6a3101bfe0a3c76c7e (patch) | |
tree | be53d4f11f7625508ee3aea9889e854ab5b5f263 /target/linux/brcm2708/patches-4.4/0388-Revert-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch | |
parent | 4257f6548b9480cdb436115b63d5c134c5e91303 (diff) | |
download | upstream-011f2c26f1b62e309f2eac6a3101bfe0a3c76c7e.tar.gz upstream-011f2c26f1b62e309f2eac6a3101bfe0a3c76c7e.tar.bz2 upstream-011f2c26f1b62e309f2eac6a3101bfe0a3c76c7e.zip |
brcm2708: update linux 4.4 patches to latest version
As usual these patches were extracted and rebased from the raspberry pi repo:
https://github.com/raspberrypi/linux/tree/rpi-4.4.y
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/brcm2708/patches-4.4/0388-Revert-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch')
-rw-r--r-- | target/linux/brcm2708/patches-4.4/0388-Revert-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/target/linux/brcm2708/patches-4.4/0388-Revert-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch b/target/linux/brcm2708/patches-4.4/0388-Revert-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch new file mode 100644 index 0000000000..d871ba9cdd --- /dev/null +++ b/target/linux/brcm2708/patches-4.4/0388-Revert-bcm2835-dma-Fix-up-convert-to-DMA-pool.patch @@ -0,0 +1,86 @@ +From 80e7256b69b395f91738b44dc259c9fa4d15dda3 Mon Sep 17 00:00:00 2001 +From: Martin Sperl <kernel@martin.sperl.org> +Date: Fri, 22 Apr 2016 17:17:13 +0000 +Subject: [PATCH] Revert "bcm2835-dma: Fix up convert to DMA pool" + +This reverts commit ec2e48fda22c57cab56a4332d1a095f91c919493. +--- + drivers/dma/bcm2835-dma.c | 36 ++++++++++-------------------------- + 1 file changed, 10 insertions(+), 26 deletions(-) + +--- a/drivers/dma/bcm2835-dma.c ++++ b/drivers/dma/bcm2835-dma.c +@@ -488,17 +488,6 @@ static struct dma_async_tx_descriptor *b + c->cyclic = true; + + return vchan_tx_prep(&c->vc, &d->vd, flags); +-error_cb: +- i--; +- for (; i >= 0; i--) { +- struct bcm2835_cb_entry *cb_entry = &d->cb_list[i]; +- +- dma_pool_free(c->cb_pool, cb_entry->cb, cb_entry->paddr); +- } +- +- kfree(d->cb_list); +- kfree(d); +- return NULL; + } + + static struct dma_async_tx_descriptor * +@@ -545,7 +534,6 @@ bcm2835_dma_prep_slave_sg(struct dma_cha + if (!d) + return NULL; + +- d->c = c; + d->dir = direction; + + if (c->ch >= 8) /* LITE channel */ +@@ -565,21 +553,15 @@ bcm2835_dma_prep_slave_sg(struct dma_cha + d->frames += len / max_size + 1; + } + +- d->cb_list = kcalloc(d->frames, sizeof(*d->cb_list), GFP_KERNEL); +- if (!d->cb_list) { ++ /* Allocate memory for control blocks */ ++ d->control_block_size = d->frames * sizeof(struct bcm2835_dma_cb); ++ d->control_block_base = dma_zalloc_coherent(chan->device->dev, ++ d->control_block_size, &d->control_block_base_phys, ++ GFP_NOWAIT); ++ if (!d->control_block_base) { + kfree(d); + return NULL; + } +- /* Allocate memory for control blocks */ +- for (i = 0; i < d->frames; i++) { +- struct bcm2835_cb_entry *cb_entry = &d->cb_list[i]; +- +- cb_entry->cb = dma_pool_zalloc(c->cb_pool, GFP_ATOMIC, +- &cb_entry->paddr); +- +- if (!cb_entry->cb) +- goto error_cb; +- } + + /* + * Iterate over all SG entries, create a control block +@@ -596,7 +578,7 @@ bcm2835_dma_prep_slave_sg(struct dma_cha + + for (j = 0; j < len; j += max_size) { + struct bcm2835_dma_cb *control_block = +- d->cb_list[i + split_cnt].cb; ++ &d->control_block_base[i + split_cnt]; + + /* Setup addresses */ + if (d->dir == DMA_DEV_TO_MEM) { +@@ -638,7 +620,9 @@ bcm2835_dma_prep_slave_sg(struct dma_cha + if (i < sg_len - 1 || len - j > max_size) { + /* Next block is the next frame. */ + control_block->next = +- d->cb_list[i + split_cnt + 1].paddr; ++ d->control_block_base_phys + ++ sizeof(struct bcm2835_dma_cb) * ++ (i + split_cnt + 1); + } else { + /* Next block is empty. */ + control_block->next = 0; |