[PATCH 2/2] parisc: Fix kgdb keyboard input in pdc early console driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit 027c3d345e2a ("parisc: Convert PDC console to an early console")
broke (physical) keyboard input for kgdb due to the spinlocks used in
the PDC console function.
Fix it by using using PDC calls which are not protected by spinlocks.

Fixes: 027c3d345e2a ("parisc: Convert PDC console to an early console")
Signed-off-by: Helge Deller <deller@xxxxxx>
---
 arch/parisc/kernel/pdc_cons.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c
index 7d0989f523d0..bb498c6d51c2 100644
--- a/arch/parisc/kernel/pdc_cons.c
+++ b/arch/parisc/kernel/pdc_cons.c
@@ -12,29 +12,19 @@
 #include <asm/page.h>		/* for PAGE0 */
 #include <asm/pdc.h>		/* for iodc_call() proto and friends */

-static DEFINE_SPINLOCK(pdc_console_lock);
-
 static void pdc_console_write(struct console *co, const char *s, unsigned count)
 {
 	int i = 0;
-	unsigned long flags;

-	spin_lock_irqsave(&pdc_console_lock, flags);
 	do {
 		i += pdc_iodc_print(s + i, count - i);
 	} while (i < count);
-	spin_unlock_irqrestore(&pdc_console_lock, flags);
 }

 #ifdef CONFIG_KGDB
 static int kgdb_pdc_read_char(void)
 {
-	int c;
-	unsigned long flags;
-
-	spin_lock_irqsave(&pdc_console_lock, flags);
-	c = pdc_iodc_getc();
-	spin_unlock_irqrestore(&pdc_console_lock, flags);
+	int c = pdc_iodc_getc_unlocked();

 	return (c <= 0) ? NO_POLL_CHAR : c;
 }
@@ -42,7 +32,7 @@ static int kgdb_pdc_read_char(void)
 static void kgdb_pdc_write_char(u8 chr)
 {
 	if (PAGE0->mem_cons.cl_class != CL_DUPLEX)
-		pdc_console_write(NULL, &chr, 1);
+		pdc_iodc_print_unlocked(&chr, 1);
 }

 static struct kgdb_io kgdb_pdc_io_ops = {
--
2.38.1




[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux