Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752754AbbFDIcg (ORCPT ); Thu, 4 Jun 2015 04:32:36 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:38793 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751371AbbFDIc2 (ORCPT ); Thu, 4 Jun 2015 04:32:28 -0400 MIME-Version: 1.0 In-Reply-To: References: <8fc4b9f5291a509c4c35782a1337bf536f1019af.1433364398.git.hramrach@gmail.com> From: Michal Suchanek Date: Thu, 4 Jun 2015 10:31:45 +0200 Message-ID: Subject: Re: [PATCH 08/11] MTD: m25p80: Add option to limit SPI transfer size. To: Geert Uytterhoeven 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 , Marek Vasut , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Alison Chaiken , Huang Shijie , Ben Hutchings , Knut Wohlrab , =?UTF-8?B?QmVhbiBIdW8g6ZyN5paM5paMIChiZWFuaHVvKQ==?= , "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 , MTD Maling List , linux-spi Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1932 Lines: 55 On 4 June 2015 at 08:42, Geert Uytterhoeven wrote: > On Wed, Jun 3, 2015 at 11:26 PM, Michal Suchanek wrote: >> On sunxi the SPI controller currently does not have DMA support and fails >> any transfer larger than 63 bytes. > > This is a driver limitation, not a hardware limitation. > >> 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 may be a driver bug. > >> 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. > > OK. > > DT describes the hardware, not buggy drivers. > > So IMHO this doesn't belong in DT, but it can be a field in struct spi_master. > Unfortunately, this cannot be a field in struct spi_master. The value can and does vary with device configuration and device configuration is only available in DT. For example, on the Snow board one working configuration is 40MHz spi bus speed, feedback delay 0 and maximum transfer size 64k. Another working configuration is 133MHz bus speed, feedback delay 3, and maximum transfer size 128 bytes. You might want to try to run the bus at 60MHz or 80MHz and then the values would probably again be different. The first two values are set in DT so the logical place for setting the third is also in DT. Otherwise you would need some in-kernel table of these settings. Thanks Michal -- 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/