From patchwork Mon Feb 29 23:15:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Gross X-Patchwork-Id: 63263 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1515306lbc; Mon, 29 Feb 2016 15:15:32 -0800 (PST) X-Received: by 10.66.190.168 with SMTP id gr8mr26129423pac.23.1456787732736; Mon, 29 Feb 2016 15:15:32 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id kk8si7392529pab.26.2016.02.29.15.15.32; Mon, 29 Feb 2016 15:15:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753453AbcB2XPb (ORCPT + 7 others); Mon, 29 Feb 2016 18:15:31 -0500 Received: from mail-ob0-f170.google.com ([209.85.214.170]:32877 "EHLO mail-ob0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751682AbcB2XPa (ORCPT ); Mon, 29 Feb 2016 18:15:30 -0500 Received: by mail-ob0-f170.google.com with SMTP id fz5so18447405obc.0 for ; Mon, 29 Feb 2016 15:15:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=0qYbPPb546EUjLmwWQsb2Ai3obP1aZEoWrwFFmf5dSU=; b=ZdK5yOfx0ptnc9fBc2wxgoQjc6cYhb643KJ6DYTOPayseuU6pCAe3qHU9CqgDQSG4Q 8f2O2HroCGVXF6vXLG7Wp6Ux5rVFGkNuyyWzd+Y83wdurd8kk0YPTDSpWu1iC2TGbIPZ wjhcJfG1dIvjwJmtyoxz/FhT0HInhs3HGgTiY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=0qYbPPb546EUjLmwWQsb2Ai3obP1aZEoWrwFFmf5dSU=; b=KXTl34Ab/b7kUvZAwez/YEyc0k6bJ4eT7BfaSk9kPKAU97Qd+OG2YBoKqH26r+Ejpv emmJlHJMD5uh4j64A/tMxQ/dAdTARB99uaW6FmEBJfvVQ+LEEc7WAf8ucK0tMVIexKM+ xYiQIIlL/2lOCJJP999aCElCF8x9Dk9zJT81upfAoB/y44xmg7pxQpYlO64bTOym1mZ4 B6Nr/Rl6dPU2ZjHX7XO886dKAFYgWFRTVMhLqDPfDyBnihGH5oo7yN7CRQbk3nRVkvPo n2mKtAo1CoA2IeWWjl/tesRrfDZg8Yg48HNRgVE4Nf7TUBCwXfJKtUwprcKCmU6TR6wO 47Eg== X-Gm-Message-State: AD7BkJIe+6ULxiGmhnvV8VTLPHs51INWMVhgVWds0Z0MaHNs26GB3GmEWapOnKnJNQL7cOFz X-Received: by 10.182.131.202 with SMTP id oo10mr14796480obb.72.1456787729878; Mon, 29 Feb 2016 15:15:29 -0800 (PST) Received: from Agamemnon.attlocal.net (108-85-129-155.lightspeed.austtx.sbcglobal.net. [108.85.129.155]) by smtp.gmail.com with ESMTPSA id y196sm19715522oia.24.2016.02.29.15.15.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Feb 2016 15:15:29 -0800 (PST) From: Andy Gross To: Vinod Koul Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, dmaengine@vger.kernel.org, Andy Gross Subject: [PATCH] dmaengine: qcom_bam_dma: Make driver work for BE Date: Mon, 29 Feb 2016 17:15:19 -0600 Message-Id: <1456787719-28270-1-git-send-email-andy.gross@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This patch fixes the Qualcomm BAM dmaenging driver to work with big endian kernels. Signed-off-by: Andy Gross --- drivers/dma/qcom_bam_dma.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;