From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: linux-ide@vger.kernel.org
Subject: Re: [PATCH 4/6] ide: add ide_busy_sleep() helper
Date: Tue, 04 Dec 2007 15:32:49 +0300 [thread overview]
Message-ID: <475548F1.6040308@ru.mvista.com> (raw)
In-Reply-To: <200712032252.53249.bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz wrote:
> Add ide_busy_sleep() helper and use it in do_probe(),
> enable_nest() and probe_hwif().
> As a nice side-effect this fixes a minor bug in enable_nest()
> (the code was reading status register without any delay).
Huh?
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
> Index: b/drivers/ide/ide-probe.c
> ===================================================================
> --- a/drivers/ide/ide-probe.c
> +++ b/drivers/ide/ide-probe.c
[...]
> @@ -489,20 +499,16 @@ static int do_probe (ide_drive_t *drive,
> static void enable_nest (ide_drive_t *drive)
> {
> ide_hwif_t *hwif = HWIF(drive);
> - unsigned long timeout;
>
> printk("%s: enabling %s -- ", hwif->name, drive->id->model);
> SELECT_DRIVE(drive);
> msleep(50);
> hwif->OUTB(EXABYTE_ENABLE_NEST, IDE_COMMAND_REG);
> - timeout = jiffies + WAIT_WORSTCASE;
> - do {
> - if (time_after(jiffies, timeout)) {
> - printk("failed (timeout)\n");
> - return;
> - }
> - msleep(50);
Here's a delay, isn't it?
> - } while ((hwif->INB(IDE_STATUS_REG)) & BUSY_STAT);
> +
> + if (ide_busy_sleep(hwif)) {
> + printk(KERN_CONT "failed (timeout)\n");
> + return;
> + }
>
> msleep(50);
MBR, Sergei
next prev parent reply other threads:[~2007-12-04 12:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-03 21:52 [PATCH 4/6] ide: add ide_busy_sleep() helper Bartlomiej Zolnierkiewicz
2007-12-04 12:32 ` Sergei Shtylyov [this message]
2007-12-04 14:01 ` Bartlomiej Zolnierkiewicz
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=475548F1.6040308@ru.mvista.com \
--to=sshtylyov@ru.mvista.com \
--cc=bzolnier@gmail.com \
--cc=linux-ide@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;
as well as URLs for NNTP newsgroup(s).