From: Andrew Morton <akpm@linux-foundation.org>
To: unsik Kim <donari75@gmail.com>
Cc: axboe@kernel.dk, tj@kernel.org, linux-kernel@vger.kernel.org,
donari75@gmail.com
Subject: Re: [PATCH 1/2] mg_disk: remove prohibited sleep operation
Date: Mon, 27 Jul 2009 14:32:56 -0700 [thread overview]
Message-ID: <20090727143256.8b99ced7.akpm@linux-foundation.org> (raw)
In-Reply-To: <1248325066-4071-1-git-send-email-donari75@gmail.com>
On Thu, 23 Jul 2009 13:57:45 +0900
unsik Kim <donari75@gmail.com> wrote:
> mflash's polling driver operate in standard request_fn_proc's context,
> sleep in this isn't permitted.
> Signed-off-by: unsik Kim <donari75@gmail.com>
> ---
> drivers/block/mg_disk.c | 2 --
> 1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c
> index 64f90f5..26371d5 100644
> --- a/drivers/block/mg_disk.c
> +++ b/drivers/block/mg_disk.c
> @@ -244,8 +244,6 @@ static unsigned int mg_wait(struct mg_host *host, u32 expect, u32 msec)
> mg_dump_status("not ready", status, host);
> return MG_ERR_INV_STAT;
> }
> - if (prv_data->use_polling)
> - msleep(1);
>
> status = inb((unsigned long)host->dev_base + MG_REG_STATUS);
> } while (time_before(cur_jiffies, expire));
This change has the potential to cause the driver to use much much more
CPU time and power. Are you really sure that the driver is optimal in
this area?
On possibility is to pass a flag into mg_wait() telling it whether it
is permitted to sleep:
if (may_sleep && prv_data->use_polling)
msleep(1);
else
mdelay(1);
or
if (may_sleep && prv_data->use_polling)
msleep(1);
else
/* nothing */;
so that then we only consume extra power if the caller is the
request_fn handler.
prev parent reply other threads:[~2009-07-27 21:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-23 4:57 [PATCH 1/2] mg_disk: remove prohibited sleep operation unsik Kim
2009-07-23 4:57 ` [PATCH 2/2] mg_disk: fix reading invalid status when use polling driver unsik Kim
2009-07-27 21:32 ` Andrew Morton [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=20090727143256.8b99ced7.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=donari75@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@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 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.