Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946296AbbEVJhm (ORCPT ); Fri, 22 May 2015 05:37:42 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:51290 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946188AbbEVJhd (ORCPT ); Fri, 22 May 2015 05:37:33 -0400 Date: Fri, 22 May 2015 10:37:14 +0100 From: Mark Brown To: Brian Norris Cc: Michal Suchanek , linux-sunxi , Marek Vasut , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , Alison Chaiken , Mika Westerberg , Bean Huo =?utf-8?B?6ZyN5paM5paMIChiZWFuaHVvKQ==?= , Linux Kernel Mailing List , linux-mtd@lists.infradead.org, linux-spi Message-ID: <20150522093714.GS21577@sirena.org.uk> References: <50c40ef17ab6566f35ef5a4426bf23567f896db7.1430403750.git.hramrach@gmail.com> <20150520233835.GX11598@ld-irv-0074> <20150521102802.GS21577@sirena.org.uk> <20150522071727.GD23718@brian-ubuntu> <20150522072505.GE23718@brian-ubuntu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="AQfDLMJ/cCCv3UHO" Content-Disposition: inline In-Reply-To: <20150522072505.GE23718@brian-ubuntu> 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: 2007 Lines: 55 --AQfDLMJ/cCCv3UHO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, May 22, 2015 at 12:25:05AM -0700, Brian Norris wrote: > On Fri, May 22, 2015 at 12:17:27AM -0700, Brian Norris wrote: > > Admittedly, as he's using an out-of-tree driver, I'm not > > sure I know exactly what failure modes he is hitting yet. > Sorry, I realized I misread here. He's using spi-sunxi. Given that... > ... is this code even valid? > static int sun6i_spi_transfer_one(struct spi_master *master, > struct spi_device *spi, > struct spi_transfer *tfr) > { > ... > /* We don't support transfer larger than the FIFO */ > if (tfr->len > SUN6I_FIFO_DEPTH) > return -EINVAL; > Seems like it should be looping over the transfer in multiple chunks > instead. Well, it's not ideal. Like I say I think that logic probably belongs in the core rather than individual drivers then we minimise the problems, if I remember correctly there was the suggestion that the DMA code was going to follow soon and be used for larger transfers when the original driver was merged. --AQfDLMJ/cCCv3UHO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJVXvjJAAoJECTWi3JdVIfQaSMH/jcYW5zz4KoR209QACLlBE9R dSf+j7WUOpAKX/fXyU7u/MwMISocZoS3+ymw1H368BAuuTfSoZp8qCeNsV1+6Dbv sT1jgxE5+niNoKoU5arXoRdZVWqVrTLm2GlFRbwk3g4GZ3vrhXVQOsPZ5u6P73Qm wn2slFx8CW1ytlk7uppXjDgrwJ0ri1kcNUZmqQOgOYNRYFaBUhuY5/i3QsLmuqEo Onhymrjo7EnGDKdRchfXK0805Zq39+LbCkf1vvzoa1iFFaLS8gWUMERm3zKhIYF4 EWq7B+mvBZf3HfSQbRDMiBKjGJTJ2OFAVzPvqgu/EaYPrFwlYbuAjuKa5GVZaHY= =Xb3c -----END PGP SIGNATURE----- --AQfDLMJ/cCCv3UHO-- -- 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/