aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptspi.c
diff options
context:
space:
mode:
authorEric Moore <eric.moore@lsi.com>2007-02-07 18:51:40 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-04-30 11:22:00 -0400
commit7297824581755593535fc97d2c8b6c47e2dc2db6 (patch)
tree0bfcac9cff647e370764dba070ef66df21e3ba22 /drivers/message/fusion/mptspi.c
parent4e08df3f91837656c36712f559d5ce8d80852760 (diff)
[SCSI] fusion: fix domain validation loops
After host reset, the device are programmed to default asyn narrow nego. We need to reprogram the parameter back to previous values. If the host reset is called as a result of spi_dv_device() commands timing out, its possible to get into an infinite loop of dv to host reset. This will prevent that case, as we merely program old values. If host reset is called outside context of domain validation, then we can call spi_dv_device. Signed-off-by: Eric Moore <Eric.Moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message/fusion/mptspi.c')
-rw-r--r--drivers/message/fusion/mptspi.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
index b08416f84edc..d75f7ffbb02e 100644
--- a/drivers/message/fusion/mptspi.c
+++ b/drivers/message/fusion/mptspi.c
@@ -676,7 +676,9 @@ static void mptspi_dv_device(struct _MPT_SCSI_HOST *hd,
676 return; 676 return;
677 } 677 }
678 678
679 hd->spi_pending |= (1 << sdev->id);
679 spi_dv_device(sdev); 680 spi_dv_device(sdev);
681 hd->spi_pending &= ~(1 << sdev->id);
680 682
681 if (sdev->channel == 1 && 683 if (sdev->channel == 1 &&
682 mptscsih_quiesce_raid(hd, 0, vtarget->channel, vtarget->id) < 0) 684 mptscsih_quiesce_raid(hd, 0, vtarget->channel, vtarget->id) < 0)
@@ -1202,11 +1204,27 @@ mptspi_dv_renegotiate_work(struct work_struct *work)
1202 container_of(work, struct work_queue_wrapper, work); 1204 container_of(work, struct work_queue_wrapper, work);
1203 struct _MPT_SCSI_HOST *hd = wqw->hd; 1205 struct _MPT_SCSI_HOST *hd = wqw->hd;
1204 struct scsi_device *sdev; 1206 struct scsi_device *sdev;
1207 struct scsi_target *starget;
1208 struct _CONFIG_PAGE_SCSI_DEVICE_1 pg1;
1209 u32 nego;
1205 1210
1206 kfree(wqw); 1211 kfree(wqw);
1207 1212
1208 shost_for_each_device(sdev, hd->ioc->sh) 1213 if (hd->spi_pending) {
1209 mptspi_dv_device(hd, sdev); 1214 shost_for_each_device(sdev, hd->ioc->sh) {
1215 if (hd->spi_pending & (1 << sdev->id))
1216 continue;
1217 starget = scsi_target(sdev);
1218 nego = mptspi_getRP(starget);
1219 pg1.RequestedParameters = cpu_to_le32(nego);
1220 pg1.Reserved = 0;
1221 pg1.Configuration = 0;
1222 mptspi_write_spi_device_pg1(starget, &pg1);
1223 }
1224 } else {
1225 shost_for_each_device(sdev, hd->ioc->sh)
1226 mptspi_dv_device(hd, sdev);
1227 }
1210} 1228}
1211 1229
1212static void 1230static void
@@ -1452,6 +1470,7 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1452 init_waitqueue_head(&hd->scandv_waitq); 1470 init_waitqueue_head(&hd->scandv_waitq);
1453 hd->scandv_wait_done = 0; 1471 hd->scandv_wait_done = 0;
1454 hd->last_queue_full = 0; 1472 hd->last_queue_full = 0;
1473 hd->spi_pending = 0;
1455 1474
1456 /* Some versions of the firmware don't support page 0; without 1475 /* Some versions of the firmware don't support page 0; without
1457 * that we can't get the parameters */ 1476 * that we can't get the parameters */