diff options
-rw-r--r-- | drivers/ide/hpt366.c | 8 | ||||
-rw-r--r-- | drivers/ide/ide-probe.c | 50 | ||||
-rw-r--r-- | include/linux/ide.h | 1 |
3 files changed, 6 insertions, 53 deletions
diff --git a/drivers/ide/hpt366.c b/drivers/ide/hpt366.c index f5afd46ed51c..b18e10d99d2e 100644 --- a/drivers/ide/hpt366.c +++ b/drivers/ide/hpt366.c | |||
@@ -135,7 +135,6 @@ | |||
135 | /* various tuning parameters */ | 135 | /* various tuning parameters */ |
136 | #define HPT_RESET_STATE_ENGINE | 136 | #define HPT_RESET_STATE_ENGINE |
137 | #undef HPT_DELAY_INTERRUPT | 137 | #undef HPT_DELAY_INTERRUPT |
138 | #define HPT_SERIALIZE_IO 0 | ||
139 | 138 | ||
140 | static const char *quirk_drives[] = { | 139 | static const char *quirk_drives[] = { |
141 | "QUANTUM FIREBALLlct08 08", | 140 | "QUANTUM FIREBALLlct08 08", |
@@ -1288,7 +1287,6 @@ static u8 hpt3xx_cable_detect(ide_hwif_t *hwif) | |||
1288 | static void __devinit init_hwif_hpt366(ide_hwif_t *hwif) | 1287 | static void __devinit init_hwif_hpt366(ide_hwif_t *hwif) |
1289 | { | 1288 | { |
1290 | struct hpt_info *info = hpt3xx_get_info(hwif->dev); | 1289 | struct hpt_info *info = hpt3xx_get_info(hwif->dev); |
1291 | int serialize = HPT_SERIALIZE_IO; | ||
1292 | u8 chip_type = info->chip_type; | 1290 | u8 chip_type = info->chip_type; |
1293 | 1291 | ||
1294 | /* Cache the channel's MISC. control registers' offset */ | 1292 | /* Cache the channel's MISC. control registers' offset */ |
@@ -1305,13 +1303,9 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif) | |||
1305 | * Clock is shared between the channels, | 1303 | * Clock is shared between the channels, |
1306 | * so we'll have to serialize them... :-( | 1304 | * so we'll have to serialize them... :-( |
1307 | */ | 1305 | */ |
1308 | serialize = 1; | 1306 | hwif->host->host_flags |= IDE_HFLAG_SERIALIZE; |
1309 | hwif->rw_disk = &hpt3xxn_rw_disk; | 1307 | hwif->rw_disk = &hpt3xxn_rw_disk; |
1310 | } | 1308 | } |
1311 | |||
1312 | /* Serialize access to this device if needed */ | ||
1313 | if (serialize && hwif->mate) | ||
1314 | hwif->serialized = hwif->mate->serialized = 1; | ||
1315 | } | 1309 | } |
1316 | 1310 | ||
1317 | static int __devinit init_dma_hpt366(ide_hwif_t *hwif, | 1311 | static int __devinit init_dma_hpt366(ide_hwif_t *hwif, |
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index f76c22c45086..c1cd1af2646b 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -864,31 +864,6 @@ static void ide_port_tune_devices(ide_hwif_t *hwif) | |||
864 | } | 864 | } |
865 | 865 | ||
866 | /* | 866 | /* |
867 | * save_match() is used to simplify logic in init_irq() below. | ||
868 | * | ||
869 | * A loophole here is that we may not know about a particular | ||
870 | * hwif's irq until after that hwif is actually probed/initialized.. | ||
871 | * This could be a problem for the case where an hwif is on a | ||
872 | * dual interface that requires serialization (eg. cmd640) and another | ||
873 | * hwif using one of the same irqs is initialized beforehand. | ||
874 | * | ||
875 | * This routine detects and reports such situations, but does not fix them. | ||
876 | */ | ||
877 | static void save_match(ide_hwif_t *hwif, ide_hwif_t *new, ide_hwif_t **match) | ||
878 | { | ||
879 | ide_hwif_t *m = *match; | ||
880 | |||
881 | if (m && m->hwgroup && m->hwgroup != new->hwgroup) { | ||
882 | if (!new->hwgroup) | ||
883 | return; | ||
884 | printk(KERN_WARNING "%s: potential IRQ problem with %s and %s\n", | ||
885 | hwif->name, new->name, m->name); | ||
886 | } | ||
887 | if (!m || m->irq != hwif->irq) /* don't undo a prior perfect match */ | ||
888 | *match = new; | ||
889 | } | ||
890 | |||
891 | /* | ||
892 | * init request queue | 867 | * init request queue |
893 | */ | 868 | */ |
894 | static int ide_init_queue(ide_drive_t *drive) | 869 | static int ide_init_queue(ide_drive_t *drive) |
@@ -1052,26 +1027,13 @@ static int init_irq (ide_hwif_t *hwif) | |||
1052 | mutex_lock(&ide_cfg_mtx); | 1027 | mutex_lock(&ide_cfg_mtx); |
1053 | hwif->hwgroup = NULL; | 1028 | hwif->hwgroup = NULL; |
1054 | 1029 | ||
1055 | /* | ||
1056 | * Group up with any other hwifs that share our irq(s). | ||
1057 | */ | ||
1058 | for (index = 0; index < MAX_HWIFS; index++) { | 1030 | for (index = 0; index < MAX_HWIFS; index++) { |
1059 | ide_hwif_t *h = ide_ports[index]; | 1031 | ide_hwif_t *h = ide_ports[index]; |
1060 | 1032 | ||
1061 | if (h && h->hwgroup) { /* scan only initialized ports */ | 1033 | if (h && h->hwgroup) { /* scan only initialized ports */ |
1062 | if (hwif->irq == h->irq) { | 1034 | if (hwif->host->host_flags & IDE_HFLAG_SERIALIZE) { |
1063 | if (hwif->chipset != ide_pci || | 1035 | if (hwif->host == h->host) |
1064 | h->chipset != ide_pci) { | 1036 | match = h; |
1065 | save_match(hwif, h, &match); | ||
1066 | } | ||
1067 | } | ||
1068 | if (hwif->serialized) { | ||
1069 | if (hwif->mate && hwif->mate->irq == h->irq) | ||
1070 | save_match(hwif, h, &match); | ||
1071 | } | ||
1072 | if (h->serialized) { | ||
1073 | if (h->mate && hwif->irq == h->mate->irq) | ||
1074 | save_match(hwif, h, &match); | ||
1075 | } | 1037 | } |
1076 | } | 1038 | } |
1077 | } | 1039 | } |
@@ -1437,10 +1399,8 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port, | |||
1437 | } | 1399 | } |
1438 | 1400 | ||
1439 | if ((d->host_flags & IDE_HFLAG_SERIALIZE) || | 1401 | if ((d->host_flags & IDE_HFLAG_SERIALIZE) || |
1440 | ((d->host_flags & IDE_HFLAG_SERIALIZE_DMA) && hwif->dma_base)) { | 1402 | ((d->host_flags & IDE_HFLAG_SERIALIZE_DMA) && hwif->dma_base)) |
1441 | if (hwif->mate) | 1403 | hwif->host->host_flags |= IDE_HFLAG_SERIALIZE; |
1442 | hwif->mate->serialized = hwif->serialized = 1; | ||
1443 | } | ||
1444 | 1404 | ||
1445 | if (d->max_sectors) | 1405 | if (d->max_sectors) |
1446 | hwif->rqsize = d->max_sectors; | 1406 | hwif->rqsize = d->max_sectors; |
diff --git a/include/linux/ide.h b/include/linux/ide.h index f89d6d69a386..9b89cab6d493 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -839,7 +839,6 @@ typedef struct hwif_s { | |||
839 | unsigned extra_ports; /* number of extra dma ports */ | 839 | unsigned extra_ports; /* number of extra dma ports */ |
840 | 840 | ||
841 | unsigned present : 1; /* this interface exists */ | 841 | unsigned present : 1; /* this interface exists */ |
842 | unsigned serialized : 1; /* serialized all channel operation */ | ||
843 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ | 842 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ |
844 | 843 | ||
845 | struct device gendev; | 844 | struct device gendev; |