Fix staircase effect on Altix serial console.
Serial console output on Altix didn't convert NL to CRNL.
Andreas.
drivers/char/sn_serial.c renamed from drivers/char/sn_serial.c.~1~ +22 -0
@@ -984,6 +984,7 @@ static void sn_sal_console_write(struct console *co, const char *s, unsigned count) { unsigned long flags; +const char *s1;BUG_ON (!sn_sal_is_asynch);
@@ -991,15 +992,36 @@ sn_sal_console_write(struct console *co,* oops, kdb, panic, etc. make sure they get it. */ if (spin_is_locked (&sn_sal_lock)) {synch_flush_xmit (); +/* Output '\r' before each '\n' */ +while ((s1 =memchr (s,'\n' , count)) !=NULL ) { + sn_func->sal_puts (s, s1 - s); + sn_func->sal_puts ("\r\n" ,2 ); + count -= s1 +1 - s; + s = s1 +1 ; + } sn_func->sal_puts (s, count); }else if (in_interrupt ()) {spin_lock_irqsave (&sn_sal_lock, flags);synch_flush_xmit ();spin_unlock_irqrestore (&sn_sal_lock, flags); +/* Output '\r' before each '\n' */ +while ((s1 =memchr (s,'\n' , count)) !=NULL ) { + sn_func->sal_puts (s, s1 - s); + sn_func->sal_puts ("\r\n" ,2 ); + count -= s1 +1 - s; + s = s1 +1 ; + } sn_func->sal_puts (s, count); }else +/* Output '\r' before each '\n' */ +while ((s1 =memchr (s,'\n' , count)) !=NULL ) { +sn_sal_write (NULL ,0 , s, s1 - s); +sn_sal_write (NULL ,0 ,"\r\n" ,2 ); + count -= s1 +1 - s; + s = s1 +1 ; + }sn_sal_write (NULL ,0 , s, count); }
Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected] SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Andreas Schwab
Andreas> Serial console output on Altix didn't convert NL to CRNL.
Somebody from SGI will have to review/OK this.
--david
Quoted 5 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Andreas Schwab
Andreas> Serial console output on Altix didn't convert NL to CRNL.
Somebody from SGI will have to review/OK this.
Andreas, on which platform and configuration did you see this problem? It appears that depending on your console configuration, the system controller will eat/convert characters. I'm trying to get it fixed properly there...
Jesse
Quoted 8 lines · [email protected] (Jesse Barnes) writes:
Quoted 5 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Andreas Schwab
Andreas> Serial console output on Altix didn't convert NL to CRNL.
Somebody from SGI will have to review/OK this.
Andreas, on which platform and configuration did you see this problem?
It's on the 8P Altix (can't remember the exact platform name).
Quoted 3 lines
It appears that depending on your console configuration, the system controller will eat/convert characters. I'm trying to get it fixed properly there...
The system controller should not change the output in any way. It's the job of the serial console write function (which is used for printk) to transform NL to CRNL, which is what I have implemented here. Note that normal serial output (which goes through the tty layer) does not exhibit this problem.
Andreas.
Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected] SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
Quoted 5 lines · Andreas Schwab
Quoted 3 lines · [email protected] (Jesse Barnes) writes:
Quoted 2 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Andreas Schwab
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Andreas> Serial console output on Altix didn't convert NL to CRNL.
Somebody from SGI will have to review/OK this.
Andreas, on which platform and configuration did you see this problem?
It's on the 8P Altix (can't remember the exact platform name).
Are you seeing the missing carriage return on output at the L1 or on a terminal connected to the serial port?
Quoted 21 lines
Quoted 3 lines
It appears that depending on your console configuration, the system controller will eat/convert characters. I'm trying to get it fixed properly there...
The system controller should not change the output in any way. It's the job of the serial console write function (which is used for printk) to transform NL to CRNL, which is what I have implemented here. Note that normal serial output (which goes through the tty layer) does not exhibit this problem.
Andreas.
Signature · 8 lines
Andreas Schwab, SuSE Labs, [email protected] SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." - To unsubscribe from this list: send the line "unsubscribe linux-ia64" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 10 lines · Robin Holt
Quoted 9 lines · Andreas Schwab
Quoted 7 lines · [email protected] (Jesse Barnes) writes:
Quoted 5 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Andreas Schwab
Andreas> Serial console output on Altix didn't convert NL to CRNL.
Somebody from SGI will have to review/OK this.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Andreas, on which platform and configuration did you see this problem?
It's on the 8P Altix (can't remember the exact platform name).
Are you seeing the missing carriage return on output at the L1 or on a terminal connected to the serial port?
I don't know how to differenciate between these two things. The serial terminal is connected to the L1 system controller.
Andreas.
Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected] SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
Quoted 14 lines · Andreas Schwab
Quoted 12 lines · Robin Holt
Quoted 11 lines · Andreas Schwab
Quoted 8 lines · [email protected] (Jesse Barnes) writes:
Quoted 5 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Andreas Schwab
Andreas> Serial console output on Altix didn't convert NL to CRNL.
Somebody from SGI will have to review/OK this.
Andreas, on which platform and configuration did you see this problem?
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
It's on the 8P Altix (can't remember the exact platform name).
Are you seeing the missing carriage return on output at the L1 or on a terminal connected to the serial port?
I don't know how to differenciate between these two things. The serial terminal is connected to the L1 system controller.
Are you connected via usb or a DB-9 serial connector?
Robin
Quoted 1 line · Robin Holt
Are you connected via usb or a DB-9 serial connector?
DB-9, I think.
Andreas.
Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected] SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
Quoted 5 lines · Andreas Schwab
Quoted 1 line · Robin Holt
Are you connected via usb or a DB-9 serial connector?
DB-9, I think.
The last time I connected to the DB-9 on the back of an Altix, I was using minicom (I think) and just changed it so it would interpret LF as CRLF. I seem to remember something like LF <--> CRLF on the line. Don't remember if that was exactly what it looked like.
Is this something that should really be done by the terminal and not the serial driver? I don't have any objections either way, but I would guess we would want to stay as close to whatever x86 linux is doing. I plead ignorance at this point.
Robin
Quoted 10 lines · Robin Holt
Quoted 5 lines · Andreas Schwab
Quoted 1 line · Robin Holt
Are you connected via usb or a DB-9 serial connector?
DB-9, I think.
The last time I connected to the DB-9 on the back of an Altix, I was using minicom (I think) and just changed it so it would interpret LF as CRLF.
This is plain wrong. Just try running a fullscreen program like vi and watch your screen being garbled.
Andreas.
Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected] SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
Quoted 2 lines · Andreas Schwab
The system controller should not change the output in any way. It's the job of the serial console write function (which is used for printk) to
Right, but I think our L2 system controller *does* molest the output (and the 2.6 console driver relies on this behavior). I've filed a bug with our system controller group to make the behavior of the L2 and L1 system controllers consistent (I believe you're using an L1), which I think is the proper fix.
Thanks,
Jesse
Quoted 9 lines · Jesse Barnes
Quoted 2 lines · Andreas Schwab
The system controller should not change the output in any way. It's the job of the serial console write function (which is used for printk) to
Right, but I think our L2 system controller *does* molest the output (and the 2.6 console driver relies on this behavior). I've filed a bug with our system controller group to make the behavior of the L2 and L1 system controllers consistent (I believe you're using an L1), which I think is the proper fix.
In case I wasn't clear: I think your patch would be ok for systems that use L1s, but would result in extra CRs for systems using L2s as their console, so we really need to fix the system controllers instead.
Thanks,
Jesse
Quoted 6 lines · [email protected] (Jesse Barnes) writes:
Quoted 2 lines · Andreas Schwab
The system controller should not change the output in any way. It's the job of the serial console write function (which is used for printk) to
Right, but I think our L2 system controller *does* molest the output (and the 2.6 console driver relies on this behavior).
This is a bug.
Quoted 3 lines
I've filed a bug with our system controller group to make the behavior of the L2 and L1 system controllers consistent (I believe you're using an L1), which I think is the proper fix.
No, it is the *wrong* thing to do. If you do stty -onlcr you should get just one NL, nothing else. It's the job of the tty layer and the serial console write function to translate NL to CRNL, nobody else should mangle the output in any way.
Andreas.
Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected] SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
Quoted 8 lines · Andreas Schwab
Quoted 3 lines
I've filed a bug with our system controller group to make the behavior of the L2 and L1 system controllers consistent (I believe you're using an L1), which I think is the proper fix.
No, it is the *wrong* thing to do. If you do stty -onlcr you should get just one NL, nothing else. It's the job of the tty layer and the serial console write function to translate NL to CRNL, nobody else should mangle the output in any way.
Right, that's why I'm saying that the l2 shouldn't mangle output, nor should the PROM. They should just pass through whatever the serial driver hands them. I think we're in agreement here?
Jesse
Quoted 5 lines · Jesse Barnes
Quoted 4 lines · Andreas Schwab
Quoted 3 lines
I've filed a bug with our system controller group to make the behavior of the L2 and L1 system controllers consistent (I believe you're using an L1), which I think is the proper fix.
Quoted 8 lines
Quoted 4 lines
No, it is the *wrong* thing to do. If you do stty -onlcr you should get just one NL, nothing else. It's the job of the tty layer and the serial console write function to translate NL to CRNL, nobody else should mangle the output in any way.
Right, that's why I'm saying that the l2 shouldn't mangle output, nor should the PROM. They should just pass through whatever the serial driver hands them. I think we're in agreement here?
Sorry, I should have been clearer: our L2 system controller will be fixed to *not* add CRs, as will our PROM, so we'll need your fix. David, can you please apply it? Sorry for the runaround.
Andreas, does that sound right?
Thanks,
Jesse
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · On Wed, 3 Mar 2004 14:21:16 -0800, [email protected] (Jesse Barnes) said:
Jesse> Sorry, I should have been clearer: our L2 system controller will be Jesse> fixed to *not* add CRs, as will our PROM, so we'll need your fix. Jesse> David, can you please apply it? Sorry for the runaround.
If Andreas resends it, sure.
--david
Quoted 1 line · [email protected] (Jesse Barnes) writes:
Andreas, does that sound right?
Yes, thanks.
Andreas.
Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected] SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."