[PATCH 1/8] dtc2278: fix ->io_32bit handling

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Bartlomiej Zolnierkiewicz
Date: Sunday, January 6, 2008 - 10:02 am

On DTC2278 32-bit I/O has to be enabled for both devices on the port
so always enable it during init time and disallow further changes.

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/ide.c            |    4 ----
 drivers/ide/legacy/dtc2278.c |   12 ++++++------
 2 files changed, 6 insertions(+), 10 deletions(-)

Index: b/drivers/ide/ide.c
===================================================================
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -791,10 +791,6 @@ int set_io_32bit(ide_drive_t *drive, int
 		return -EBUSY;
 
 	drive->io_32bit = arg;
-#ifdef CONFIG_BLK_DEV_DTC2278
-	if (HWIF(drive)->chipset == ide_dtc2278)
-		HWIF(drive)->drives[!drive->select.b.unit].io_32bit = arg;
-#endif /* CONFIG_BLK_DEV_DTC2278 */
 
 	spin_unlock_irq(&ide_lock);
 
Index: b/drivers/ide/legacy/dtc2278.c
===================================================================
--- a/drivers/ide/legacy/dtc2278.c
+++ b/drivers/ide/legacy/dtc2278.c
@@ -84,12 +84,6 @@ static void dtc2278_set_pio_mode(ide_dri
 		/* Actually we do - there is a data sheet available for the
 		   Winbond but does anyone actually care */
 	}
-
-	/*
-	 * 32bit I/O has to be enabled for *both* drives at the same time.
-	 */
-	drive->io_32bit = 1;
-	HWIF(drive)->drives[!drive->select.b.unit].io_32bit = 1;
 }
 
 static int __init dtc2278_probe(void)
@@ -123,18 +117,24 @@ static int __init dtc2278_probe(void)
 	local_irq_restore(flags);
 
 	hwif->serialized = 1;
+	hwif->no_io_32bit = 1;	/* disallow ->io_32bit changes */
 	hwif->chipset = ide_dtc2278;
 	hwif->pio_mask = ATA_PIO4;
 	hwif->set_pio_mode = &dtc2278_set_pio_mode;
 	hwif->drives[0].no_unmask = 1;
 	hwif->drives[1].no_unmask = 1;
+	hwif->drives[0].io_32bit = 1;
+	hwif->drives[1].io_32bit = 1;
 	hwif->mate = mate;
 
 	mate->serialized = 1;
+	mate->no_io_32bit = 1;
 	mate->chipset = ide_dtc2278;
 	mate->pio_mask = ATA_PIO4;
 	mate->drives[0].no_unmask = 1;
 	mate->drives[1].no_unmask = 1;
+	mate->drives[0].io_32bit = 1;
+	mate->drives[1].io_32bit = 1;
 	mate->mate = hwif;
 	mate->channel = 1;
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/8] dtc2278: fix ->io_32bit handling, Bartlomiej Zolnierki ..., (Sun Jan 6, 10:02 am)
[PATCH 2/8] au1xxx-ide: fix -&gt;io_32bit handling, Bartlomiej Zolnierki ..., (Sun Jan 6, 10:02 am)
[PATCH 3/8] atiixp/cs5535/scc_pata: fix &quot;idex=ata66&quot; param ..., Bartlomiej Zolnierki ..., (Sun Jan 6, 10:02 am)
[PATCH 4/8] macide: remove drive-&gt;capacity64 quirk, Bartlomiej Zolnierki ..., (Sun Jan 6, 10:02 am)
[PATCH 5/8] ide: always set DMA masks in ide_pci_setup_ports(), Bartlomiej Zolnierki ..., (Sun Jan 6, 10:02 am)
[PATCH 6/8] ide: separate PCI specific init from generic i ..., Bartlomiej Zolnierki ..., (Sun Jan 6, 10:03 am)
[PATCH 7/8] ide: add struct ide_port_info instances to leg ..., Bartlomiej Zolnierki ..., (Sun Jan 6, 10:03 am)
[PATCH 8/8] ide: add -&gt;cable_detect method to ide_hwif_t, Bartlomiej Zolnierki ..., (Sun Jan 6, 10:03 am)
Re: [PATCH 7/8] ide: add struct ide_port_info instances to ..., Bartlomiej Zolnierki ..., (Fri Feb 1, 4:35 pm)
Re: [PATCH 7/8] ide: add struct ide_port_info instances to ..., Bartlomiej Zolnierki ..., (Sun Feb 10, 10:04 am)
Re: [PATCH 7/8] ide: add struct ide_port_info instances to ..., Bartlomiej Zolnierki ..., (Sun Feb 10, 4:16 pm)