Skip to contentSkip to conversation

ide: ide_config_drive_speed() bugfixes

PATCH In review Bartlomiej Zolnierkiewicz 2 participants 3 messages Jul 22, 2007 – Jul 23, 2007 libata

lore
Share & tools
lore
#0 lore raw

PATCH 6/11 ide: ide_config_drive_speed() bugfixes

* Use ->OUTBSYNC instead of ->OUTB when writing command register (needed for scc_pata and pmac host drivers).

* Don't check DRDY bit of the status register on ATAPI devices (ATAPI devices are free to ignore DRDY bit).

Cc Benjamin Herrenschmidt <[email protected]>
Cc Kou Ishizaki <[email protected]>
Cc Akira Gouache <[email protected]>

---
this patch is independent from the previous five ide-pmac patches

 drivers/ide/ide-iops.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ide/ide-iops.c +2 -2
Index: b/drivers/ide/ide-iops.c
===================================================================
@@ -822,7 +822,7 @@ int ide_config_drive_speed (ide_drive_t 
 		hwif->OUTB(drive->ctl | 2, IDE_CONTROL_REG);
 	hwif->OUTB(speed, IDE_NSECTOR_REG);
 	hwif->OUTB(SETFEATURES_XFER, IDE_FEATURE_REG);
-	hwif->OUTB(WIN_SETFEATURES, IDE_COMMAND_REG);
+	hwif->OUTBSYNC(drive, WIN_SETFEATURES, IDE_COMMAND_REG);
 	if ((IDE_CONTROL_REG) && (drive->quirk_list == 2))
 		hwif->OUTB(drive->ctl, IDE_CONTROL_REG);
 	udelay(1);
@@ -849,7 +849,7 @@ int ide_config_drive_speed (ide_drive_t 
 	 */
 	for (i = 0; i < 10; i++) {
 		udelay(1);
-		if (OK_STAT((stat = hwif->INB(IDE_STATUS_REG)), DRIVE_READY, BUSY_STAT|DRQ_STAT|ERR_STAT)) {
+		if (OK_STAT((stat = hwif->INB(IDE_STATUS_REG)), drive->ready_stat, BUSY_STAT|DRQ_STAT|ERR_STAT)) {
 			error = 0;
 			break;
 		}
#2 lore raw
Quoted 7 lines · Sergei Shtylyov

Hello.

Quoted 2 lines · Bartlomiej Zolnierkiewicz

* Use ->OUTBSYNC instead of ->OUTB when writing command register (needed for scc_pata and pmac host drivers).

Quoted 6 lines
Quoted 4 lines

* Don't check DRDY bit of the status register on ATAPI devices (ATAPI devices are free to ignore DRDY bit).

added