Re: [PATCH] AT32AP700X PS/2 controller (PSIF): remove msleep call from atomic context

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

 



On Sun, 13 Dec 2009 20:49:37 -0800
Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx> wrote:

> Hi Martin,
> 
> On Sun, Dec 13, 2009 at 02:25:25PM +0100, Marjan Fojkar wrote:
> > From: Marjan Fojkar <marjan@xxxxxxxx>
> > 
> > The patch removes msleep call from atomic context. To achieve that, the driver
> > PSIF leaves atomic context before the call in order to enable interrupts to be
> > performed safely. When the call is done, the driver jumps back to atomic context.
> > 
> 
> Yes, msleep is not allowed in atomic context, however serio's write()
> method is supposed to be callable from atomic context so msleep is not
> available there period. I scanned the datasheet quickly and did not see
> any restriction on the frequency of reading status register so I think
> we should do what i8042 driver does - udelay(50).
> 

Sure udelay(50) will work fine, you can poll the registers as fast as
you would like. Only disadvantage with udelay is that it will block all
other threads. But I would guess that most of the times a character
should be sent to the peripheral, the hardware will be ready since the
speed is quite low bandwidth.

-- 
Best regards,
Hans-Christian Egtvedt
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux