set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(HZ/2); 
msleep_interruptible(500); 
ctc_tty_close(struct tty_struct *tty, struct file *filp){	ctc_tty_info *info = (ctc_tty_info *) tty->driver_data;	ulong flags;	ulong timeout;	DBF_TEXT(trace, 3, __FUNCTION__);	if (!info || ctc_tty_paranoia_check(info, tty->name, "ctc_tty_close"))		return;	spin_lock_irqsave(&ctc_tty_lock, flags);	if (tty_hung_up_p(filp)) {		spin_unlock_irqrestore(&ctc_tty_lock, flags);#ifdef CTC_DEBUG_MODEM_OPEN		printk(KERN_DEBUG "ctc_tty_close return after tty_hung_up_p\n");#endif		return;	}	if ((tty->count == 1) && (info->count != 1)) {		/*		 * Uh, oh.  tty->count is 1, which means that the tty		 * structure will be freed.  Info->count should always		 * be one in these conditions.  If it's greater than		 * one, we've got real problems, since it means the		 * serial port won't be shutdown.		 */		printk(KERN_ERR "ctc_tty_close: bad port count; tty->count is 1, "		       "info->count is %d\n", info->count);		info->count = 1;	}	if (--info->count < 0) {		printk(KERN_ERR "ctc_tty_close: bad port count for %s%d: %d\n",		       CTC_TTY_NAME, info->line, info->count);		info->count = 0;	}	if (info->count) {		local_irq_restore(flags);#ifdef CTC_DEBUG_MODEM_OPEN		printk(KERN_DEBUG "ctc_tty_close after info->count != 0\n");#endif		return;	}	info->flags |= CTC_ASYNC_CLOSING;	tty->closing = 1;	/*	 * At this point we stop accepting input.  To do this, we	 * disable the receive line status interrupts, and tell the	 * interrupt driver to stop checking the data ready bit in the	 * line status register.	 */	if (info->flags & CTC_ASYNC_INITIALIZED) {		tty_wait_until_sent(tty, 30*HZ); /* 30 seconds timeout */		/*		 * Before we drop DTR, make sure the UART transmitter		 * has completely drained; this is especially		 * important if there is a transmit FIFO!		 */		timeout = jiffies + HZ;		while (!(info->lsr & UART_LSR_TEMT)) {			spin_unlock_irqrestore(&ctc_tty_lock, flags);			msleep(500);			spin_lock_irqsave(&ctc_tty_lock, flags);			if (time_after(jiffies,timeout))				break;		}	}	ctc_tty_shutdown(info);	if (tty->driver->flush_buffer) {		skb_queue_purge(&info->tx_queue);		info->lsr |= UART_LSR_TEMT;	}	tty_ldisc_flush(tty);	info->tty = 0;	tty->closing = 0;	if (info->blocked_open) {		set_current_state(TASK_INTERRUPTIBLE);		schedule_timeout(HZ/2);		wake_up_interruptible(&info->open_wait);	}	info->flags &= ~(CTC_ASYNC_NORMAL_ACTIVE | CTC_ASYNC_CLOSING);	wake_up_interruptible(&info->close_wait);	spin_unlock_irqrestore(&ctc_tty_lock, flags);#ifdef CTC_DEBUG_MODEM_OPEN	printk(KERN_DEBUG "ctc_tty_close normal exit\n");#endif}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/7f81947b46c3efacc084ac5033f3fed702e46532/ctctty.c/clean/drivers/s390/net/ctctty.c