Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S267323AbUIXBlv (ORCPT ); Thu, 23 Sep 2004 21:41:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S267657AbUIXBjj (ORCPT ); Thu, 23 Sep 2004 21:39:39 -0400 Received: from baikonur.stro.at ([213.239.196.228]:57051 "EHLO baikonur.stro.at") by vger.kernel.org with ESMTP id S267323AbUIWUoO (ORCPT ); Thu, 23 Sep 2004 16:44:14 -0400 Subject: [patch 2/9] block/xd: replace schedule_timeout() with msleep()/msleep_interruptible() To: axboe@suse.de Cc: linux-kernel@vger.kernel.org, janitor@sternwelten.at, nacc@us.ibm.com From: janitor@sternwelten.at Date: Thu, 23 Sep 2004 22:44:15 +0200 Message-ID: Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2605 Lines: 73 Any comments would be appreciated. Description: Use msleep() or msleep_interruptible() [as appropriate] instead of schedule_timeout() to gurantee the task delays as expected. As a result changed the units of the timeout variable from jiffies to msecs. Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems --- linux-2.6.9-rc2-bk7-max/drivers/block/xd.c | 14 +++++--------- 1 files changed, 5 insertions(+), 9 deletions(-) diff -puN drivers/block/xd.c~msleep-drivers_block_xd drivers/block/xd.c --- linux-2.6.9-rc2-bk7/drivers/block/xd.c~msleep-drivers_block_xd 2004-09-21 21:07:31.000000000 +0200 +++ linux-2.6.9-rc2-bk7-max/drivers/block/xd.c 2004-09-21 21:07:31.000000000 +0200 @@ -62,7 +62,7 @@ static int xd[5] = { -1,-1,-1,-1, }; #define XD_DONT_USE_DMA 0 /* Initial value. may be overriden using "nodma" module option */ -#define XD_INIT_DISK_DELAY (30*HZ/1000) /* 30 ms delay during disk initialization */ +#define XD_INIT_DISK_DELAY (30) /* 30 ms delay during disk initialization */ /* Above may need to be increased if a problem with the 2nd drive detection (ST11M controller) or resetting a controller (WD) appears */ @@ -625,14 +625,12 @@ static u_char __init xd_initdrives (void for (i = 0; i < XD_MAXDRIVES; i++) { xd_build(cmdblk,CMD_TESTREADY,i,0,0,0,0,0); if (!xd_command(cmdblk,PIO_MODE,NULL,NULL,NULL,XD_TIMEOUT*8)) { - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(XD_INIT_DISK_DELAY); + msleep_interruptible(XD_INIT_DISK_DELAY); init_drive(count); count++; - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(XD_INIT_DISK_DELAY); + msleep_interruptible(XD_INIT_DISK_DELAY); } } return (count); @@ -753,8 +751,7 @@ static void __init xd_wd_init_controller outb(0,XD_RESET); /* reset the controller */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(XD_INIT_DISK_DELAY); + msleep(XD_INIT_DISK_DELAY); } static void __init xd_wd_init_drive (u_char drive) @@ -928,8 +925,7 @@ If you need non-standard settings use th xd_maxsectors = 0x01; outb(0,XD_RESET); /* reset the controller */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(XD_INIT_DISK_DELAY); + msleep(XD_INIT_DISK_DELAY); } static void __init xd_xebec_init_drive (u_char drive) _ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/