Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 68555
b: refs/heads/master
c: ddf1510
h: refs/heads/master
i:
  68553: 1bc4baf
  68551: db0a748
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Oct 13, 2007
1 parent 8a098da commit f9c7d07
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 218ee5f364ed006403f1bbe3c1da5af51b1bdb2a
refs/heads/master: ddf151026a293725507fedc39b18ae6edb86d775
31 changes: 1 addition & 30 deletions trunk/drivers/ide/ide-iops.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,35 +472,6 @@ int drive_is_ready (ide_drive_t *drive)

EXPORT_SYMBOL(drive_is_ready);

/*
* Global for All, and taken from ide-pmac.c. Can be called
* with spinlock held & IRQs disabled, so don't schedule !
*/
int wait_for_ready (ide_drive_t *drive, int timeout)
{
ide_hwif_t *hwif = HWIF(drive);
u8 stat = 0;

while(--timeout) {
stat = hwif->INB(IDE_STATUS_REG);
if (!(stat & BUSY_STAT)) {
if (drive->ready_stat == 0)
break;
else if ((stat & drive->ready_stat)||(stat & ERR_STAT))
break;
}
mdelay(1);
}
if ((stat & ERR_STAT) || timeout <= 0) {
if (stat & ERR_STAT) {
printk(KERN_ERR "%s: wait_for_ready, "
"error status: %x\n", drive->name, stat);
}
return 1;
}
return 0;
}

/*
* This routine busy-waits for the drive status to be not "busy".
* It then checks the status for all of the "good" bits and none
Expand All @@ -512,7 +483,7 @@ int wait_for_ready (ide_drive_t *drive, int timeout)
* setting a timer to wake up at half second intervals thereafter,
* until timeout is achieved, before timing out.
*/
static int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad, unsigned long timeout, u8 *rstat)
int __ide_wait_stat(ide_drive_t *drive, u8 good, u8 bad, unsigned long timeout, u8 *rstat)
{
ide_hwif_t *hwif = drive->hwif;
unsigned long flags;
Expand Down
9 changes: 5 additions & 4 deletions trunk/drivers/ide/ppc/pmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,8 @@ static int
pmac_ide_do_setfeature(ide_drive_t *drive, u8 command)
{
ide_hwif_t *hwif = HWIF(drive);
int result = 1;
int result;
u8 stat;

disable_irq_nosync(hwif->irq);
udelay(1);
Expand All @@ -552,9 +553,9 @@ pmac_ide_do_setfeature(ide_drive_t *drive, u8 command)
hwif->OUTB(command, IDE_NSECTOR_REG);
hwif->OUTB(SETFEATURES_XFER, IDE_FEATURE_REG);
hwif->OUTBSYNC(drive, WIN_SETFEATURES, IDE_COMMAND_REG);
udelay(1);
/* Timeout bumped for some powerbooks */
result = wait_for_ready(drive, 2000);
result = __ide_wait_stat(drive, drive->ready_stat,
BUSY_STAT|DRQ_STAT|ERR_STAT,
WAIT_CMD, &stat);
hwif->OUTB(drive->ctl, IDE_CONTROL_REG);
if (result)
printk(KERN_ERR "%s: pmac_ide_do_setfeature disk not ready "
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ extern void SELECT_MASK(ide_drive_t *, int);
extern void QUIRK_LIST(ide_drive_t *);

extern int drive_is_ready(ide_drive_t *);
extern int wait_for_ready(ide_drive_t *, int /* timeout */);
int __ide_wait_stat(ide_drive_t *, u8, u8, unsigned long);

/*
* taskfile io for disks for now...and builds request from ide_ioctl
Expand Down

0 comments on commit f9c7d07

Please sign in to comment.