Input: at32psif - do not sleep in atomic context

We can't use msleep() while holding a spinlock, moreower serio's write()
method is supposed to be useable from inettrupt context. Let's do what
i8042 does and poll the status register every 50 us (with udelay).

Reported-by: Marjan Fojkar <marjan@pajkc.eu>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
Dmitry Torokhov 2009-12-14 22:47:20 -08:00
parent a61cd03827
commit e47c4f70ea

View File

@ -137,7 +137,7 @@ static int psif_write(struct serio *io, unsigned char val)
spin_lock_irqsave(&psif->lock, flags);
while (!(psif_readl(psif, SR) & PSIF_BIT(TXEMPTY)) && timeout--)
msleep(10);
udelay(50);
if (timeout >= 0) {
psif_writel(psif, THR, val);