[PATCH] Linux always started with 9600 8N1

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: David Miller <davem@...>
Cc: <sparclinux@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Sunday, May 27, 2007 - 12:44 pm

On May 26 2007 15:47, David Miller wrote:

Just why did no one get a kernel oops? After all, the code tried to
write to constant memory.

This is the first patch of two. There is yet another section of Linux 
code that runs in 9600-only, and I need to figure out which.

---

The Linux kernel ignored the PROM's serial settings (115200,n,8,1 in
my case). This was because mode_prop remained "ttyX-mode" (expected:
"ttya-mode") due to the constness of string literals when used with 
"char *". Since there is no "ttyX-mode" property in the PROM, Linux
always used the default 9600.

Signed-off-by: Jan Engelhardt <jengelh@gmx.de>

---
 drivers/serial/suncore.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: linux-2.6.21.sparc64/drivers/serial/suncore.c
===================================================================
--- linux-2.6.21.sparc64.orig/drivers/serial/suncore.c
+++ linux-2.6.21.sparc64/drivers/serial/suncore.c
@@ -30,9 +30,9 @@ void
 sunserial_console_termios(struct console *con)
 {
 	char mode[16], buf[16], *s;
-	char *mode_prop = "ttyX-mode";
-	char *cd_prop = "ttyX-ignore-cd";
-	char *dtr_prop = "ttyX-rts-dtr-off";
+	char mode_prop[] = "ttyX-mode";
+	char cd_prop[]   = "ttyX-ignore-cd";
+	char dtr_prop[]  = "ttyX-rts-dtr-off";
 	char *ssp_console_modes_prop = "ssp-console-modes";
 	int baud, bits, stop, cflag;
 	char parity;
#<EOF>
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Linux always started with 9600 8N1, Jan Engelhardt, (Sun May 27, 12:44 pm)
Re: [PATCH] Linux always started with 9600 8N1, David Miller, (Sun May 27, 5:16 pm)
Re: [PATCH] Linux always started with 9600 8N1, David Miller, (Sun May 27, 5:47 pm)
Re: [PATCH] Linux always started with 9600 8N1, Jan Engelhardt, (Tue May 29, 4:10 pm)
Re: [PATCH] Linux always started with 9600 8N1, Jan Engelhardt, (Sun May 27, 1:09 pm)