Commit 1813219b authored by Nishanth Aravamudan's avatar Nishanth Aravamudan Committed by Linus Torvalds

[PATCH] s390: msleep vs. schedule_timeout.

Use msleep() instead of schedule_timeout() to guarantee the task
delays for the desired time.
Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1371eb54
/* /*
* drivers/s390/cio/device_ops.c * drivers/s390/cio/device_ops.c
* *
* $Revision: 1.49 $ * $Revision: 1.50 $
* *
* Copyright (C) 2002 IBM Deutschland Entwicklung GmbH, * Copyright (C) 2002 IBM Deutschland Entwicklung GmbH,
* IBM Corporation * IBM Corporation
...@@ -295,7 +295,7 @@ __ccw_device_retry_loop(struct ccw_device *cdev, struct ccw1 *ccw, long magic) ...@@ -295,7 +295,7 @@ __ccw_device_retry_loop(struct ccw_device *cdev, struct ccw1 *ccw, long magic)
break; break;
/* Try again later. */ /* Try again later. */
spin_unlock_irq(&sch->lock); spin_unlock_irq(&sch->lock);
schedule_timeout(1); msleep(10);
spin_lock_irq(&sch->lock); spin_lock_irq(&sch->lock);
} while (1); } while (1);
......
/* /*
* $Id: ctctty.c,v 1.24 2004/07/15 16:03:08 ptiedem Exp $ * $Id: ctctty.c,v 1.26 2004/08/04 11:06:55 mschwide Exp $
* *
* CTC / ESCON network driver, tty interface. * CTC / ESCON network driver, tty interface.
* *
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/serial_reg.h> #include <linux/serial_reg.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/delay.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/devfs_fs_kernel.h> #include <linux/devfs_fs_kernel.h>
#include "ctctty.h" #include "ctctty.h"
...@@ -1053,9 +1054,8 @@ ctc_tty_close(struct tty_struct *tty, struct file *filp) ...@@ -1053,9 +1054,8 @@ ctc_tty_close(struct tty_struct *tty, struct file *filp)
*/ */
timeout = jiffies + HZ; timeout = jiffies + HZ;
while (!(info->lsr & UART_LSR_TEMT)) { while (!(info->lsr & UART_LSR_TEMT)) {
set_current_state(TASK_INTERRUPTIBLE);
spin_unlock_irqrestore(&ctc_tty_lock, flags); spin_unlock_irqrestore(&ctc_tty_lock, flags);
schedule_timeout(HZ/2); msleep(500);
spin_lock_irqsave(&ctc_tty_lock, flags); spin_lock_irqsave(&ctc_tty_lock, flags);
if (time_after(jiffies,timeout)) if (time_after(jiffies,timeout))
break; break;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* Frank Pavlic (pavlic@de.ibm.com) and * Frank Pavlic (pavlic@de.ibm.com) and
* Martin Schwidefsky <schwidefsky@de.ibm.com> * Martin Schwidefsky <schwidefsky@de.ibm.com>
* *
* $Revision: 1.84 $ $Date: 2004/07/14 07:23:15 $ * $Revision: 1.85 $ $Date: 2004/08/04 11:05:43 $
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <linux/inetdevice.h> #include <linux/inetdevice.h>
#include <linux/in.h> #include <linux/in.h>
#include <linux/igmp.h> #include <linux/igmp.h>
#include <linux/delay.h>
#include <net/arp.h> #include <net/arp.h>
#include <net/ip.h> #include <net/ip.h>
...@@ -58,7 +59,7 @@ ...@@ -58,7 +59,7 @@
/** /**
* initialization string for output * initialization string for output
*/ */
#define VERSION_LCS_C "$Revision: 1.84 $" #define VERSION_LCS_C "$Revision: 1.85 $"
static char version[] __initdata = "LCS driver ("VERSION_LCS_C "/" VERSION_LCS_H ")"; static char version[] __initdata = "LCS driver ("VERSION_LCS_C "/" VERSION_LCS_H ")";
static char debug_buffer[255]; static char debug_buffer[255];
...@@ -1420,7 +1421,7 @@ lcs_resetcard(struct lcs_card *card) ...@@ -1420,7 +1421,7 @@ lcs_resetcard(struct lcs_card *card)
card->dev->name); card->dev->name);
return 0; return 0;
} }
msleep(30); msleep(3000);
} }
PRINT_ERR("Error in Reseting LCS card!\n"); PRINT_ERR("Error in Reseting LCS card!\n");
return -EIO; return -EIO;
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_ERP #define ZFCP_LOG_AREA ZFCP_LOG_AREA_ERP
/* this drivers version (do not edit !!! generated and updated by cvs) */ /* this drivers version (do not edit !!! generated and updated by cvs) */
#define ZFCP_ERP_REVISION "$Revision: 1.60 $" #define ZFCP_ERP_REVISION "$Revision: 1.61 $"
#include "zfcp_ext.h" #include "zfcp_ext.h"
...@@ -2170,7 +2170,6 @@ static int ...@@ -2170,7 +2170,6 @@ static int
zfcp_erp_adapter_strategy(struct zfcp_erp_action *erp_action) zfcp_erp_adapter_strategy(struct zfcp_erp_action *erp_action)
{ {
int retval; int retval;
unsigned long timeout;
struct zfcp_adapter *adapter = erp_action->adapter; struct zfcp_adapter *adapter = erp_action->adapter;
retval = zfcp_erp_adapter_strategy_close(erp_action); retval = zfcp_erp_adapter_strategy_close(erp_action);
...@@ -2187,9 +2186,7 @@ zfcp_erp_adapter_strategy(struct zfcp_erp_action *erp_action) ...@@ -2187,9 +2186,7 @@ zfcp_erp_adapter_strategy(struct zfcp_erp_action *erp_action)
ZFCP_LOG_INFO("Waiting to allow the adapter %s " ZFCP_LOG_INFO("Waiting to allow the adapter %s "
"to recover itself\n", "to recover itself\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
timeout = ZFCP_TYPE2_RECOVERY_TIME; msleep(jiffies_to_msecs(ZFCP_TYPE2_RECOVERY_TIME));
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(timeout);
} }
return retval; return retval;
...@@ -2365,10 +2362,8 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action) ...@@ -2365,10 +2362,8 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action)
failed_qdio_activate: failed_qdio_activate:
debug_text_event(adapter->erp_dbf, 3, "qdio_down1a"); debug_text_event(adapter->erp_dbf, 3, "qdio_down1a");
while (qdio_shutdown(adapter->ccw_device, while (qdio_shutdown(adapter->ccw_device,
QDIO_FLAG_CLEANUP_USING_CLEAR) == -EINPROGRESS) { QDIO_FLAG_CLEANUP_USING_CLEAR) == -EINPROGRESS)
set_current_state(TASK_UNINTERRUPTIBLE); msleep(1000);
schedule_timeout(HZ);
}
debug_text_event(adapter->erp_dbf, 3, "qdio_down1b"); debug_text_event(adapter->erp_dbf, 3, "qdio_down1b");
failed_qdio_establish: failed_qdio_establish:
...@@ -2414,10 +2409,8 @@ zfcp_erp_adapter_strategy_close_qdio(struct zfcp_erp_action *erp_action) ...@@ -2414,10 +2409,8 @@ zfcp_erp_adapter_strategy_close_qdio(struct zfcp_erp_action *erp_action)
debug_text_event(adapter->erp_dbf, 3, "qdio_down2a"); debug_text_event(adapter->erp_dbf, 3, "qdio_down2a");
while (qdio_shutdown(adapter->ccw_device, while (qdio_shutdown(adapter->ccw_device,
QDIO_FLAG_CLEANUP_USING_CLEAR) == -EINPROGRESS) { QDIO_FLAG_CLEANUP_USING_CLEAR) == -EINPROGRESS)
set_current_state(TASK_UNINTERRUPTIBLE); msleep(1000);
schedule_timeout(HZ);
}
debug_text_event(adapter->erp_dbf, 3, "qdio_down2b"); debug_text_event(adapter->erp_dbf, 3, "qdio_down2b");
/* /*
...@@ -2528,8 +2521,7 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action) ...@@ -2528,8 +2521,7 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
ZFCP_LOG_DEBUG("host connection still initialising... " ZFCP_LOG_DEBUG("host connection still initialising... "
"waiting and retrying...\n"); "waiting and retrying...\n");
/* sleep a little bit before retry */ /* sleep a little bit before retry */
set_current_state(TASK_INTERRUPTIBLE); msleep(jiffies_to_msecs(ZFCP_EXCHANGE_CONFIG_DATA_SLEEP));
schedule_timeout(ZFCP_EXCHANGE_CONFIG_DATA_SLEEP);
} }
} while ((retries--) && } while ((retries--) &&
atomic_test_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT, atomic_test_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT,
......
...@@ -180,8 +180,7 @@ zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter) ...@@ -180,8 +180,7 @@ zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter)
ZFCP_LOG_DEBUG("fsf req list of adapter %s not yet empty\n", ZFCP_LOG_DEBUG("fsf req list of adapter %s not yet empty\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
/* wait for woken intiators to clean up their requests */ /* wait for woken intiators to clean up their requests */
set_current_state(TASK_UNINTERRUPTIBLE); msleep(jiffies_to_msecs(ZFCP_FSFREQ_CLEANUP_TIMEOUT));
schedule_timeout(ZFCP_FSFREQ_CLEANUP_TIMEOUT);
} }
/* consistency check */ /* consistency check */
......
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