From patchwork Thu Jun 5 17:45:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chew Chiau Ee X-Patchwork-Id: 4304211 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B054F9F3FF for ; Thu, 5 Jun 2014 09:41:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E0C3C20251 for ; Thu, 5 Jun 2014 09:41:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 14E80201F7 for ; Thu, 5 Jun 2014 09:41:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751135AbaFEJlX (ORCPT ); Thu, 5 Jun 2014 05:41:23 -0400 Received: from mga09.intel.com ([134.134.136.24]:11749 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750833AbaFEJlX (ORCPT ); Thu, 5 Jun 2014 05:41:23 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 05 Jun 2014 02:36:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.98,980,1392192000"; d="scan'208";a="523080432" Received: from unknown (HELO localhost.png.intel.com) ([10.221.118.140]) by orsmga001.jf.intel.com with ESMTP; 05 Jun 2014 02:41:19 -0700 From: Chew Chiau Ee To: Mark Brown , Eric Miao , Russell King , Haojian Zhuang Cc: Mika Westerberg , Chew Chiau Ee , linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, LKML@vger.kernel.org Subject: [PATCH] spi/pxa2xx: change default supported DMA burst size to 1 Date: Fri, 6 Jun 2014 01:45:09 +0800 Message-Id: <1401990309-12492-1-git-send-email-chiau.ee.chew@intel.com> X-Mailer: git-send-email 1.7.4.4 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, DATE_IN_FUTURE_06_12, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Chew, Chiau Ee This is to fix the SPI DMA transfer failure for speed less than 1M. If using current DMA burst size setting (16), the Rx data bytes are invalid due to each data byte is multiplied according to the burst size setting. Let's said supposedly we shall receive the following 18 bytes of data: 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 Instead, the data bytes received consist of "16 bytes of '01' + 2 bytes of '02'" : 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 02 02 Signed-off-by: Chew, Chiau Ee Cc: Mika Westerberg Acked-by: Mika Westerberg --- drivers/spi/spi-pxa2xx-dma.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/spi/spi-pxa2xx-dma.c b/drivers/spi/spi-pxa2xx-dma.c index f6759dc..c41ff14 100644 --- a/drivers/spi/spi-pxa2xx-dma.c +++ b/drivers/spi/spi-pxa2xx-dma.c @@ -368,7 +368,7 @@ int pxa2xx_spi_set_dma_burst_and_threshold(struct chip_data *chip, * otherwise we use the default. Also we use the default FIFO * thresholds for now. */ - *burst_code = chip_info ? chip_info->dma_burst_size : 16; + *burst_code = chip_info ? chip_info->dma_burst_size : 1; *threshold = SSCR1_RxTresh(RX_THRESH_DFLT) | SSCR1_TxTresh(TX_THRESH_DFLT);