From: Timo Herbrecher <t.herbrecher@gateware.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] mxc_spi: bugfix for double incrementing read pointer on unaligned buffers in spi_xchg_single
Date: Mon, 07 Oct 2013 08:50:16 +0200 [thread overview]
Message-ID: <525259A8.6060605@gateware.de> (raw)
If dout buffer is not 32 bit-aligned or data to transmit is not multiple
of 32 bit the read data pointer is already incremented on single byte reads.
Signed-off-by: Timo Herbrecher <t.herbrecher@gateware.de>
---
drivers/spi/mxc_spi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
index fd72a65..95dd03f 100644
--- a/drivers/spi/mxc_spi.c
+++ b/drivers/spi/mxc_spi.c
@@ -255,8 +255,8 @@ int spi_xchg_single(struct spi_slave *slave,
unsigned int bitlen,
} else {
data = *(u32 *)dout;
data = cpu_to_be32(data);
+ dout += 4;
}
- dout += 4;
}
debug("Sending SPI 0x%x\n", data);
reg_write(®s->txdata, data);
--
1.7.0.4
next reply other threads:[~2013-10-07 6:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-07 6:50 Timo Herbrecher [this message]
2013-10-07 7:24 ` [U-Boot] [PATCH v2] mxc_spi: bugfix for double incrementing read pointer on unaligned buffers in spi_xchg_single Jagan Teki
2013-10-15 5:57 ` Timo Herbrecher
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=525259A8.6060605@gateware.de \
--to=t.herbrecher@gateware.de \
--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