hwif->OUTB(WIN_SRST, IDE_COMMAND_REG); 
hwif->OUTBSYNC(drive, WIN_SRST, IDE_COMMAND_REG); ndelay(400); 
static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi){	unsigned int unit;	unsigned long flags;	ide_hwif_t *hwif;	ide_hwgroup_t *hwgroup;		spin_lock_irqsave(&ide_lock, flags);	hwif = HWIF(drive);	hwgroup = HWGROUP(drive);	/* We must not reset with running handlers */	if(hwgroup->handler != NULL)		BUG();	/* For an ATAPI device, first try an ATAPI SRST. */	if (drive->media != ide_disk && !do_not_try_atapi) {		pre_reset(drive);		SELECT_DRIVE(drive);		udelay (20);		hwif->OUTB(WIN_SRST, IDE_COMMAND_REG);		hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE;		hwgroup->polling = 1;		__ide_set_handler(drive, &atapi_reset_pollfunc, HZ/20, NULL);		spin_unlock_irqrestore(&ide_lock, flags);		return ide_started;	}	/*	 * First, reset any device state data we were maintaining	 * for any of the drives on this interface.	 */	for (unit = 0; unit < MAX_DRIVES; ++unit)		pre_reset(&hwif->drives[unit]);#if OK_TO_RESET_CONTROLLER	if (!IDE_CONTROL_REG) {		spin_unlock_irqrestore(&ide_lock, flags);		return ide_stopped;	}	/*	 * Note that we also set nIEN while resetting the device,	 * to mask unwanted interrupts from the interface during the reset.	 * However, due to the design of PC hardware, this will cause an	 * immediate interrupt due to the edge transition it produces.	 * This single interrupt gives us a "fast poll" for drives that	 * recover from reset very quickly, saving us the first 50ms wait time.	 */	/* set SRST and nIEN */	hwif->OUTBSYNC(drive, drive->ctl|6,IDE_CONTROL_REG);	/* more than enough time */	udelay(10);	if (drive->quirk_list == 2) {		/* clear SRST and nIEN */		hwif->OUTBSYNC(drive, drive->ctl, IDE_CONTROL_REG);	} else {		/* clear SRST, leave nIEN */		hwif->OUTBSYNC(drive, drive->ctl|2, IDE_CONTROL_REG);	}	/* more than enough time */	udelay(10);	hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE;	hwgroup->polling = 1;	__ide_set_handler(drive, &reset_pollfunc, HZ/20, NULL);	/*	 * Some weird controller like resetting themselves to a strange	 * state when the disks are reset this way. At least, the Winbond	 * 553 documentation says that	 */	if (hwif->resetproc != NULL) {		hwif->resetproc(drive);	}	#endif	/* OK_TO_RESET_CONTROLLER */	spin_unlock_irqrestore(&ide_lock, flags);	return ide_started;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/68ad9910b0525d0194f9c316c7cb14adbf8e0c0c/ide-iops.c/buggy/drivers/ide/ide-iops.c