Commit 65862d88 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] move stuff from ide_register_subdriver() to ide-probe.c

Move stuff from ide_register_subdriver() (associating drive with
high-level driver) to ide-probe.c, so that remaining stuff can be safely
called in parallel with IO on other drives [Andre]
parent 00a8a8c1
...@@ -555,6 +555,7 @@ static void probe_hwif (ide_hwif_t *hwif) ...@@ -555,6 +555,7 @@ static void probe_hwif (ide_hwif_t *hwif)
*/ */
for (unit = 0; unit < MAX_DRIVES; ++unit) { for (unit = 0; unit < MAX_DRIVES; ++unit) {
ide_drive_t *drive = &hwif->drives[unit]; ide_drive_t *drive = &hwif->drives[unit];
drive->dn = ((hwif->channel ? 2 : 0) + unit);
(void) probe_for_drive (drive); (void) probe_for_drive (drive);
if (drive->present && !hwif->present) { if (drive->present && !hwif->present) {
hwif->present = 1; hwif->present = 1;
...@@ -585,6 +586,17 @@ static void probe_hwif (ide_hwif_t *hwif) ...@@ -585,6 +586,17 @@ static void probe_hwif (ide_hwif_t *hwif)
if (hwif->tuneproc != NULL && drive->autotune == 1) if (hwif->tuneproc != NULL && drive->autotune == 1)
/* auto-tune PIO mode */ /* auto-tune PIO mode */
hwif->tuneproc(drive, 255); hwif->tuneproc(drive, 255);
if ((drive->autotune != 2) && hwif->dmaproc != NULL) {
/*
* Force DMAing for the beginning of the check.
* Some chipsets appear to do interesting
* things, if not checked and cleared.
* PARANOIA!!!
*/
hwif->dmaproc(ide_dma_off_quietly, drive);
hwif->dmaproc(ide_dma_check, drive);
}
} }
} }
} }
...@@ -859,7 +871,6 @@ static void init_gendisk (ide_hwif_t *hwif) ...@@ -859,7 +871,6 @@ static void init_gendisk (ide_hwif_t *hwif)
#if 1 #if 1
char name[64]; char name[64];
ide_add_generic_settings(hwif->drives + unit); ide_add_generic_settings(hwif->drives + unit);
hwif->drives[unit].dn = ((hwif->channel ? 2 : 0) + unit);
sprintf (name, "host%d/bus%d/target%d/lun%d", sprintf (name, "host%d/bus%d/target%d/lun%d",
(hwif->channel && hwif->mate) ? (hwif->channel && hwif->mate) ?
hwif->mate->index : hwif->index, hwif->mate->index : hwif->index,
...@@ -871,7 +882,6 @@ static void init_gendisk (ide_hwif_t *hwif) ...@@ -871,7 +882,6 @@ static void init_gendisk (ide_hwif_t *hwif)
char name[64]; char name[64];
ide_add_generic_settings(hwif->drives + unit); ide_add_generic_settings(hwif->drives + unit);
hwif->drives[unit].dn = ((hwif->channel ? 2 : 0) + unit);
sprintf (name, "host%d/bus%d/target%d/lun%d", sprintf (name, "host%d/bus%d/target%d/lun%d",
(hwif->channel && hwif->mate) ? hwif->mate->index : hwif->index, (hwif->channel && hwif->mate) ? hwif->mate->index : hwif->index,
hwif->channel, unit, hwif->drives[unit].lun); hwif->channel, unit, hwif->drives[unit].lun);
......
...@@ -3562,16 +3562,8 @@ int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int versio ...@@ -3562,16 +3562,8 @@ int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int versio
setup_driver_defaults(drive); setup_driver_defaults(drive);
spin_unlock_irqrestore(&ide_lock, flags); spin_unlock_irqrestore(&ide_lock, flags);
if (drive->autotune != 2) { if (drive->autotune != 2) {
if (driver->supports_dma && HWIF(drive)->dmaproc != NULL) { if (!driver->supports_dma && HWIF(drive)->dmaproc != NULL)
/*
* Force DMAing for the beginning of the check.
* Some chipsets appear to do interesting things,
* if not checked and cleared.
* PARANOIA!!!
*/
(void) (HWIF(drive)->dmaproc(ide_dma_off_quietly, drive)); (void) (HWIF(drive)->dmaproc(ide_dma_off_quietly, drive));
(void) (HWIF(drive)->dmaproc(ide_dma_check, drive));
}
drive->dsc_overlap = (drive->next != drive && driver->supports_dsc_overlap); drive->dsc_overlap = (drive->next != drive && driver->supports_dsc_overlap);
drive->nice1 = 1; drive->nice1 = 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment