* [PATCH 12/20] ide: use wait_drive_not_busy() in drive_cmd_intr()
@ 2007-12-09 21:15 Bartlomiej Zolnierkiewicz
2007-12-10 13:02 ` Sergei Shtylyov
0 siblings, 1 reply; 3+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2007-12-09 21:15 UTC (permalink / raw)
To: linux-ide
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-io.c | 4 +---
drivers/ide/ide-taskfile.c | 2 +-
include/linux/ide.h | 2 ++
3 files changed, 4 insertions(+), 4 deletions(-)
Index: b/drivers/ide/ide-io.c
===================================================================
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -640,7 +640,6 @@ static ide_startstop_t drive_cmd_intr (i
ide_hwif_t *hwif = HWIF(drive);
u8 *args = (u8 *) rq->buffer;
u8 stat = hwif->INB(IDE_STATUS_REG);
- int retries = 10;
local_irq_enable_in_hardirq();
if (rq->cmd_type == REQ_TYPE_ATA_CMD &&
@@ -649,8 +648,7 @@ static ide_startstop_t drive_cmd_intr (i
drive->io_32bit = 0;
hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS);
drive->io_32bit = io_32bit;
- while (((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) && retries--)
- udelay(100);
+ stat = wait_drive_not_busy(drive);
}
if (!OK_STAT(stat, READY_STAT, BAD_STAT))
Index: b/drivers/ide/ide-taskfile.c
===================================================================
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -260,7 +260,7 @@ static ide_startstop_t task_no_data_intr
return ide_stopped;
}
-static u8 wait_drive_not_busy(ide_drive_t *drive)
+u8 wait_drive_not_busy(ide_drive_t *drive)
{
ide_hwif_t *hwif = HWIF(drive);
int retries;
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -994,6 +994,8 @@ ide_startstop_t do_rw_taskfile(ide_drive
void task_end_request(ide_drive_t *, struct request *, u8);
+u8 wait_drive_not_busy(ide_drive_t *);
+
int ide_raw_taskfile(ide_drive_t *, ide_task_t *, u8 *, u16);
int ide_no_data_taskfile(ide_drive_t *, ide_task_t *);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 12/20] ide: use wait_drive_not_busy() in drive_cmd_intr()
2007-12-09 21:15 [PATCH 12/20] ide: use wait_drive_not_busy() in drive_cmd_intr() Bartlomiej Zolnierkiewicz
@ 2007-12-10 13:02 ` Sergei Shtylyov
2007-12-12 21:34 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2007-12-10 13:02 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide
Bartlomiej Zolnierkiewicz wrote:
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
> Index: b/drivers/ide/ide-taskfile.c
> ===================================================================
> --- a/drivers/ide/ide-taskfile.c
> +++ b/drivers/ide/ide-taskfile.c
> @@ -260,7 +260,7 @@ static ide_startstop_t task_no_data_intr
> return ide_stopped;
> }
>
> -static u8 wait_drive_not_busy(ide_drive_t *drive)
> +u8 wait_drive_not_busy(ide_drive_t *drive)
> {
> ide_hwif_t *hwif = HWIF(drive);
> int retries;
I think you should remove the comment line below:
* (drive_cmd_intr waits that long).
MBR, Sergei
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 12/20] ide: use wait_drive_not_busy() in drive_cmd_intr()
2007-12-10 13:02 ` Sergei Shtylyov
@ 2007-12-12 21:34 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 3+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2007-12-12 21:34 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: linux-ide
On Monday 10 December 2007, Sergei Shtylyov wrote:
> Bartlomiej Zolnierkiewicz wrote:
>
> > Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
>
> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
>
> > Index: b/drivers/ide/ide-taskfile.c
> > ===================================================================
> > --- a/drivers/ide/ide-taskfile.c
> > +++ b/drivers/ide/ide-taskfile.c
> > @@ -260,7 +260,7 @@ static ide_startstop_t task_no_data_intr
> > return ide_stopped;
> > }
> >
> > -static u8 wait_drive_not_busy(ide_drive_t *drive)
> > +u8 wait_drive_not_busy(ide_drive_t *drive)
> > {
> > ide_hwif_t *hwif = HWIF(drive);
> > int retries;
>
> I think you should remove the comment line below:
>
> * (drive_cmd_intr waits that long).
Done.
[PATCH] ide: use wait_drive_not_busy() in drive_cmd_intr() (take 2)
Use wait_drive_not_busy() in drive_cmd_intr().
v2:
* Fix wait_drive_not_busy() comment (noticed by Sergei).
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-io.c | 4 +---
drivers/ide/ide-taskfile.c | 5 ++---
include/linux/ide.h | 2 ++
3 files changed, 5 insertions(+), 6 deletions(-)
Index: b/drivers/ide/ide-io.c
===================================================================
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -640,7 +640,6 @@ static ide_startstop_t drive_cmd_intr (i
ide_hwif_t *hwif = HWIF(drive);
u8 *args = (u8 *) rq->buffer;
u8 stat = hwif->INB(IDE_STATUS_REG);
- int retries = 10;
local_irq_enable_in_hardirq();
if (rq->cmd_type == REQ_TYPE_ATA_CMD &&
@@ -649,8 +648,7 @@ static ide_startstop_t drive_cmd_intr (i
drive->io_32bit = 0;
hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS);
drive->io_32bit = io_32bit;
- while (((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) && retries--)
- udelay(100);
+ stat = wait_drive_not_busy(drive);
}
if (!OK_STAT(stat, READY_STAT, BAD_STAT))
Index: b/drivers/ide/ide-taskfile.c
===================================================================
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -260,7 +260,7 @@ static ide_startstop_t task_no_data_intr
return ide_stopped;
}
-static u8 wait_drive_not_busy(ide_drive_t *drive)
+u8 wait_drive_not_busy(ide_drive_t *drive)
{
ide_hwif_t *hwif = HWIF(drive);
int retries;
@@ -268,8 +268,7 @@ static u8 wait_drive_not_busy(ide_drive_
/*
* Last sector was transfered, wait until drive is ready.
- * This can take up to 10 usec, but we will wait max 1 ms
- * (drive_cmd_intr() waits that long).
+ * This can take up to 10 usec, but we will wait max 1 ms.
*/
for (retries = 0; retries < 100; retries++) {
if ((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT)
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -994,6 +994,8 @@ ide_startstop_t do_rw_taskfile(ide_drive
void task_end_request(ide_drive_t *, struct request *, u8);
+u8 wait_drive_not_busy(ide_drive_t *);
+
int ide_raw_taskfile(ide_drive_t *, ide_task_t *, u8 *, u16);
int ide_no_data_taskfile(ide_drive_t *, ide_task_t *);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-12-12 22:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-09 21:15 [PATCH 12/20] ide: use wait_drive_not_busy() in drive_cmd_intr() Bartlomiej Zolnierkiewicz
2007-12-10 13:02 ` Sergei Shtylyov
2007-12-12 21:34 ` Bartlomiej Zolnierkiewicz
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).