public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] spi: fsl_espi: Return all data read from device unmodified
Date: Sat, 12 Dec 2015 17:10:38 +0000	[thread overview]
Message-ID: <1449940311.20511.52.camel@infinera.com> (raw)
In-Reply-To: <1449886759-23994-1-git-send-email-dsmith@vtiinstruments.com>

On Fri, 2015-12-11 at 21:19 -0500, Dale P. Smith wrote:
> Signed-off-by: Dale P. Smith <dsmith@vtiinstruments.com>
> ---
> Changes for v2:
> ???- First attempt at using git format-patch
> Changes for v3:
> ???- Fix subject.
> ???- Add changelog

While this is a step in the right direction, this driver needs a rewrite.
- The malloc/memcpy crap need to go.
- TXing 4 bytes a time while while word size is still one byte makes Not full/Not empty
? HW flags useless.
There is no real maintainer of this driver though so I am afraid nobody will do make this happen.

> 
> ?drivers/spi/fsl_espi.c | 10 ++--------
> ?1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c
> index b1586d1..c84a7ea 100644
> --- a/drivers/spi/fsl_espi.c
> +++ b/drivers/spi/fsl_espi.c
> @@ -345,17 +345,11 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *data_out,
> ?				}
> ?			}
> ?		}
> -		if (data_in) {
> -			memcpy(data_in, buffer + 2 * cmd_len, tran_len);
> -			if (*buffer == 0x0b) {
> -				data_in += tran_len;
> -				data_len -= tran_len;
> -				*(int *)buffer += tran_len;
> -			}
> -		}
> ?		spi_cs_deactivate(slave);
> ?	}
> ?
> +	if (data_in)
> +		memcpy(data_in, buffer + rx_offset, len);
> ?	free(buffer);
> ?	return 0;
> ?}

  reply	other threads:[~2015-12-12 17:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-26 21:07 [U-Boot] [PATCH] FSL SPI read fix Dale Smith
2013-06-12 19:02 ` [U-Boot] " Jagan Teki
2013-06-12 21:54   ` [U-Boot] [PATCH] FSL espi: Return all data read from device unmodified Dale P. Smith
2013-06-13  2:39     ` Jagan Teki
2013-06-13  9:09       ` Albert ARIBAUD
2013-06-13  9:22         ` Jagan Teki
2015-12-12  2:19     ` [U-Boot] [PATCH v3] spi: fsl_espi: " Dale P. Smith
2015-12-12 17:10       ` Joakim Tjernlund [this message]
2015-12-14  7:01         ` 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=1449940311.20511.52.camel@infinera.com \
    --to=joakim.tjernlund@infinera.com \
    --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