linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konstantin Khorenko <khorenko@sw.ru>
To: Mike Miller <mike.miller@hp.com>
Cc: Vasily Averin <vvs@sw.ru>,
	linux-scsi@vger.kernel.org, iss_storagedev@hp.com,
	devel@openvz.org, Kirill Korotaev <dev@sw.ru>
Subject: [patch scsi] cciss: make fair timeouts during initialization
Date: Thu, 02 Mar 2006 10:10:53 +0300	[thread overview]
Message-ID: <44069A7D.4030201@sw.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 1113 bytes --]

Patch makes fair initialization timeouts in cciss driver.

Signed-off-by: Konstantin Khorenko <khorenko@sw.ru>

-----------------------------------
cciss driver has following code for timeouts during board initialization:
        ...
        for(i=0;i<MAX_CONFIG_WAIT;i++) {
                ...
                set_current_state(TASK_INTERRUPTIBLE);
                schedule_timeout(10);
        }
        ...

We compile cciss driver into the kernel and thus at the kernel boot
schedule_timeout() returns very quickly and resulted timeouts became
insufficient for correct board initialization.
Particularly, we often got following error:
--
HP CISS Driver (v 2.6.8)
cciss: Device 0x46 has been found at bus 6 dev 1 func 0
cciss: unable to get board into simple mode
cciss: probe of 0000:06:01.0 failed with error -1
--

The patch is designed to make fair initialization timeouts.

----------
Hope, you'll check this changes and find them usefull. :)
Kernel with patch was compiled and tested on two nodes.
This patch is against mainstream 2.6.16-rc5 kernel.

-- 
Best regards,

Konstantin Khorenko,
SWsoft, Inc.

[-- Attachment #2: diff-cciss-fair-init-timeouts --]
[-- Type: text/plain, Size: 1204 bytes --]

--- ./drivers/block/cciss.c.16-rc5	2006-03-01 11:13:03.000000000 +0300
+++ ./drivers/block/cciss.c	2006-03-02 09:30:38.000000000 +0300
@@ -1893,7 +1893,7 @@ static unsigned long pollcomplete(int ct
 	for (i = 20 * HZ; i > 0; i--) {
 		done = hba[ctlr]->access.command_completed(hba[ctlr]);
 		if (done == FIFO_EMPTY)
-			schedule_timeout_uninterruptible(1);
+			msleep(1);
 		else
 			return (done);
 	}
@@ -2817,8 +2817,7 @@ static int cciss_pci_init(ctlr_info_t *c
 		scratchpad = readl(c->vaddr + SA5_SCRATCHPAD_OFFSET);
 		if (scratchpad == CCISS_FIRMWARE_READY)
 			break;
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout(HZ / 10); /* wait 100ms */
+		msleep(100); /* wait 100ms */
 	}
 	if (scratchpad != CCISS_FIRMWARE_READY) {
 		printk(KERN_WARNING "cciss: Board not ready.  Timed out.\n");
@@ -2903,8 +2902,7 @@ static int cciss_pci_init(ctlr_info_t *c
 		if (!(readl(c->vaddr + SA5_DOORBELL) & CFGTBL_ChangeReq))
 			break;
 		/* delay and try again */
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout(10);
+		msleep(10);
 	}	
 
 #ifdef CCISS_DEBUG
#
# Patch makes fair initialization timeouts in cciss driver.
#
# Signed-off-by: Konstantin Khorenko <khorenko@sw.ru>

                 reply	other threads:[~2006-03-02  7:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44069A7D.4030201@sw.ru \
    --to=khorenko@sw.ru \
    --cc=dev@sw.ru \
    --cc=devel@openvz.org \
    --cc=iss_storagedev@hp.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mike.miller@hp.com \
    --cc=vvs@sw.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).