diff options
author | James Smart <James.Smart@Emulex.Com> | 2006-08-01 07:34:00 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-08-06 12:28:41 -0400 |
commit | 8f6d98d2e05c38cb08fbda5e38e5f87d361c3cac (patch) | |
tree | a1a35b9134643610667451c2c3ea9a7a4ac1508b /drivers/scsi/lpfc | |
parent | 1c067a42413c4f39c907443b8f5979cd4d82f0ff (diff) |
[SCSI] lpfc 8.1.7 : Short bug fixes
Short bug fixes:
- Fix iocbq list corruption due to missing list_del's in ct handling
- Missing unlock in lpfc_sli_next_iotag()
- Fix initialization of can_queue value
- Differentiate sysfs mailbox errors with different codes.
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 6 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_ct.c | 1 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 12 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 5 |
4 files changed, 18 insertions, 6 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 4ccce1474f2d..76f8bd53e230 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c | |||
@@ -884,7 +884,7 @@ sysfs_mbox_write(struct kobject *kobj, char *buf, loff_t off, size_t count) | |||
884 | phba->sysfs_mbox.mbox == NULL ) { | 884 | phba->sysfs_mbox.mbox == NULL ) { |
885 | sysfs_mbox_idle(phba); | 885 | sysfs_mbox_idle(phba); |
886 | spin_unlock_irq(host->host_lock); | 886 | spin_unlock_irq(host->host_lock); |
887 | return -EINVAL; | 887 | return -EAGAIN; |
888 | } | 888 | } |
889 | } | 889 | } |
890 | 890 | ||
@@ -1008,7 +1008,7 @@ sysfs_mbox_read(struct kobject *kobj, char *buf, loff_t off, size_t count) | |||
1008 | if (rc != MBX_SUCCESS) { | 1008 | if (rc != MBX_SUCCESS) { |
1009 | sysfs_mbox_idle(phba); | 1009 | sysfs_mbox_idle(phba); |
1010 | spin_unlock_irq(host->host_lock); | 1010 | spin_unlock_irq(host->host_lock); |
1011 | return -ENODEV; | 1011 | return (rc == MBX_TIMEOUT) ? -ETIME : -ENODEV; |
1012 | } | 1012 | } |
1013 | phba->sysfs_mbox.state = SMBOX_READING; | 1013 | phba->sysfs_mbox.state = SMBOX_READING; |
1014 | } | 1014 | } |
@@ -1017,7 +1017,7 @@ sysfs_mbox_read(struct kobject *kobj, char *buf, loff_t off, size_t count) | |||
1017 | printk(KERN_WARNING "mbox_read: Bad State\n"); | 1017 | printk(KERN_WARNING "mbox_read: Bad State\n"); |
1018 | sysfs_mbox_idle(phba); | 1018 | sysfs_mbox_idle(phba); |
1019 | spin_unlock_irq(host->host_lock); | 1019 | spin_unlock_irq(host->host_lock); |
1020 | return -EINVAL; | 1020 | return -EAGAIN; |
1021 | } | 1021 | } |
1022 | 1022 | ||
1023 | memcpy(buf, (uint8_t *) & phba->sysfs_mbox.mbox->mb + off, count); | 1023 | memcpy(buf, (uint8_t *) & phba->sysfs_mbox.mbox->mb + off, count); |
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index b65ee57af53e..cab2d9dec088 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c | |||
@@ -131,6 +131,7 @@ lpfc_ct_unsol_event(struct lpfc_hba * phba, | |||
131 | } | 131 | } |
132 | 132 | ||
133 | ct_unsol_event_exit_piocbq: | 133 | ct_unsol_event_exit_piocbq: |
134 | list_del(&head); | ||
134 | if (pmbuf) { | 135 | if (pmbuf) { |
135 | list_for_each_entry_safe(matp, next_matp, &pmbuf->list, list) { | 136 | list_for_each_entry_safe(matp, next_matp, &pmbuf->list, list) { |
136 | lpfc_mbuf_free(phba, matp->virt, matp->phys); | 137 | lpfc_mbuf_free(phba, matp->virt, matp->phys); |
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index ef47b824cbed..16dc8c82b5ce 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -1616,7 +1616,11 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
1616 | goto out_free_iocbq; | 1616 | goto out_free_iocbq; |
1617 | } | 1617 | } |
1618 | 1618 | ||
1619 | /* We can rely on a queue depth attribute only after SLI HBA setup */ | 1619 | /* |
1620 | * Set initial can_queue value since 0 is no longer supported and | ||
1621 | * scsi_add_host will fail. This will be adjusted later based on the | ||
1622 | * max xri value determined in hba setup. | ||
1623 | */ | ||
1620 | host->can_queue = phba->cfg_hba_queue_depth - 10; | 1624 | host->can_queue = phba->cfg_hba_queue_depth - 10; |
1621 | 1625 | ||
1622 | /* Tell the midlayer we support 16 byte commands */ | 1626 | /* Tell the midlayer we support 16 byte commands */ |
@@ -1656,6 +1660,12 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
1656 | goto out_free_irq; | 1660 | goto out_free_irq; |
1657 | } | 1661 | } |
1658 | 1662 | ||
1663 | /* | ||
1664 | * hba setup may have changed the hba_queue_depth so we need to adjust | ||
1665 | * the value of can_queue. | ||
1666 | */ | ||
1667 | host->can_queue = phba->cfg_hba_queue_depth - 10; | ||
1668 | |||
1659 | lpfc_discovery_wait(phba); | 1669 | lpfc_discovery_wait(phba); |
1660 | 1670 | ||
1661 | if (phba->cfg_poll & DISABLE_FCP_RING_INT) { | 1671 | if (phba->cfg_poll & DISABLE_FCP_RING_INT) { |
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index fbf108c9625c..9802ee848f1d 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -320,7 +320,8 @@ lpfc_sli_next_iotag(struct lpfc_hba * phba, struct lpfc_iocbq * iocbq) | |||
320 | kfree(old_arr); | 320 | kfree(old_arr); |
321 | return iotag; | 321 | return iotag; |
322 | } | 322 | } |
323 | } | 323 | } else |
324 | spin_unlock_irq(phba->host->host_lock); | ||
324 | 325 | ||
325 | lpfc_printf_log(phba, KERN_ERR,LOG_SLI, | 326 | lpfc_printf_log(phba, KERN_ERR,LOG_SLI, |
326 | "%d:0318 Failed to allocate IOTAG.last IOTAG is %d\n", | 327 | "%d:0318 Failed to allocate IOTAG.last IOTAG is %d\n", |
@@ -1399,11 +1400,11 @@ lpfc_sli_handle_slow_ring_event(struct lpfc_hba * phba, | |||
1399 | next_iocb, | 1400 | next_iocb, |
1400 | &saveq->list, | 1401 | &saveq->list, |
1401 | list) { | 1402 | list) { |
1403 | list_del(&rspiocbp->list); | ||
1402 | lpfc_sli_release_iocbq(phba, | 1404 | lpfc_sli_release_iocbq(phba, |
1403 | rspiocbp); | 1405 | rspiocbp); |
1404 | } | 1406 | } |
1405 | } | 1407 | } |
1406 | |||
1407 | lpfc_sli_release_iocbq(phba, saveq); | 1408 | lpfc_sli_release_iocbq(phba, saveq); |
1408 | } | 1409 | } |
1409 | } | 1410 | } |