From patchwork Wed Sep 15 13:29:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 182592 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8FDUBGQ016290 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 15 Sep 2010 13:30:48 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Ovs3l-0008BP-3g; Wed, 15 Sep 2010 13:30:01 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Ovs3j-0008B8-S6 for spi-devel-general@lists.sourceforge.net; Wed, 15 Sep 2010 13:29:59 +0000 X-ACL-Warn: Received: from pegase1.c-s.fr ([194.2.40.7] helo=mailhub1.si.c-s.fr) by sog-mx-2.v43.ch3.sourceforge.com with esmtp (Exim 4.69) id 1Ovs3h-0003D5-Ag for spi-devel-general@lists.sourceforge.net; Wed, 15 Sep 2010 13:29:59 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 607421C81C5; Wed, 15 Sep 2010 15:29:51 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from mailhub1.si.c-s.fr ([192.168.12.234]) by localhost (mailhub1.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p9fbrFhY9lK5; Wed, 15 Sep 2010 15:29:51 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 48B941C81C0; Wed, 15 Sep 2010 15:29:51 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 27399C73CA; Wed, 15 Sep 2010 15:29:51 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id PuXusFyr8VVW; Wed, 15 Sep 2010 15:29:51 +0200 (CEST) Received: from [172.25.231.36] (unknown [172.25.231.36]) by messagerie.si.c-s.fr (Postfix) with ESMTP id BE587C7393; Wed, 15 Sep 2010 15:29:50 +0200 (CEST) Message-ID: <4C90CA4D.2020902@c-s.fr> Date: Wed, 15 Sep 2010 15:29:49 +0200 From: LEROY Christophe User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.9) Gecko/20100825 Thunderbird/3.1.3 MIME-Version: 1.0 To: David Brownell , Grant Likely Subject: [PATCH] fixes probe issue and hangup in spi_mpc8xxx.c for data bigger than PAGE_SIZE X-Spam-Score: 0.7 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 1.4 FS_ABIGGER Subject has "a bigger" -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.7 AWL AWL: From: address is in the auto white-list X-Headers-End: 1Ovs3h-0003D5-Ag Cc: spi-devel-general@lists.sourceforge.net, LinuxPPC-dev , linux-kernel@vger.kernel.org X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 15 Sep 2010 13:30:48 +0000 (UTC) X-MIME-Autoconverted: from quoted-printable to 8bit by demeter1.kernel.org id o8FDUBGQ016290 Index: trunk/drivers/spi/spi_mpc8xxx.c =================================================================== --- trunk/drivers/spi/spi_mpc8xxx.c (révision 963) +++ trunk/drivers/spi/spi_mpc8xxx.c (copie de travail) @@ -393,11 +393,17 @@ xfer_ofs = mspi->xfer_in_progress->len - mspi->count; - out_be32(&rx_bd->cbd_bufaddr, mspi->rx_dma + xfer_ofs); + if (mspi->rx_dma == mspi->dma_dummy_rx) + out_be32(&rx_bd->cbd_bufaddr, mspi->rx_dma); + else + out_be32(&rx_bd->cbd_bufaddr, mspi->rx_dma + xfer_ofs); out_be16(&rx_bd->cbd_datlen, 0); out_be16(&rx_bd->cbd_sc, BD_SC_EMPTY | BD_SC_INTRPT | BD_SC_WRAP); - out_be32(&tx_bd->cbd_bufaddr, mspi->tx_dma + xfer_ofs); + if (mspi->tx_dma == mspi->dma_dummy_tx) + out_be32(&tx_bd->cbd_bufaddr, mspi->tx_dma); + else + out_be32(&tx_bd->cbd_bufaddr, mspi->tx_dma + xfer_ofs); out_be16(&tx_bd->cbd_datlen, xfer_len); out_be16(&tx_bd->cbd_sc, BD_SC_READY | BD_SC_INTRPT | BD_SC_WRAP | BD_SC_LAST); @@ -438,7 +444,7 @@ dev_err(dev, "unable to map tx dma\n"); return -ENOMEM; } - } else { + } else if (t->tx_buf) { mspi->tx_dma = t->tx_dma; } @@ -449,7 +455,7 @@ dev_err(dev, "unable to map rx dma\n"); goto err_rx_dma; } - } else { + } else if (t->rx_buf) { mspi->rx_dma = t->rx_dma; } @@ -822,7 +828,7 @@ if (!iprop || size != sizeof(*iprop) * 4) return -ENOMEM; - spi_base_ofs = cpm_muram_alloc_fixed(iprop[2], 2); + spi_base_ofs = iprop[2]; if (IS_ERR_VALUE(spi_base_ofs)) return -ENOMEM; @@ -844,7 +850,6 @@ return spi_base_ofs; } - cpm_muram_free(spi_base_ofs); return pram_ofs; }