On Tuesday, January 17, 2006 6:43 AM, Christoph Hellwig wrote: > The timeout selection should probably be done in a little > helper instead > of duplicated in a few places. Updated patch below: > > > Index: linux-2.6/drivers/message/fusion/mptscsih.c > =================================================================== > --- linux-2.6.orig/drivers/message/fusion/mptscsih.c > 2006-01-17 14:07:57.000000000 +0100 > +++ linux-2.6/drivers/message/fusion/mptscsih.c > 2006-01-17 14:10:55.000000000 +0100 > @@ -1719,6 +1719,20 @@ > return retval; > } > > +static int > +mptscsih_get_tm_timeout(MPT_ADAPTER *ioc) > +{ > + switch (ioc->bus_type) { > + case FC: > + return 40; > + case SAS: > + return 10; > + case SPI: > + default: > + return 2; > + } > +} > + > Good idea to combine everything into mptscsih_get_tm_timeout. However the SPI timeout is 2 seconds for eh_abort_handler, and 5 seconds for eh_device_reset_handler and eh_bus_reset_handler. It would be better to go with 5 seconds in the SPI case, as the driver timeout needs to be be longer than the firmware timeout. Index: linux-2.6/drivers/message/fusion/mptscsih.c =================================================================== --- linux-2.6.orig/drivers/message/fusion/mptscsih.c 2006-01-17 14:07:57.000000000 +0100 +++ linux-2.6/drivers/message/fusion/mptscsih.c 2006-01-17 14:10:55.000000000 +0100 @@ -1719,6 +1719,20 @@ return retval; } +static int +mptscsih_get_tm_timeout(MPT_ADAPTER *ioc) +{ + switch (ioc->bus_type) { + case FC: + return 40; + case SAS: + return 10; + case SPI: + default: + return 5; + } +} + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- =-=-=*/ /** * mptscsih_abort - Abort linux scsi_cmnd routine, new_eh variant @@ -1790,7 +1804,7 @@ vdev = SCpnt->device->hostdata; retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK, vdev->bus_id, vdev->target_id, vdev->lun, - ctx2abort, 2 /* 2 second timeout */); + ctx2abort, mptscsih_get_tm_timeout(ioc)); printk (KERN_WARNING MYNAM ": %s: task abort: %s (sc=%p)\n", hd->ioc->name, @@ -1841,7 +1855,7 @@ vdev = SCpnt->device->hostdata; retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET, vdev->bus_id, vdev->target_id, - 0, 0, 5 /* 5 second timeout */); + 0, 0, mptscsih_get_tm_timeout(hd->ioc)); printk (KERN_WARNING MYNAM ": %s: target reset: %s (sc=%p)\n", hd->ioc->name, @@ -1891,7 +1905,7 @@ vdev = SCpnt->device->hostdata; retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS, - vdev->bus_id, 0, 0, 0, 5 /* 5 second timeout */); + vdev->bus_id, 0, 0, 0, mptscsih_get_tm_timeout(hd->ioc)); printk (KERN_WARNING MYNAM ": %s: bus reset: %s (sc=%p)\n", hd->ioc->name, - : send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html