Linux Input/HID development
 help / color / mirror / Atom feed
From: Marjan Fojkar <marjan@pajkc.eu>
To: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org,
	kernel@avr32linux.org
Subject: Re: [PATCH] AT32AP700X PS/2 controller (PSIF): remove msleep call from atomic context
Date: Sat, 19 Dec 2009 12:57:48 +0100	[thread overview]
Message-ID: <4B2CBFBC.2000500@pajkc.eu> (raw)
In-Reply-To: <20091214083016.35d00091@hcegtvedt.norway.atmel.com>

Hans-Christian Egtvedt wrote:
> On Sun, 13 Dec 2009 20:49:37 -0800
> Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> 
>> Hi Martin,
>>
>> On Sun, Dec 13, 2009 at 02:25:25PM +0100, Marjan Fojkar wrote:
>>> From: Marjan Fojkar <marjan@pajkc.eu>
>>>
>>> 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.
> 

So, the final conclusion is udelay(50), I presume? :)


  reply	other threads:[~2009-12-19 11:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-13 13:25 [PATCH] AT32AP700X PS/2 controller (PSIF): remove msleep call from atomic context Marjan Fojkar
2009-12-14  4:49 ` Dmitry Torokhov
2009-12-14  7:30   ` Hans-Christian Egtvedt
2009-12-19 11:57     ` Marjan Fojkar [this message]
2009-12-19 19:51       ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B2CBFBC.2000500@pajkc.eu \
    --to=marjan@pajkc.eu \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hans-christian.egtvedt@atmel.com \
    --cc=kernel@avr32linux.org \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox