From patchwork Wed Feb 19 09:36:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 3679691 X-Patchwork-Delegate: broonie@sirena.org.uk 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 A18E19F2EC for ; Wed, 19 Feb 2014 09:46:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DB58B2017B for ; Wed, 19 Feb 2014 09:46:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1D6002015E for ; Wed, 19 Feb 2014 09:46:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753004AbaBSJqI (ORCPT ); Wed, 19 Feb 2014 04:46:08 -0500 Received: from webbox1416.server-home.net ([77.236.96.61]:34415 "EHLO webbox1416.server-home.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752557AbaBSJqH (ORCPT ); Wed, 19 Feb 2014 04:46:07 -0500 X-Greylist: delayed 585 seconds by postgrey-1.27 at vger.kernel.org; Wed, 19 Feb 2014 04:46:07 EST Received: from comm.systec-electronic.de (unknown [212.185.67.148]) by webbox1416.server-home.net (Postfix) with ESMTPA id 1750E27A632; Wed, 19 Feb 2014 09:42:17 +0100 (CET) Received: from ws-stein.systec-electronic.de (unknown [192.168.10.118]) by comm.systec-electronic.de (Postfix) with ESMTP id DA1D997C276; Wed, 19 Feb 2014 10:36:18 +0100 (CET) From: Alexander Stein To: Mark Brown Cc: linux-spi@vger.kernel.org, Alexander Stein Subject: [PATCH 2/3] spi-topcliff-pch: Fix DMA channel Date: Wed, 19 Feb 2014 10:36:08 +0100 Message-Id: <1392802569-11148-2-git-send-email-alexander.stein@systec-electronic.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1392802569-11148-1-git-send-email-alexander.stein@systec-electronic.com> References: <1392802569-11148-1-git-send-email-alexander.stein@systec-electronic.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 bus_num might be asigned dynamically to e.g. 32766. In this case the calculated DMA channel based on SPI bus number is bogus. Use SPI channel number instead for calculation. Signed-off-by: Alexander Stein --- drivers/spi/spi-topcliff-pch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c index d038a7b..7cb71b0 100644 --- a/drivers/spi/spi-topcliff-pch.c +++ b/drivers/spi/spi-topcliff-pch.c @@ -921,7 +921,7 @@ static void pch_spi_request_dma(struct pch_spi_data *data, int bpw) /* Set Tx DMA */ param = &dma->param_tx; param->dma_dev = &dma_dev->dev; - param->chan_id = data->master->bus_num * 2; /* Tx = 0, 2 */ + param->chan_id = data->ch * 2; /* Tx = 0, 2 */; param->tx_reg = data->io_base_addr + PCH_SPDWR; param->width = width; chan = dma_request_channel(mask, pch_spi_filter, param); @@ -936,7 +936,7 @@ static void pch_spi_request_dma(struct pch_spi_data *data, int bpw) /* Set Rx DMA */ param = &dma->param_rx; param->dma_dev = &dma_dev->dev; - param->chan_id = data->master->bus_num * 2 + 1; /* Rx = Tx + 1 */ + param->chan_id = data->ch * 2 + 1; /* Rx = Tx + 1 */; param->rx_reg = data->io_base_addr + PCH_SPDRR; param->width = width; chan = dma_request_channel(mask, pch_spi_filter, param);