Linux Input/HID development
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Marjan Fojkar <marjan@pajkc.eu>
Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.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 11:51:22 -0800	[thread overview]
Message-ID: <20091219195121.GA4073@core.coreip.homeip.net> (raw)
In-Reply-To: <4B2CBFBC.2000500@pajkc.eu>

On Sat, Dec 19, 2009 at 12:57:48PM +0100, Marjan Fojkar wrote:
> 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? :)
> 

Yep, it is upstream now.

-- 
Dmitry

      reply	other threads:[~2009-12-19 19:51 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
2009-12-19 19:51       ` Dmitry Torokhov [this message]

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=20091219195121.GA4073@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=hans-christian.egtvedt@atmel.com \
    --cc=kernel@avr32linux.org \
    --cc=linux-input@vger.kernel.org \
    --cc=marjan@pajkc.eu \
    /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