Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752910AbbFCXmJ (ORCPT ); Wed, 3 Jun 2015 19:42:09 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:55943 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752206AbbFCXl0 (ORCPT ); Wed, 3 Jun 2015 19:41:26 -0400 X-Auth-Info: uqsAz02nN3l8ZiqLL6NMbLQ1YGIxn0G7jXxkJrPc2Tc= From: Marek Vasut To: Michal Suchanek Subject: Re: [PATCH 08/11] MTD: m25p80: Add option to limit SPI transfer size. Date: Thu, 4 Jun 2015 01:03:09 +0200 User-Agent: KMail/1.13.7 (Linux/3.14-2-amd64; KDE/4.13.1; x86_64; ; ) Cc: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Russell King , Kukjin Kim , Krzysztof Kozlowski , Vinod Koul , Dan Williams , David Woodhouse , Brian Norris , Han Xu , Mark Brown , Geert Uytterhoeven , " =?utf-8?q?Rafa=C5=82?= =?utf-8?q?_Mi=C5=82ecki?=" , Alison Chaiken , Huang Shijie , Ben Hutchings , Knut Wohlrab , "Bean Huo =?utf-8?q?=E9=9C=8D=E6=96=8C=E6=96=8C?= \(beanhuo\)" , "grmoore@altera.com" , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, dmaengine@vger.kernel.org, linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org References: <8fc4b9f5291a509c4c35782a1337bf536f1019af.1433364398.git.hramrach@gmail.com> In-Reply-To: <8fc4b9f5291a509c4c35782a1337bf536f1019af.1433364398.git.hramrach@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201506040103.09555.marex@denx.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2381 Lines: 53 On Wednesday, June 03, 2015 at 11:26:41 PM, Michal Suchanek wrote: > On sunxi the SPI controller currently does not have DMA support and fails > any transfer larger than 63 bytes. > > On Exynos the pl330 DMA controller fails any transfer larger than 64kb > when using slower speed like 40MHz and any transfer larger than 128bytes > when running at 133MHz. This smells more like some corruption of the data on the bus or something even more obscure. > The best thing is that in both cases the controller can just lock up and > never finish potentially leaving the hardware in unusable state. > > So it is required that the m25p80 driver actively prevents doing > transfers that are too large for the current driver state on a > particular piece of hardware. > > Signed-off-by: Michal Suchanek > > -- > > Update commit message and documentation text. > --- > .../devicetree/bindings/mtd/jedec,spi-nor.txt | 6 ++++++ > drivers/mtd/devices/m25p80.c | 24 > ++++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) > > diff --git a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.txt > b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.txt index > 2bee681..4e63ae8 100644 > --- a/Documentation/devicetree/bindings/mtd/jedec,spi-nor.txt > +++ b/Documentation/devicetree/bindings/mtd/jedec,spi-nor.txt > @@ -19,6 +19,12 @@ Optional properties: > all chips and support for it can not be detected at > runtime. Refer to your chips' datasheet to check if this is supported by > your chip. > +- linux,max_tx_len : With some SPI controller drivers possible transfer > size is + limited. This may be hardware or driver bug. > + Transfer data in chunks no larger than this value. + > Using this option may severely degrade performance and > + possibly flash memory life when max_tx_len is > smaller than + flash page size (typically 256 bytes) Will we need similar patch for all other SPI slave drivers, like SPI NAND ? Best regards, Marek Vasut -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/