diff mbox

AT32AP700X PS/2 controller (PSIF): remove msleep call from atomic context

Message ID 4B24EB45.2020708@pajkc.eu (mailing list archive)
State New, archived
Headers show

Commit Message

Marjan Fojkar Dec. 13, 2009, 1:25 p.m. UTC
None
diff mbox

Patch

diff -up linux-2.6.32/drivers/input/serio/at32psif.c{.orig,}
--- linux-2.6.32/drivers/input/serio/at32psif.c.orig	2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32/drivers/input/serio/at32psif.c	2009-12-13 13:08:39.000000000 +0100
@@ -135,9 +135,12 @@  static int psif_write(struct serio *io, 
 	int retval = 0;
 
 	spin_lock_irqsave(&psif->lock, flags);
-
-	while (!(psif_readl(psif, SR) & PSIF_BIT(TXEMPTY)) && timeout--)
-		msleep(10);
+	while (!(psif_readl(psif, SR) & PSIF_BIT(TXEMPTY)) && timeout) {
+		spin_unlock_irqrestore(&psif->lock, flags);
+		while (!(psif_readl(psif, SR) & PSIF_BIT(TXEMPTY)) && timeout--)
+			msleep(10);
+		spin_lock_irqsave(&psif->lock, flags);
+	}
 
 	if (timeout >= 0) {
 		psif_writel(psif, THR, val);