Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e47c4f70 authored by Dmitry Torokhov's avatar Dmitry Torokhov
Browse files

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: default avatarMarjan Fojkar <marjan@pajkc.eu>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent a61cd038
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);