All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trilok Soni <tsoni@codeaurora.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Philippe Langlais <philippe.langlais@stericsson.com>,
	linux-input@vger.kernel.org,
	STEricsson_nomadik_linux@list.st.com
Subject: Re: [PATCH] input: replace request_irq by request_any_context_irq in keyboard GPIO driver
Date: Thu, 20 Jan 2011 14:26:30 +0530	[thread overview]
Message-ID: <4D37F8BE.8040005@codeaurora.org> (raw)
In-Reply-To: <20110120081319.GC2498@core.coreip.homeip.net>

Hi Dmitry,

On 1/20/2011 1:43 PM, Dmitry Torokhov wrote:
>>>
>>> No, this it not correct. request_any_context_irq() means that you could
>>> either get a hardirq or a treaded one. However above you are changing to
>>> gpio_get_value_cansleep() which indicates that you can sleep.
>>>
>>> You need to either revert to gpio_get_value() or explicitly request
>>> threaded IRQ.
>>
>> This could be problem. Say, we are doing request_any_context_irq(..) and gpio is over slow-bus,
>> so we naturally get into the threaded code, and in the thread handler we are calling gpio_get_value(..),
>> but in this case gpio_get_value could throw a warning that we should call gpio_get_value_cansleep(...)
>> because sleep attribute is added into the gpiolib hook implementation for these gpios.
>>
>> Now suppose gpio is memory mapped and we enter into the hardirq and calling sleep variant into the 
>> handler code will be naturally bad. 
>>
>> How about checking maysleep explicitly here while using the request_any_context_irq() call though
>> the semantics of gpiolib framework discourages that. 
>>
> 
> Any drawbacks for explicitly switching to threaded IRQ and keeping
> gpio_get_value_cansleep()? (That was the 2nd option I mentioned BTW).
> 

Only drawback is that you get "dedicated thread" in case the irqs are not chained handler. In worst-case
it would introduce the latencies otherwise fine.

---Trilok Soni

-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

  reply	other threads:[~2011-01-20  8:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-12  9:41 Changes in keyboard GPIO driver Philippe Langlais
2011-01-12  9:41 ` [PATCH] input: replace request_irq by request_any_context_irq " Philippe Langlais
2011-01-20  7:53   ` Dmitry Torokhov
2011-01-20  8:00     ` Trilok Soni
2011-01-20  8:13       ` Dmitry Torokhov
2011-01-20  8:56         ` Trilok Soni [this message]
2011-01-20  9:23     ` Rabin Vincent
2011-01-20 10:04       ` Dmitry Torokhov
2011-01-20 12:14         ` Philippe Langlais
2011-01-21  7:10           ` 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=4D37F8BE.8040005@codeaurora.org \
    --to=tsoni@codeaurora.org \
    --cc=STEricsson_nomadik_linux@list.st.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=philippe.langlais@stericsson.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.