Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754191AbbEUK27 (ORCPT ); Thu, 21 May 2015 06:28:59 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:49728 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751784AbbEUK2y (ORCPT ); Thu, 21 May 2015 06:28:54 -0400 Date: Thu, 21 May 2015 11:28:02 +0100 From: Mark Brown To: Michal Suchanek Cc: Brian Norris , 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 , Bean Huo =?utf-8?B?6ZyN5paM5paMIChiZWFuaHVvKQ==?= , "grmoore@altera.com" , devicetree , Linux Kernel Mailing List , linux-mtd@lists.infradead.org, linux-spi Message-ID: <20150521102802.GS21577@sirena.org.uk> References: <50c40ef17ab6566f35ef5a4426bf23567f896db7.1430403750.git.hramrach@gmail.com> <20150520233835.GX11598@ld-irv-0074> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="oJFDFiWc3BlD0xT/" Content-Disposition: inline In-Reply-To: X-Cookie: Positively no smoking. User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH 2/3] MTD: spi-nor: check for short writes in spi_nor_write. X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2240 Lines: 55 --oJFDFiWc3BlD0xT/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, May 21, 2015 at 10:39:13AM +0200, Michal Suchanek wrote: > On 21 May 2015 at 01:38, Brian Norris wrote: Why is this thread about SPI error handling CCed to quite so many people? > >> 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? Any such driver is buggy, the actual length transferred has always been a part of the SPI API. We should probably expose limitations so clients can query in advance (we don't at the minute) but it'd be a while before clients could rely on that information being useful and it's still possible things can be truncated by error. With modern drivers using transfer_one() where we have control of the chip select we do also have the ability to add support to the core for chopping large transfers up into smaller ones that the hardware can handle transparently. That won't for everything though since it depends on us being able to manually control the chip select which not all hardware can do. --oJFDFiWc3BlD0xT/ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJVXbMxAAoJECTWi3JdVIfQckgH/3UcOz8dIAPvrx7v+/sValdq GzoPHmzNZdEr1GfUxMUXcQwlzMSfw1SkuCqMfWn0N8Y/iaZ2RKqiDLRHGiZlqRVi P/W6wQuBj3eJ/OC8ykC3fLlqrh0F/L4WaJDFtqYMv4wNlrf2gwhJnGbNi9CkDrWY t07hORcvdoRWUtizOminZpx3cm4wIS1jbMiD7RD5YhMwS0ZAnci9PYaPf8/uJzvb LPkB/CU8KiBvAPmrRNdWg+U7lDepMsaPZg+KhdXd5Qgzx++TdviJWG4fC0HFG50O 9z2RgJ9Q9JuEYLrPcwLpyWguwukzZ2W5NfXMX16C55oMBnNRlvxyrVvVoKlZL8c= =bbmv -----END PGP SIGNATURE----- --oJFDFiWc3BlD0xT/-- -- 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/