All of lore.kernel.org
 help / color / mirror / Atom feed
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 13:57:59 -0500	[thread overview]
Message-ID: <20140410185759.GA8007@gmail.com> (raw)
In-Reply-To: <CAD6G_RQYupvndgohh-dR93PM-7Q-RoPjhCLYuHr9rSxiAbZm5A@mail.gmail.com>

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

  reply	other threads:[~2014-04-10 18:57 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 [this message]
2014-04-10 19:03     ` Jagan Teki
2014-04-10 19:17       ` Andrew Ruder
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=20140410185759.GA8007@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.