aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_attr.c
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2007-04-25 09:51:30 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-05-06 10:33:12 -0400
commit1dcb58e5680b6673bf984696d3d8b9033b6e41bf (patch)
tree7421ad398ef2ee04d2c7b22bb975219593885f01 /drivers/scsi/lpfc/lpfc_attr.c
parente555db930f7512491485cfc43df4306192835373 (diff)
[SCSI] lpfc 8.1.12 : Misc bug fixes and code cleanup
Misc bug fixes and code cleanup: - Fix system hang while running on systems with IOMMU - Fix use after free issues with rports - Don't free mailbox structure if it's still on the mboxq list - Decrement txq_cnt rather than txcmplq_cnt when parsing the txq list - Use msleep for long delays to prevent soft lockup bug check - Don't remove node during dev_loss_tmo if discovery is active - Fix memory leaks in get/reset statistics and link attention paths - Fixed lpfc_ns_rsp to handle entire GID_FT response. - mbox interface should use MAILBOX_CMD_SIZE rather than sizeof(MAILBOX_t) - Fixed bug check in add_timer. - Fixup messages 0116, 0117, and 0128 to report ELS I/O tag. - Remove unused parameter to lpfc_cleanup. - Change mailbox timeout handling. - Remove unused buflist. Code cleanup. Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_attr.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_attr.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index f247e786af99..6cc88b198fa3 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -1227,11 +1227,11 @@ sysfs_mbox_read(struct kobject *kobj, char *buf, loff_t off, size_t count)
1227 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata; 1227 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata;
1228 int rc; 1228 int rc;
1229 1229
1230 if (off > sizeof(MAILBOX_t)) 1230 if (off > MAILBOX_CMD_SIZE)
1231 return -ERANGE; 1231 return -ERANGE;
1232 1232
1233 if ((count + off) > sizeof(MAILBOX_t)) 1233 if ((count + off) > MAILBOX_CMD_SIZE)
1234 count = sizeof(MAILBOX_t) - off; 1234 count = MAILBOX_CMD_SIZE - off;
1235 1235
1236 if (off % 4 || count % 4 || (unsigned long)buf % 4) 1236 if (off % 4 || count % 4 || (unsigned long)buf % 4)
1237 return -EINVAL; 1237 return -EINVAL;
@@ -1326,6 +1326,11 @@ sysfs_mbox_read(struct kobject *kobj, char *buf, loff_t off, size_t count)
1326 } 1326 }
1327 1327
1328 if (rc != MBX_SUCCESS) { 1328 if (rc != MBX_SUCCESS) {
1329 if (rc == MBX_TIMEOUT) {
1330 phba->sysfs_mbox.mbox->mbox_cmpl =
1331 lpfc_sli_def_mbox_cmpl;
1332 phba->sysfs_mbox.mbox = NULL;
1333 }
1329 sysfs_mbox_idle(phba); 1334 sysfs_mbox_idle(phba);
1330 spin_unlock_irq(host->host_lock); 1335 spin_unlock_irq(host->host_lock);
1331 return (rc == MBX_TIMEOUT) ? -ETIME : -ENODEV; 1336 return (rc == MBX_TIMEOUT) ? -ETIME : -ENODEV;
@@ -1344,7 +1349,7 @@ sysfs_mbox_read(struct kobject *kobj, char *buf, loff_t off, size_t count)
1344 1349
1345 phba->sysfs_mbox.offset = off + count; 1350 phba->sysfs_mbox.offset = off + count;
1346 1351
1347 if (phba->sysfs_mbox.offset == sizeof(MAILBOX_t)) 1352 if (phba->sysfs_mbox.offset == MAILBOX_CMD_SIZE)
1348 sysfs_mbox_idle(phba); 1353 sysfs_mbox_idle(phba);
1349 1354
1350 spin_unlock_irq(phba->host->host_lock); 1355 spin_unlock_irq(phba->host->host_lock);
@@ -1358,7 +1363,7 @@ static struct bin_attribute sysfs_mbox_attr = {
1358 .mode = S_IRUSR | S_IWUSR, 1363 .mode = S_IRUSR | S_IWUSR,
1359 .owner = THIS_MODULE, 1364 .owner = THIS_MODULE,
1360 }, 1365 },
1361 .size = sizeof(MAILBOX_t), 1366 .size = MAILBOX_CMD_SIZE,
1362 .read = sysfs_mbox_read, 1367 .read = sysfs_mbox_read,
1363 .write = sysfs_mbox_write, 1368 .write = sysfs_mbox_write,
1364}; 1369};
@@ -1631,6 +1636,8 @@ lpfc_get_stats(struct Scsi_Host *shost)
1631 else 1636 else
1632 hs->seconds_since_last_reset = seconds - psli->stats_start; 1637 hs->seconds_since_last_reset = seconds - psli->stats_start;
1633 1638
1639 mempool_free(pmboxq, phba->mbox_mem_pool);
1640
1634 return hs; 1641 return hs;
1635} 1642}
1636 1643
@@ -1699,6 +1706,8 @@ lpfc_reset_stats(struct Scsi_Host *shost)
1699 1706
1700 psli->stats_start = get_seconds(); 1707 psli->stats_start = get_seconds();
1701 1708
1709 mempool_free(pmboxq, phba->mbox_mem_pool);
1710
1702 return; 1711 return;
1703} 1712}
1704 1713