From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Suchanek Subject: Re: [PATCH 2/3] MTD: spi-nor: check for short writes in spi_nor_write. Date: Thu, 21 May 2015 10:39:13 +0200 Message-ID: References: <50c40ef17ab6566f35ef5a4426bf23567f896db7.1430403750.git.hramrach@gmail.com> <20150520233835.GX11598@ld-irv-0074> Reply-To: hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: <20150520233835.GX11598@ld-irv-0074> List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , To: Brian Norris Cc: linux-sunxi , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , David Woodhouse , Marek Vasut , Huang Shijie , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Ben Hutchings , Alison Chaiken , Mika Westerberg , =?UTF-8?B?QmVhbiBIdW8g6ZyN5paM5paMIChiZWFuaHVvKQ==?= , "grmoore-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org" , devicetree , Linux Kernel Mailing List , linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-spi , Mark Brown List-Id: devicetree@vger.kernel.org On 21 May 2015 at 01:38, Brian Norris wrote: > + linux-spi, Mark > > On Thu, Apr 30, 2015 at 03:38:50PM +0200, Michal Suchanek wrote: >> My SPI controller driver does not support DMA so writes are truncated to >> FIFO size. > > Which SPI master driver? I am using sunxi SPI driver. The dmaengine support for sunxi is not yet in mainline kernel so the SPI master functionality is limited. > >> Check the amount of data actually written by the driver. > > I'm not sure if we should just reactively use the retlen, or if we > should be communicating such a limitation via the SPI API. Thoughts? > Is there any driver that would break if the SPI master truncated writes when the message is too long rather than returning an error an refusing the transfer? m25p80 as is would because it assumes all data is always written. Some display driver I tried earlier has an option to limit transfer size actively in the driver. Thanks Michal