* [PATCH] Fix SCI console output
@ 2009-06-01 3:53 SUGIOKA Toshinobu
2009-06-01 4:59 ` Paul Mundt
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: SUGIOKA Toshinobu @ 2009-06-01 3:53 UTC (permalink / raw)
To: linux-sh
Fix SCI transmission sequence in console output function.
Signed-off-by: Toshinobu Sugioka <sugioka@itonet.co.jp>
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index fa4d52a..a4cf107 100644
--- a/drivers/serial/sh-sci.c
+++ b/drivers/serial/sh-sci.c
@@ -151,9 +151,8 @@ static void sci_poll_put_char(struct uart_port *port, unsigned char c)
status = sci_in(port, SCxSR);
} while (!(status & SCxSR_TDxE(port)));
- sci_in(port, SCxSR); /* Dummy read */
- sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port) & ~SCxSR_TEND(port));
sci_out(port, SCxTDR, c);
+ sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port) & ~SCxSR_TEND(port));
}
#endif /* CONFIG_CONSOLE_POLL || CONFIG_SERIAL_SH_SCI_CONSOLE */
SUGIOKA Toshinobu
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] Fix SCI console output
2009-06-01 3:53 [PATCH] Fix SCI console output SUGIOKA Toshinobu
@ 2009-06-01 4:59 ` Paul Mundt
2009-06-01 11:34 ` SUGIOKA Toshinobu
2009-06-01 15:38 ` Paul Mundt
2 siblings, 0 replies; 4+ messages in thread
From: Paul Mundt @ 2009-06-01 4:59 UTC (permalink / raw)
To: linux-sh
On Mon, Jun 01, 2009 at 12:53:41PM +0900, SUGIOKA Toshinobu wrote:
> Fix SCI transmission sequence in console output function.
>
> Signed-off-by: Toshinobu Sugioka <sugioka@itonet.co.jp>
>
This change was intentional. Do you have a use case where this causes a
problem?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix SCI console output
2009-06-01 3:53 [PATCH] Fix SCI console output SUGIOKA Toshinobu
2009-06-01 4:59 ` Paul Mundt
@ 2009-06-01 11:34 ` SUGIOKA Toshinobu
2009-06-01 15:38 ` Paul Mundt
2 siblings, 0 replies; 4+ messages in thread
From: SUGIOKA Toshinobu @ 2009-06-01 11:34 UTC (permalink / raw)
To: linux-sh
At 13:59 09/06/01 +0900, Paul Mundt <lethal@linux-sh.org> wrote:
>On Mon, Jun 01, 2009 at 12:53:41PM +0900, SUGIOKA Toshinobu wrote:
>> Fix SCI transmission sequence in console output function.
>>
>> Signed-off-by: Toshinobu Sugioka <sugioka@itonet.co.jp>
>>
>This change was intentional. Do you have a use case where this causes a
>problem?
On my SH7709S board, after switching to console(SCI), output is not correct.
Linefeed code output twice, and the first character of the next line is
not seen.
Like follows.
--- console output ----
SuperH SCI(F) driver initialized
sh-sci: ttySC0 at MMIO 0xfffffe80 (irq = 25) is a sci
console handover: boot [bios0] -> real [ttySC0]
h-sci: ttySC1 at MMIO 0xa4000150 (irq = 59) is a scif
h-sci: ttySC2 at MMIO 0xa4000140 (irq = 55) is a irda
oop: module loaded
---------------------------
Atfer applying the patch, I got normal output.
According to sh7709s hardware manual, SCI tx flow-chart says
(1) wait until TDRE=1
(2) write data to TDR
(3) clear TDRE
Why did you changed the sequence ?
SUGIOKA Toshinobu
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix SCI console output
2009-06-01 3:53 [PATCH] Fix SCI console output SUGIOKA Toshinobu
2009-06-01 4:59 ` Paul Mundt
2009-06-01 11:34 ` SUGIOKA Toshinobu
@ 2009-06-01 15:38 ` Paul Mundt
2 siblings, 0 replies; 4+ messages in thread
From: Paul Mundt @ 2009-06-01 15:38 UTC (permalink / raw)
To: linux-sh
On Mon, Jun 01, 2009 at 08:34:52PM +0900, SUGIOKA Toshinobu wrote:
> At 13:59 09/06/01 +0900, Paul Mundt <lethal@linux-sh.org> wrote:
> >On Mon, Jun 01, 2009 at 12:53:41PM +0900, SUGIOKA Toshinobu wrote:
> >> Fix SCI transmission sequence in console output function.
> >>
> >> Signed-off-by: Toshinobu Sugioka <sugioka@itonet.co.jp>
> >>
> >This change was intentional. Do you have a use case where this causes a
> >problem?
>
> On my SH7709S board, after switching to console(SCI), output is not correct.
> Linefeed code output twice, and the first character of the next line is
> not seen.
>
> Like follows.
> --- console output ----
> SuperH SCI(F) driver initialized
> sh-sci: ttySC0 at MMIO 0xfffffe80 (irq = 25) is a sci
> console handover: boot [bios0] -> real [ttySC0]
>
> h-sci: ttySC1 at MMIO 0xa4000150 (irq = 59) is a scif
>
> h-sci: ttySC2 at MMIO 0xa4000140 (irq = 55) is a irda
>
> oop: module loaded
> ---------------------------
> Atfer applying the patch, I got normal output.
>
Interesting, so it seems to be a SCI issue. I've never seen that on any
SCIF or SCIFA at least.
> According to sh7709s hardware manual, SCI tx flow-chart says
> (1) wait until TDRE=1
> (2) write data to TDR
> (3) clear TDRE
>
> Why did you changed the sequence ?
>
We changed it as there is an inherent race with that sequence under QEMU,
and as no hardware seemed to have an issue with the ordering change, it
was easier to do that than try to fix up the QEMU mess. But in light of
the fact SH-3 SCI has issues, we will have to revert to the previous
ordering with your patch and give the QEMU issues a bit of a rethink.
Thanks for the report!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-06-01 15:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-01 3:53 [PATCH] Fix SCI console output SUGIOKA Toshinobu
2009-06-01 4:59 ` Paul Mundt
2009-06-01 11:34 ` SUGIOKA Toshinobu
2009-06-01 15:38 ` Paul Mundt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox