From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: santosh prasad nayak <santoshprasadnayak@gmail.com>
Cc: FlorianSchandinat@gmx.de, linux-fbdev@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] Video : Amba: Use in_interrupt() in clcdfb_sleep().
Date: Sun, 11 Mar 2012 17:05:51 +0000 [thread overview]
Message-ID: <20120311170551.GF13336@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <CAOD=uF6sckygJf+76jY65N1-0BSD4E6VYf0KcZAQpyNmtxi_+A@mail.gmail.com>
On Sun, Mar 11, 2012 at 10:27:12PM +0530, santosh prasad nayak wrote:
> Russel,
>
> Is this what you want ?
>
> static inline void clcdfb_sleep(unsigned int ms)
> {
> - if (in_atomic()) {
> mdelay(ms);
> - } else {
> - msleep(ms);
> - }
> }
"want" is a strong word - I would not say "want" because I don't want the
system busy-spinning for 20ms at a time during normal blank and unblank
events preventing any other thread in the system from running.
Looking at do_unblank_screen() in drivers/tty/vt/vt.c:
/*
* Called by timer as well as from vt_console_driver
*/
void do_unblank_screen(int leaving_gfx)
{
struct vc_data *vc;
/* This should now always be called from a "sane" (read: can schedule)
* context for the sake of the low level drivers, except in the special
* case of oops_in_progress
*/
if (!oops_in_progress)
might_sleep();
There may be another option of changing in_atomic() to be oops_in_progress()
if that comment is to be believed. However, that comment conflicts with
the comment immediately above the function. That said, the code is more
authorative than the comment above it because if that comment were true,
we'd see might_sleep() warnings.
So, I suspect:
static inline void clcdfb_sleep(unsigned int ms)
{
- if (in_atomic()) {
+ if (oops_in_progress) {
mdelay(ms);
} else {
msleep(ms);
is about the best that can be hoped for.
However, I think framebuffer people need to comment about what contexts
a framebuffer driver's fb_blank method would be called from (including
when oops-dumping.)
next prev parent reply other threads:[~2012-03-11 17:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-11 13:26 [PATCH] Video : Amba: Use in_interrupt() in clcdfb_sleep() santosh nayak
2012-03-11 13:22 ` richard -rw- weinberger
2012-03-11 13:27 ` Russell King - ARM Linux
2012-03-11 14:29 ` santosh prasad nayak
2012-03-11 14:36 ` Russell King - ARM Linux
2012-03-11 14:49 ` santosh prasad nayak
2012-03-11 15:03 ` Russell King - ARM Linux
2012-03-11 15:31 ` santosh prasad nayak
2012-03-11 15:48 ` Russell King - ARM Linux
2012-03-11 16:49 ` santosh prasad nayak
2012-03-11 16:42 ` Russell King - ARM Linux
2012-03-11 16:58 ` santosh prasad nayak
2012-03-11 17:05 ` Russell King - ARM Linux [this message]
2012-03-11 18:24 ` Alan Cox
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=20120311170551.GF13336@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=FlorianSchandinat@gmx.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=santoshprasadnayak@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).