Skip to contentSkip to conversation

ide: Fix drive's DWORD-IO handling

PATCH In review Mario Schwalbe 2 participants 3 messages Dec 18, 2008 – Dec 29, 2008 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ide: Fix drive's DWORD-IO handling

Resubmitted on request.

According the documentation, id[ATA_ID_DWORD_IO] is non-zero if the drive supports dword IO, while the code disables support by setting IDE_DFLAG_NO_IO_32BIT. In addition, this word has been reused by the ATA8 specification. This patch fixes both cases.

---
 drivers/ide/ide-probe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/ide/ide-probe.c +1 -1
index c55bdbd..859b0e5 100644
@@ -856,7 +856,7 @@ static void ide_port_tune_devices(ide_hwif_t *hwif)
 		ide_drive_t *drive = &hwif->drives[unit];
 
 		if ((hwif->host_flags & IDE_HFLAG_NO_IO_32BIT) ||
-		    drive->id[ATA_ID_DWORD_IO])
+		    !ata_id_has_dword_io(drive->id))
 			drive->dev_flags |= IDE_DFLAG_NO_IO_32BIT;
 		else
 			drive->dev_flags &= ~IDE_DFLAG_NO_IO_32BIT;
Signature · 1 line
1.5.6.3
#1 lore raw
Quoted 17 lines · Mario Schwalbe

Resubmitted on request.

According the documentation, id[ATA_ID_DWORD_IO] is non-zero if the drive supports dword IO, while the code disables support by setting IDE_DFLAG_NO_IO_32BIT. In addition, this word has been reused by the ATA8 specification. This patch fixes both cases.

---
 drivers/ide/ide-probe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/ide/ide-probe.c +0 -0
index c55bdbd..859b0e5 100644

drivers/ide/ide-probe.c static void ide_port_tune_devices(ide_hwif_t *hwif) · line 862

Quoted 8 lines
drivers/ide/ide-probe.c +1 -1
@@ -856,7 +856,7 @@ static void ide_port_tune_devices(ide_hwif_t *hwif)
 		ide_drive_t *drive = &hwif->drives[unit];
 
 		if ((hwif->host_flags & IDE_HFLAG_NO_IO_32BIT) ||
-		    drive->id[ATA_ID_DWORD_IO])
+		    !ata_id_has_dword_io(drive->id))
 			drive->dev_flags |= IDE_DFLAG_NO_IO_32BIT;
 		else
 			drive->dev_flags &= ~IDE_DFLAG_NO_IO_32BIT;

Since it seems that libata developers need more time to fully analyze issues with ata_id_has_dword_io() and I don't want to delay this fix because if it could you please modify the patch according to Sergei's suggestion of removing id[ATA_ID_DWORD_IO] check altogether?

[ It is a safe thing to do since the old code has been enabling 32-bit
I/O _unless_ the ATA-1 dword I/O bit for VU compatibility was set... ]

Thanks,
Bart

#2 lore raw
Quoted 32 lines · Bartlomiej Zolnierkiewicz
Quoted 17 lines · Mario Schwalbe

Resubmitted on request.

According the documentation, id[ATA_ID_DWORD_IO] is non-zero if the drive supports dword IO, while the code disables support by setting IDE_DFLAG_NO_IO_32BIT. In addition, this word has been reused by the ATA8 specification. This patch fixes both cases.

---
 drivers/ide/ide-probe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/ide/ide-probe.c +0 -0
index c55bdbd..859b0e5 100644

drivers/ide/ide-probe.c static void ide_port_tune_devices(ide_hwif_t *hwif) · line 862

Quoted 8 lines
drivers/ide/ide-probe.c +1 -1
@@ -856,7 +856,7 @@ static void ide_port_tune_devices(ide_hwif_t *hwif)
 		ide_drive_t *drive = &hwif->drives[unit];
 
 		if ((hwif->host_flags & IDE_HFLAG_NO_IO_32BIT) ||
-		    drive->id[ATA_ID_DWORD_IO])
+		    !ata_id_has_dword_io(drive->id))
 			drive->dev_flags |= IDE_DFLAG_NO_IO_32BIT;
 		else
 			drive->dev_flags &= ~IDE_DFLAG_NO_IO_32BIT;

Since it seems that libata developers need more time to fully analyze issues with ata_id_has_dword_io() and I don't want to delay this fix because if it could you please modify the patch according to Sergei's suggestion of removing id[ATA_ID_DWORD_IO] check altogether?

Quoted 2 lines

[ It is a safe thing to do since the old code has been enabling 32-bit
I/O _unless_ the ATA-1 dword I/O bit for VU compatibility was set... ]

I merged the patch and did the modification while at it:

From: Mario Schwalbe <[email protected]>
Subject: [PATCH] ide: Fix drive's DWORD-IO handling

According the documentation, id[ATA_ID_DWORD_IO] is non-zero if the drive supports dword IO, while the code disables support by setting IDE_DFLAG_NO_IO_32BIT. In addition, this word has been reused by the ATA8 specification. This patch fixes both cases.

Cc Sergei Shtylyov <[email protected]>
[bart: remove id[ATA_ID_DWORD_IO] check altogether per Sergei's suggestion]
---
 drivers/ide/ide-probe.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/ide/ide-probe.c +1 -2
Index: b/drivers/ide/ide-probe.c
===================================================================
@@ -849,8 +849,7 @@ static void ide_port_tune_devices(ide_hw
 	}
 
 	ide_port_for_each_dev(i, drive, hwif) {
-		if ((hwif->host_flags & IDE_HFLAG_NO_IO_32BIT) ||
-		    drive->id[ATA_ID_DWORD_IO])
+		if (hwif->host_flags & IDE_HFLAG_NO_IO_32BIT)
 			drive->dev_flags |= IDE_DFLAG_NO_IO_32BIT;
 		else
 			drive->dev_flags &= ~IDE_DFLAG_NO_IO_32BIT;