diff mbox

[2/2] spi: rspi: Fix typo when clearing SPSR_OVRF

Message ID 1387823664-32318-2-git-send-email-geert+renesas@linux-m68k.org (mailing list archive)
State Accepted
Commit df900e678308d7fa1290681bfc336716b084b3c5
Headers show

Commit Message

Geert Uytterhoeven Dec. 23, 2013, 6:34 p.m. UTC
The overrun flag should be cleared in the SPI Status Register, not in the
SPI Control Register, based on the SDK sample code.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
---
 drivers/spi/spi-rspi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Horman Dec. 24, 2013, 2:59 a.m. UTC | #1
On Mon, Dec 23, 2013 at 07:34:24PM +0100, Geert Uytterhoeven wrote:
> The overrun flag should be cleared in the SPI Status Register, not in the
> SPI Control Register, based on the SDK sample code.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>

I don't believe that I have access to the sample code,
but I do trust your judgement.

Acked-by: Simon Horman <horms+renesas@verge.net.au>

> ---
>  drivers/spi/spi-rspi.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
> index 9e0301014f48..b04835d809f5 100644
> --- a/drivers/spi/spi-rspi.c
> +++ b/drivers/spi/spi-rspi.c
> @@ -517,7 +517,7 @@ static void rspi_receive_init(struct rspi_data *rspi)
>  		rspi_read16(rspi, RSPI_SPDR);	/* dummy read */
>  	if (spsr & SPSR_OVRF)
>  		rspi_write8(rspi, rspi_read8(rspi, RSPI_SPSR) & ~SPSR_OVRF,
> -			    RSPI_SPCR);
> +			    RSPI_SPSR);
>  }
>  
>  static int rspi_receive_pio(struct rspi_data *rspi, struct spi_message *mesg,
> -- 
> 1.7.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Geert Uytterhoeven Dec. 24, 2013, 9:26 a.m. UTC | #2
On Tue, Dec 24, 2013 at 3:59 AM, Simon Horman <horms@verge.net.au> wrote:
> On Mon, Dec 23, 2013 at 07:34:24PM +0100, Geert Uytterhoeven wrote:
>> The overrun flag should be cleared in the SPI Status Register, not in the
>> SPI Control Register, based on the SDK sample code.
>>
>> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
>
> I don't believe that I have access to the sample code,
> but I do trust your judgement.

It's in the public RZLSP-V1.0.1 for RZ/A1H, available from
https://oss.renesas.com/. Oh, today a new version got released.

The issue is quite obvious: after clearing the bit, the new value should
be written back to the same register.

However, the fix is not in a v3.10-rc6 version I saw, so this may matter
for LTSI.

> Acked-by: Simon Horman <horms+renesas@verge.net.au>

Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Simon Horman Dec. 27, 2013, 2:16 a.m. UTC | #3
On Tue, Dec 24, 2013 at 10:26:17AM +0100, Geert Uytterhoeven wrote:
> On Tue, Dec 24, 2013 at 3:59 AM, Simon Horman <horms@verge.net.au> wrote:
> > On Mon, Dec 23, 2013 at 07:34:24PM +0100, Geert Uytterhoeven wrote:
> >> The overrun flag should be cleared in the SPI Status Register, not in the
> >> SPI Control Register, based on the SDK sample code.
> >>
> >> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> >
> > I don't believe that I have access to the sample code,
> > but I do trust your judgement.
> 
> It's in the public RZLSP-V1.0.1 for RZ/A1H, available from
> https://oss.renesas.com/. Oh, today a new version got released.

Thanks, I was not aware of that.

> 
> The issue is quite obvious: after clearing the bit, the new value should
> be written back to the same register.
> 
> However, the fix is not in a v3.10-rc6 version I saw, so this may matter
> for LTSI.

I believe that the LTSI-3.10 work from Renesas (so far mainly me) is
independent of the sample code at the link above. So unless this fix ends
up in v3.10 -stable, which should feed into LTSI-3.10, then it will need to
be submitted to LTSI (probably be me or you) if we want it to be in LTSI.

> 
> > Acked-by: Simon Horman <horms+renesas@verge.net.au>
> 
> Thanks!
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Geert Uytterhoeven Jan. 9, 2014, 9:41 a.m. UTC | #4
Hi Simon,

On Fri, Dec 27, 2013 at 3:16 AM, Simon Horman <horms@verge.net.au> wrote:
> On Tue, Dec 24, 2013 at 10:26:17AM +0100, Geert Uytterhoeven wrote:
>> On Tue, Dec 24, 2013 at 3:59 AM, Simon Horman <horms@verge.net.au> wrote:
>> > On Mon, Dec 23, 2013 at 07:34:24PM +0100, Geert Uytterhoeven wrote:
>> >> The overrun flag should be cleared in the SPI Status Register, not in the
>> >> SPI Control Register, based on the SDK sample code.
>> >>
>> >> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
>>
>> The issue is quite obvious: after clearing the bit, the new value should
>> be written back to the same register.
>>
>> However, the fix is not in a v3.10-rc6 version I saw, so this may matter
>> for LTSI.
>
> I believe that the LTSI-3.10 work from Renesas (so far mainly me) is
> independent of the sample code at the link above. So unless this fix ends
> up in v3.10 -stable, which should feed into LTSI-3.10, then it will need to
> be submitted to LTSI (probably be me or you) if we want it to be in LTSI.

According to the documentation, this bit is valid only in SPI slave mode.
As Linux supports SPI master mode only, this looks like a purely cosmetical
issue to me, so it doesn't warrant applying to -stable or LTSI-3.10.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Simon Horman Jan. 10, 2014, 12:49 a.m. UTC | #5
On Thu, Jan 09, 2014 at 10:41:55AM +0100, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Fri, Dec 27, 2013 at 3:16 AM, Simon Horman <horms@verge.net.au> wrote:
> > On Tue, Dec 24, 2013 at 10:26:17AM +0100, Geert Uytterhoeven wrote:
> >> On Tue, Dec 24, 2013 at 3:59 AM, Simon Horman <horms@verge.net.au> wrote:
> >> > On Mon, Dec 23, 2013 at 07:34:24PM +0100, Geert Uytterhoeven wrote:
> >> >> The overrun flag should be cleared in the SPI Status Register, not in the
> >> >> SPI Control Register, based on the SDK sample code.
> >> >>
> >> >> Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
> >>
> >> The issue is quite obvious: after clearing the bit, the new value should
> >> be written back to the same register.
> >>
> >> However, the fix is not in a v3.10-rc6 version I saw, so this may matter
> >> for LTSI.
> >
> > I believe that the LTSI-3.10 work from Renesas (so far mainly me) is
> > independent of the sample code at the link above. So unless this fix ends
> > up in v3.10 -stable, which should feed into LTSI-3.10, then it will need to
> > be submitted to LTSI (probably be me or you) if we want it to be in LTSI.
> 
> According to the documentation, this bit is valid only in SPI slave mode.
> As Linux supports SPI master mode only, this looks like a purely cosmetical
> issue to me, so it doesn't warrant applying to -stable or LTSI-3.10.

Thanks for the clarification.
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
index 9e0301014f48..b04835d809f5 100644
--- a/drivers/spi/spi-rspi.c
+++ b/drivers/spi/spi-rspi.c
@@ -517,7 +517,7 @@  static void rspi_receive_init(struct rspi_data *rspi)
 		rspi_read16(rspi, RSPI_SPDR);	/* dummy read */
 	if (spsr & SPSR_OVRF)
 		rspi_write8(rspi, rspi_read8(rspi, RSPI_SPSR) & ~SPSR_OVRF,
-			    RSPI_SPCR);
+			    RSPI_SPSR);
 }
 
 static int rspi_receive_pio(struct rspi_data *rspi, struct spi_message *mesg,