[PATCH 1/2] arcmsr: Fix hardware wait loops




IMO this belongs in 2.6.23-rc.

Committed to 'arcmsr' branch of
git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/misc-2.6.git


commit f9f7b1384995626e1a80322faef3f7cca97aa7ae
Author: Jeff Garzik <jeff@xxxxxxxxxx>
Date: Fri Jul 27 12:57:38 2007 -0400

[SCSI] arcmsr: Fix hardware wait loops

Remove _interruptible, since receiving a signal while waiting on a
hardware condition will simply cause the driver to busy-wait.

Using msleep_interruptible() is rarely the right thing to do, when
waiting on a hardware condition to change.

Also, replace msleep with ssleep while doing this, where appropriate.

Signed-off-by: Jeff Garzik <jeff@xxxxxxxxxx>

drivers/scsi/arcmsr/arcmsr_hba.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

f9f7b1384995626e1a80322faef3f7cca97aa7ae
diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index 0ddfc21..ae26ed4 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -540,7 +540,7 @@ static uint8_t arcmsr_wait_msgint_ready(struct AdapterControlBlock *acb)
, &reg->outbound_intstatus);
return 0x00;
}
- msleep_interruptible(10);
+ msleep(10);
}/*max 1 seconds*/
} while (Retries++ < 20);/*max 20 sec*/
return 0xff;
@@ -1421,8 +1421,10 @@ static void arcmsr_iop_reset(struct AdapterControlBlock *acb)
if (atomic_read(&acb->ccboutstandingcount) != 0) {
/* talk to iop 331 outstanding command aborted */
arcmsr_abort_allcmd(acb);
+
/* wait for 3 sec for all command aborted*/
- msleep_interruptible(3000);
+ ssleep(3);
+
/* disable all outbound interrupt */
intmask_org = arcmsr_disable_outbound_ints(acb);
/* clear all outbound posted Q */
@@ -1468,7 +1470,7 @@ static void arcmsr_abort_one_cmd(struct AdapterControlBlock *acb,
/*
** Wait for 3 sec for all command done.
*/
- msleep_interruptible(3000);
+ ssleep(3);

intmask = arcmsr_disable_outbound_ints(acb);
arcmsr_polling_ccbdone(acb, ccb);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: FW: use of base image / delta image for automated recovery from attacks
    ... the performance and storage penalties accumulate. ... The problem is that if you commit too eagerly, ... > But in your typical web application, most partitions do not accrue important ... > doing this in hardware, ...
    (SecProg)
  • Re: 24 lost ticks with 2.6.20.10 kernel
    ... The main issue is that we read the hardware ... strange that you are losing that many ticks IMHO, ... This reverts commit 60cba200f11b6f90f35634c5cd608773ae3721b7. ...
    (Linux-Kernel)
  • Re: Self restarting property of RTOS-How it works?
    ... >operator did an ABA type mode change with out waiting for either step ... with hardware that wouldn't let it operate if the mechanical moving ... I have worked on systems for aircraft where the software engineer ... with a reward of an extra week of vacation time for writing that code. ...
    (comp.arch.embedded)
  • Re: 24 lost ticks with 2.6.20.10 kernel
    ... The main issue is that we read the hardware ... strange that you are losing that many ticks IMHO, ... This reverts commit 60cba200f11b6f90f35634c5cd608773ae3721b7. ...
    (Linux-Kernel)
  • Re: remove blk_queue_max_phys_segments in libata
    ... LIBATA_MAX_PRD is the maximum number of DMA scatter/gather elements ... The basic issue is that the physical segment ... The commit message itself has good reasoning as well. ... naming, but essentially the 'hardware' ...
    (Linux-Kernel)