From: Andrew Ruder <andy@aeruder.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH RESEND-WITH-JUSTIFICATION] spi: soft_spi: Support NULL din/dout buffers
Date: Thu, 10 Apr 2014 14:17:09 -0500 [thread overview]
Message-ID: <20140410191709.GB8007@gmail.com> (raw)
In-Reply-To: <CAD6G_RQGZBn+bKUL_dpmLPuWssJ4GQpvgmKJkOmRrnfEVeL4XQ@mail.gmail.com>
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
next prev parent reply other threads:[~2014-04-10 19:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-10 16:19 [U-Boot] [PATCH RESEND-WITH-JUSTIFICATION] spi: soft_spi: Support NULL din/dout buffers Andrew Ruder
2014-04-10 18:41 ` Andrew Ruder
2014-04-10 18:54 ` Jagan Teki
2014-04-10 18:57 ` Andrew Ruder
2014-04-10 19:03 ` Jagan Teki
2014-04-10 19:17 ` Andrew Ruder [this message]
2014-04-14 16:07 ` Jagan Teki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140410191709.GB8007@gmail.com \
--to=andy@aeruder.net \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox