public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] mxc_spi: bugfix for double incrementing read pointer on unaligned buffers in spi_xchg_single
@ 2013-10-07  6:50 Timo Herbrecher
  2013-10-07  7:24 ` Jagan Teki
  0 siblings, 1 reply; 3+ messages in thread
From: Timo Herbrecher @ 2013-10-07  6:50 UTC (permalink / raw)
  To: u-boot

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(&regs->txdata, data);
--
1.7.0.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH v2] mxc_spi: bugfix for double incrementing read pointer on unaligned buffers in spi_xchg_single
  2013-10-07  6:50 [U-Boot] [PATCH v2] mxc_spi: bugfix for double incrementing read pointer on unaligned buffers in spi_xchg_single Timo Herbrecher
@ 2013-10-07  7:24 ` Jagan Teki
  2013-10-15  5:57   ` Timo Herbrecher
  0 siblings, 1 reply; 3+ messages in thread
From: Jagan Teki @ 2013-10-07  7:24 UTC (permalink / raw)
  To: u-boot

Did you test this on u-boot-spi.git with master-probe branch?

On Mon, Oct 7, 2013 at 12:20 PM, Timo Herbrecher
<t.herbrecher@gateware.de> wrote:
> 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(&regs->txdata, data);
> --
> 1.7.0.4
>
>



-- 
Thanks,
Jagan.
--------
Jagannadha Sutradharudu Teki,
E: jagannadh.teki at gmail.com, P: +91-9676773388
Engineer - System Software Hacker
U-boot - SPI Custodian and Zynq APSOC
Ln: http://www.linkedin.com/in/jaganteki

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH v2] mxc_spi: bugfix for double incrementing read pointer on unaligned buffers in spi_xchg_single
  2013-10-07  7:24 ` Jagan Teki
@ 2013-10-15  5:57   ` Timo Herbrecher
  0 siblings, 0 replies; 3+ messages in thread
From: Timo Herbrecher @ 2013-10-15  5:57 UTC (permalink / raw)
  To: u-boot

Yes I tested it on the master-probe branch of u-boot-spi.git.


Am 7.10.2013 09:24, schrieb Jagan Teki:
> Did you test this on u-boot-spi.git with master-probe branch?
> 
> On Mon, Oct 7, 2013 at 12:20 PM, Timo Herbrecher
> <t.herbrecher@gateware.de> wrote:
>> 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(&regs->txdata, data);
>> --
>> 1.7.0.4
>>
>>
> 
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-15  5:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-07  6:50 [U-Boot] [PATCH v2] mxc_spi: bugfix for double incrementing read pointer on unaligned buffers in spi_xchg_single Timo Herbrecher
2013-10-07  7:24 ` Jagan Teki
2013-10-15  5:57   ` Timo Herbrecher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox