Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1346246 > unrolled thread
| Started by | Andy Gross <andy.gross@linaro.org> |
|---|---|
| First post | 2016-03-01 00:20 +0100 |
| Last post | 2016-03-03 16:50 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] dmaengine: qcom_bam_dma: Make driver work for BE Andy Gross <andy.gross@linaro.org> - 2016-03-01 00:20 +0100
Re: [PATCH] dmaengine: qcom_bam_dma: Make driver work for BE Vinod Koul <vinod.koul@intel.com> - 2016-03-03 16:50 +0100
| From | Andy Gross <andy.gross@linaro.org> |
|---|---|
| Date | 2016-03-01 00:20 +0100 |
| Subject | [PATCH] dmaengine: qcom_bam_dma: Make driver work for BE |
| Message-ID | <r7FgC-14T-17@gated-at.bofh.it> |
This patch fixes the Qualcomm BAM dmaenging driver to work with big
endian kernels.
Signed-off-by: Andy Gross <andy.gross@linaro.org>
---
drivers/dma/qcom_bam_dma.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/drivers/dma/qcom_bam_dma.c b/drivers/dma/qcom_bam_dma.c
index 5a250cd..37f7aec 100644
--- a/drivers/dma/qcom_bam_dma.c
+++ b/drivers/dma/qcom_bam_dma.c
@@ -53,9 +53,9 @@
#include "virt-dma.h"
struct bam_desc_hw {
- u32 addr; /* Buffer physical address */
- u16 size; /* Buffer size in bytes */
- u16 flags;
+ __le32 addr; /* Buffer physical address */
+ __le16 size; /* Buffer size in bytes */
+ __le16 flags;
};
#define DESC_FLAG_INT BIT(15)
@@ -632,14 +632,15 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan,
unsigned int curr_offset = 0;
do {
- desc->addr = sg_dma_address(sg) + curr_offset;
+ desc->addr = cpu_to_le32(sg_dma_address(sg) +
+ curr_offset);
if (remainder > BAM_MAX_DATA_SIZE) {
- desc->size = BAM_MAX_DATA_SIZE;
+ desc->size = cpu_to_le16(BAM_MAX_DATA_SIZE);
remainder -= BAM_MAX_DATA_SIZE;
curr_offset += BAM_MAX_DATA_SIZE;
} else {
- desc->size = remainder;
+ desc->size = cpu_to_le16(remainder);
remainder = 0;
}
@@ -915,9 +916,11 @@ static void bam_start_dma(struct bam_chan *bchan)
/* set any special flags on the last descriptor */
if (async_desc->num_desc == async_desc->xfer_len)
- desc[async_desc->xfer_len - 1].flags = async_desc->flags;
+ desc[async_desc->xfer_len - 1].flags =
+ cpu_to_le16(async_desc->flags);
else
- desc[async_desc->xfer_len - 1].flags |= DESC_FLAG_INT;
+ desc[async_desc->xfer_len - 1].flags |=
+ cpu_to_le16(DESC_FLAG_INT);
if (bchan->tail + async_desc->xfer_len > MAX_DESCRIPTORS) {
u32 partial = MAX_DESCRIPTORS - bchan->tail;
--
1.9.1
[toc] | [next] | [standalone]
| From | Vinod Koul <vinod.koul@intel.com> |
|---|---|
| Date | 2016-03-03 16:50 +0100 |
| Message-ID | <r8DFN-IC-21@gated-at.bofh.it> |
| In reply to | #1346246 |
On Mon, Feb 29, 2016 at 05:15:19PM -0600, Andy Gross wrote: > This patch fixes the Qualcomm BAM dmaenging driver to work with big > endian kernels. Applied thanks -- ~Vinod
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web