/* panic() calls con3270_flush through a panic_notifier before the system enters a disabled, endless loop.  */
static void con3270_flush(void)
/* panic() calls con3270_flush through a panic_notifier before the system enters a disabled, endless loop.  */
static void con3270_flush(void)
{
	struct con3270 *cp;
	unsigned long flags;
	cp = condev;
	if (!cp->view.dev)
		return;
	raw3270_pm_unfreeze(&cp->view);
	spin_lock_irqsave(&cp->view.lock, flags);
	con3270_wait_write(cp);
	cp->nr_up = 0;
	con3270_rebuild_update(cp);
	con3270_update_status(cp);
	while (cp->update_flags != 0) {
		spin_unlock_irqrestore(&cp->view.lock, flags);
		con3270_update(cp);
		spin_lock_irqsave(&cp->view.lock, flags);
		con3270_wait_write(cp);
	}
	spin_unlock_irqrestore(&cp->view.lock, flags);
}