[parisc-linux] A fix for B2k and CONFIG_PDC_CONSOLE pb

Joel Soete soete.joel at tiscali.be
Mon Jan 26 10:00:53 MST 2004


Hi Grant, Christoph,

I find a fix for this pb. I tested successfully (I reach to login with a
ttyB0 after replacing ttyS0 in inittab and telinit q :) ) on a 32bit 2.4
kernel on my b2k and a 64bit (up) [also 2.4] kernel on my N4k.

Here is its main part:
diff -NaurX dontdiff linux-2.4.24-pa0.orig/arch/parisc/kernel/firmware.c
linux-2.4.24-pa0/arch/parisc/kernel/firmware.c
--- linux-2.4.24-pa0.orig/arch/parisc/kernel/firmware.c	2003-10-02 07:30:55.000000000
+0200
+++ linux-2.4.24-pa0/arch/parisc/kernel/firmware.c	2004-01-26 16:48:23.000000000
+0100
@@ -871,15 +937,21 @@
 	int status;
 
 	/* Bail if no console input device. */
-	if (!PAGE0->mem_kbd.iodc_io)
+	if ((PAGE0->mem_cons.cl_class != CL_DUPLEX) && !PAGE0->mem_kbd.iodc_io)
 		return 0;
 	
 	/* wait for a keyboard (rs232)-input */
 	spin_lock_irqsave(&pdc_lock, flags);
-	real32_call(PAGE0->mem_kbd.iodc_io,
-		    (unsigned long)PAGE0->mem_kbd.hpa, ENTRY_IO_CIN,
-		    PAGE0->mem_kbd.spa, __pa(PAGE0->mem_kbd.dp.layers), 
-		    __pa(iodc_retbuf), 0, __pa(iodc_dbuf), 1, 0);
+	if (PAGE0->mem_cons.cl_class == CL_DUPLEX)
+		real32_call(PAGE0->mem_cons.iodc_io,
+			    (unsigned long)PAGE0->mem_cons.hpa, ENTRY_IO_CIN,
+			    PAGE0->mem_cons.spa, __pa(PAGE0->mem_cons.dp.layers), 
+			    __pa(iodc_retbuf), 0, __pa(iodc_dbuf), 1, 0);
+	else
+		real32_call(PAGE0->mem_kbd.iodc_io,
+			    (unsigned long)PAGE0->mem_kbd.hpa, ENTRY_IO_CIN,
+			    PAGE0->mem_kbd.spa, __pa(PAGE0->mem_kbd.dp.layers), 
+			    __pa(iodc_retbuf), 0, __pa(iodc_dbuf), 1, 0);
 
 	ch = *iodc_dbuf;
 	status = *iodc_retbuf;
diff -NaurX dontdiff linux-2.4.24-pa0.orig/arch/parisc/kernel/pdc_cons.c
linux-2.4.24-pa0/arch/parisc/kernel/pdc_cons.c
--- linux-2.4.24-pa0.orig/arch/parisc/kernel/pdc_cons.c	2004-01-19 07:25:46.000000000
+0100
+++ linux-2.4.24-pa0/arch/parisc/kernel/pdc_cons.c	2004-01-26 16:53:32.000000000
+0100
@@ -113,10 +112,6 @@
 		return;
 	++pdc_console_initialized;
 	
-	/* If the console is duplex then copy the COUT parameters to CIN. */
-	if (PAGE0->mem_cons.cl_class == CL_DUPLEX)
-		memcpy(&PAGE0->mem_kbd, &PAGE0->mem_cons, sizeof(PAGE0->mem_cons));
-
 	/* register the pdc console */
 	register_console(&pdc_cons);
 }
==========><==========

Can somebody else could also test it on some other platform to be sure I
don't broken other stuff?

Thanks in advance,
    Joel

PS: Grant I join the text file of the final backport of 2.6 work included
this patch. Thanks in advance for your attention

-------------------------------------------------------------------------
Tiscali ADSL: 12 mois à 29,50 €/mois! L'Internet rapide, c'est pour tout
le monde.
http://reg.tiscali.be/default.asp?lg=fr


-------------- next part --------------
A non-text attachment was scrubbed...
Name: pdc_console-bp+patch.diff
Type: application/octet-stream
Size: 23324 bytes
Desc: not available
Url : http://lists.parisc-linux.org/pipermail/parisc-linux/attachments/20040126/67438867/pdc_console-bppatch-0001.obj


More information about the parisc-linux mailing list