diff options
author | Len Brown <len.brown@intel.com> | 2005-09-08 07:45:47 +0200 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-09-08 07:45:47 +0200 |
commit | 64e47488c913ac704d465a6af86a26786d1412a5 (patch) | |
tree | d3b0148592963dcde26e4bb35ddfec8b1eaf8e23 /arch/ppc64/kernel/scanlog.c | |
parent | [ACPI] revert bad processor_core.c patch for bug 5128 (diff) | |
parent | [SCSI] Re-do "final klist fixes" (diff) | |
download | linux-64e47488c913ac704d465a6af86a26786d1412a5.tar.xz linux-64e47488c913ac704d465a6af86a26786d1412a5.zip |
Merge linux-2.6 with linux-acpi-2.6
Diffstat (limited to 'arch/ppc64/kernel/scanlog.c')
-rw-r--r-- | arch/ppc64/kernel/scanlog.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/arch/ppc64/kernel/scanlog.c b/arch/ppc64/kernel/scanlog.c index 4d70736619c7..215bf8900304 100644 --- a/arch/ppc64/kernel/scanlog.c +++ b/arch/ppc64/kernel/scanlog.c @@ -25,6 +25,7 @@ #include <linux/errno.h> #include <linux/proc_fs.h> #include <linux/init.h> +#include <linux/delay.h> #include <asm/uaccess.h> #include <asm/rtas.h> #include <asm/prom.h> @@ -77,7 +78,7 @@ static ssize_t scanlog_read(struct file *file, char __user *buf, return -EFAULT; for (;;) { - wait_time = HZ/2; /* default wait if no data */ + wait_time = 500; /* default wait if no data */ spin_lock(&rtas_data_buf_lock); memcpy(rtas_data_buf, data, RTAS_DATA_BUF_SIZE); status = rtas_call(ibm_scan_log_dump, 2, 1, NULL, @@ -107,24 +108,14 @@ static ssize_t scanlog_read(struct file *file, char __user *buf, break; default: if (status > 9900 && status <= 9905) { - /* No data. RTAS is hinting at a delay required - * between 1-100000 milliseconds - */ - int ms = 1; - for (; status > 9900; status--) - ms = ms * 10; - /* Use microseconds for reasonable accuracy */ - ms *= 1000; - wait_time = ms / (1000000/HZ); /* round down is fine */ - /* Fall through to sleep */ + wait_time = rtas_extended_busy_delay_time(status); } else { printk(KERN_ERR "scanlog: unknown error from rtas: %d\n", status); return -EIO; } } /* Apparently no data yet. Wait and try again. */ - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(wait_time); + msleep_interruptible(wait_time); } /*NOTREACHED*/ } |