diff options
Diffstat (limited to 'drivers/message/fusion/mptspi.c')
-rw-r--r-- | drivers/message/fusion/mptspi.c | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index 85f21b54cb7d..d75f7ffbb02e 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c | |||
@@ -96,14 +96,13 @@ static int mptspiTaskCtx = -1; | |||
96 | static int mptspiInternalCtx = -1; /* Used only for internal commands */ | 96 | static int mptspiInternalCtx = -1; /* Used only for internal commands */ |
97 | 97 | ||
98 | /** | 98 | /** |
99 | * mptspi_setTargetNegoParms - Update the target negotiation | 99 | * mptspi_setTargetNegoParms - Update the target negotiation parameters |
100 | * parameters based on the the Inquiry data, adapter capabilities, | ||
101 | * and NVRAM settings | ||
102 | * | ||
103 | * @hd: Pointer to a SCSI Host Structure | 100 | * @hd: Pointer to a SCSI Host Structure |
104 | * @vtarget: per target private data | 101 | * @target: per target private data |
105 | * @sdev: SCSI device | 102 | * @sdev: SCSI device |
106 | * | 103 | * |
104 | * Update the target negotiation parameters based on the the Inquiry | ||
105 | * data, adapter capabilities, and NVRAM settings. | ||
107 | **/ | 106 | **/ |
108 | static void | 107 | static void |
109 | mptspi_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtTarget *target, | 108 | mptspi_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtTarget *target, |
@@ -234,7 +233,7 @@ mptspi_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtTarget *target, | |||
234 | /** | 233 | /** |
235 | * mptspi_writeIOCPage4 - write IOC Page 4 | 234 | * mptspi_writeIOCPage4 - write IOC Page 4 |
236 | * @hd: Pointer to a SCSI Host Structure | 235 | * @hd: Pointer to a SCSI Host Structure |
237 | * @channel: | 236 | * @channel: channel number |
238 | * @id: write IOC Page4 for this ID & Bus | 237 | * @id: write IOC Page4 for this ID & Bus |
239 | * | 238 | * |
240 | * Return: -EAGAIN if unable to obtain a Message Frame | 239 | * Return: -EAGAIN if unable to obtain a Message Frame |
@@ -446,7 +445,7 @@ static int mptspi_target_alloc(struct scsi_target *starget) | |||
446 | return 0; | 445 | return 0; |
447 | } | 446 | } |
448 | 447 | ||
449 | void | 448 | static void |
450 | mptspi_target_destroy(struct scsi_target *starget) | 449 | mptspi_target_destroy(struct scsi_target *starget) |
451 | { | 450 | { |
452 | if (starget->hostdata) | 451 | if (starget->hostdata) |
@@ -677,7 +676,9 @@ static void mptspi_dv_device(struct _MPT_SCSI_HOST *hd, | |||
677 | return; | 676 | return; |
678 | } | 677 | } |
679 | 678 | ||
679 | hd->spi_pending |= (1 << sdev->id); | ||
680 | spi_dv_device(sdev); | 680 | spi_dv_device(sdev); |
681 | hd->spi_pending &= ~(1 << sdev->id); | ||
681 | 682 | ||
682 | if (sdev->channel == 1 && | 683 | if (sdev->channel == 1 && |
683 | mptscsih_quiesce_raid(hd, 0, vtarget->channel, vtarget->id) < 0) | 684 | mptscsih_quiesce_raid(hd, 0, vtarget->channel, vtarget->id) < 0) |
@@ -1203,11 +1204,27 @@ mptspi_dv_renegotiate_work(struct work_struct *work) | |||
1203 | container_of(work, struct work_queue_wrapper, work); | 1204 | container_of(work, struct work_queue_wrapper, work); |
1204 | struct _MPT_SCSI_HOST *hd = wqw->hd; | 1205 | struct _MPT_SCSI_HOST *hd = wqw->hd; |
1205 | 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; | ||
1206 | 1210 | ||
1207 | kfree(wqw); | 1211 | kfree(wqw); |
1208 | 1212 | ||
1209 | shost_for_each_device(sdev, hd->ioc->sh) | 1213 | if (hd->spi_pending) { |
1210 | 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 | } | ||
1211 | } | 1228 | } |
1212 | 1229 | ||
1213 | static void | 1230 | static void |
@@ -1453,6 +1470,7 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1453 | init_waitqueue_head(&hd->scandv_waitq); | 1470 | init_waitqueue_head(&hd->scandv_waitq); |
1454 | hd->scandv_wait_done = 0; | 1471 | hd->scandv_wait_done = 0; |
1455 | hd->last_queue_full = 0; | 1472 | hd->last_queue_full = 0; |
1473 | hd->spi_pending = 0; | ||
1456 | 1474 | ||
1457 | /* Some versions of the firmware don't support page 0; without | 1475 | /* Some versions of the firmware don't support page 0; without |
1458 | * that we can't get the parameters */ | 1476 | * that we can't get the parameters */ |