Skip to content

Commit

Permalink
Input: at32psif - do not sleep in atomic context
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Torokhov committed Dec 15, 2009
1 parent a61cd03 commit e47c4f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/input/serio/at32psif.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e47c4f7

Please sign in to comment.