--- /usr/src/linux/drivers/ide/ide-iops.c Thu Apr 3 14:13:51 2003 +++ ide-iops.c Thu Apr 3 16:24:31 2003 @@ -1107,6 +1107,10 @@ } /* done polling */ hwgroup->poll_timeout = 0; + + /* tell ide_do_reset it complete */ + complete((struct completion *)hwif->hwif_data); + return ide_stopped; } @@ -1171,6 +1175,10 @@ } } hwgroup->poll_timeout = 0; /* done polling */ + + /* tell ide_do_reset it complete */ + complete((struct completion *)hwif->hwif_data); + return ide_stopped; } @@ -1307,7 +1315,25 @@ ide_startstop_t ide_do_reset (ide_drive_t *drive) { - return do_reset1(drive, 0); + /* + * Waiting for completion needed. + */ + ide_hwif_t *hwif; + void *old_data; + DECLARE_COMPLETION(wait); + + hwif = HWIF(drive); + + old_data = hwif->hwif_data; + hwif->hwif_data = &wait; + + (void) do_reset1(drive, 0); + + wait_for_completion(&wait); + + hwif->hwif_data = old_data; + + return ide_stopped; } EXPORT_SYMBOL(ide_do_reset);