From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Ruder Date: Thu, 10 Apr 2014 14:17:09 -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> <20140410185759.GA8007@gmail.com> Message-ID: <20140410191709.GB8007@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:33:45AM +0530, Jagan Teki wrote: > >> 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); > OK - means issue only with soft_spi.c is it? Yes, and a couple other drivers. > Can you share the issue log or typical use case scenario w.r.t soft_spi.c, > I need to understand how this got resolved with your change. Yes, you actually posted one such case that will not work "correctly" with soft_spi. In the line of code you posted above, soft_spi will actually perform a read from address 0x0. In most cases, the read side isn't a huge deal, but on the write side it can cause all kinds of surprises. > I understand you assigned '0' when dout is NULL and you took the buf > only when din is !NULL. Yes, just handling NULL case to be how most drivers are handling it and how apparently most users of the spi modules (like mtd/spi/sf_ops) are clearly expecting it to work. - Andy