From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Ruder Date: Thu, 10 Apr 2014 13:57:59 -0500 Subject: [U-Boot] [PATCH RESEND-WITH-JUSTIFICATION] spi: soft_spi: Support NULL din/dout buffers In-Reply-To: References: <1397146782-28966-1-git-send-email-andrew.ruder@elecsyscorp.com> Message-ID: <20140410185759.GA8007@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, Apr 11, 2014 at 12:24:20AM +0530, Jagan Teki wrote: > At-least from zynq_spi.c case - I wouldn't find that obscure case as you pointed > and even with dout NULL which is status poll from (sf_ops.c). zynq_spi is correct, soft_spi is not. zynq_spi.c: int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout, void *din, unsigned long flags) { const u8 *tx_buf = dout; u8 *rx_buf = din, buf; [...] if (tx_buf) buf = *tx_buf++; else buf = 0; [...] if (rx_buf) *rx_buf++ = buf; [...] > It would be great if you mentioned issue scenario for status poll case > drivers/mtd/spi/sf_ops.c: ret = spi_xfer(spi, 8, NULL, > &status, 0); That breaks on soft_spi, hence the patch. Cheers, Andy