aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2010-10-22 11:06:56 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-10-26 11:42:27 -0400
commit5989b8d4dc0367a8c07cd1545dbad590a6de989d (patch)
treebb74cf25232c61538a499e7a5d5624a54a0b67a8 /drivers/scsi/lpfc
parent5af5eee7ca4051d8ca31edeb5216831da9625b5c (diff)
[SCSI] lpfc 8.3.18: Fix critical errors
Fix critical errors - Update send_scsi_event to validate pnode pointer active before copying the wwpn information. - Add a message, mailbox_idle, and unlock before failing SECURITY_MGMT or AUTH_PORT mailbox commands - Prevent spin_lock_irqsave from being called twice in a row. Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r--drivers/scsi/lpfc/lpfc_attr.c7
-rw-r--r--drivers/scsi/lpfc/lpfc_bsg.c4
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c9
3 files changed, 15 insertions, 5 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index f681eea57730..c1cbec01345d 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -3789,8 +3789,13 @@ sysfs_mbox_read(struct file *filp, struct kobject *kobj,
3789 break; 3789 break;
3790 case MBX_SECURITY_MGMT: 3790 case MBX_SECURITY_MGMT:
3791 case MBX_AUTH_PORT: 3791 case MBX_AUTH_PORT:
3792 if (phba->pci_dev_grp == LPFC_PCI_DEV_OC) 3792 if (phba->pci_dev_grp == LPFC_PCI_DEV_OC) {
3793 printk(KERN_WARNING "mbox_read:Command 0x%x "
3794 "is not permitted\n", pmb->mbxCommand);
3795 sysfs_mbox_idle(phba);
3796 spin_unlock_irq(&phba->hbalock);
3793 return -EPERM; 3797 return -EPERM;
3798 }
3794 break; 3799 break;
3795 case MBX_READ_SPARM64: 3800 case MBX_READ_SPARM64:
3796 case MBX_READ_LA: 3801 case MBX_READ_LA:
diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
index f5d60b55f53a..7260c3af555a 100644
--- a/drivers/scsi/lpfc/lpfc_bsg.c
+++ b/drivers/scsi/lpfc/lpfc_bsg.c
@@ -3142,12 +3142,12 @@ lpfc_bsg_menlo_cmd_cmp(struct lpfc_hba *phba,
3142 job = menlo->set_job; 3142 job = menlo->set_job;
3143 job->dd_data = NULL; /* so timeout handler does not reply */ 3143 job->dd_data = NULL; /* so timeout handler does not reply */
3144 3144
3145 spin_lock_irqsave(&phba->hbalock, flags); 3145 spin_lock(&phba->hbalock);
3146 cmdiocbq->iocb_flag |= LPFC_IO_WAKE; 3146 cmdiocbq->iocb_flag |= LPFC_IO_WAKE;
3147 if (cmdiocbq->context2 && rspiocbq) 3147 if (cmdiocbq->context2 && rspiocbq)
3148 memcpy(&((struct lpfc_iocbq *)cmdiocbq->context2)->iocb, 3148 memcpy(&((struct lpfc_iocbq *)cmdiocbq->context2)->iocb,
3149 &rspiocbq->iocb, sizeof(IOCB_t)); 3149 &rspiocbq->iocb, sizeof(IOCB_t));
3150 spin_unlock_irqrestore(&phba->hbalock, flags); 3150 spin_unlock(&phba->hbalock);
3151 3151
3152 bmp = menlo->bmp; 3152 bmp = menlo->bmp;
3153 rspiocbq = menlo->rspiocbq; 3153 rspiocbq = menlo->rspiocbq;
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 3a658953486c..f64b65a770b8 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -169,6 +169,7 @@ lpfc_update_stats(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd)
169 spin_lock_irqsave(shost->host_lock, flags); 169 spin_lock_irqsave(shost->host_lock, flags);
170 if (!vport->stat_data_enabled || 170 if (!vport->stat_data_enabled ||
171 vport->stat_data_blocked || 171 vport->stat_data_blocked ||
172 !pnode ||
172 !pnode->lat_data || 173 !pnode->lat_data ||
173 (phba->bucket_type == LPFC_NO_BUCKET)) { 174 (phba->bucket_type == LPFC_NO_BUCKET)) {
174 spin_unlock_irqrestore(shost->host_lock, flags); 175 spin_unlock_irqrestore(shost->host_lock, flags);
@@ -2040,6 +2041,9 @@ lpfc_send_scsi_error_event(struct lpfc_hba *phba, struct lpfc_vport *vport,
2040 struct lpfc_nodelist *pnode = lpfc_cmd->rdata->pnode; 2041 struct lpfc_nodelist *pnode = lpfc_cmd->rdata->pnode;
2041 unsigned long flags; 2042 unsigned long flags;
2042 2043
2044 if (!pnode || !NLP_CHK_NODE_ACT(pnode))
2045 return;
2046
2043 /* If there is queuefull or busy condition send a scsi event */ 2047 /* If there is queuefull or busy condition send a scsi event */
2044 if ((cmnd->result == SAM_STAT_TASK_SET_FULL) || 2048 if ((cmnd->result == SAM_STAT_TASK_SET_FULL) ||
2045 (cmnd->result == SAM_STAT_BUSY)) { 2049 (cmnd->result == SAM_STAT_BUSY)) {
@@ -3226,10 +3230,11 @@ lpfc_send_taskmgmt(struct lpfc_vport *vport, struct lpfc_rport_data *rdata,
3226 struct lpfc_scsi_buf *lpfc_cmd; 3230 struct lpfc_scsi_buf *lpfc_cmd;
3227 struct lpfc_iocbq *iocbq; 3231 struct lpfc_iocbq *iocbq;
3228 struct lpfc_iocbq *iocbqrsp; 3232 struct lpfc_iocbq *iocbqrsp;
3233 struct lpfc_nodelist *pnode = rdata->pnode;
3229 int ret; 3234 int ret;
3230 int status; 3235 int status;
3231 3236
3232 if (!rdata->pnode || !NLP_CHK_NODE_ACT(rdata->pnode)) 3237 if (!pnode || !NLP_CHK_NODE_ACT(pnode))
3233 return FAILED; 3238 return FAILED;
3234 3239
3235 lpfc_cmd = lpfc_get_scsi_buf(phba); 3240 lpfc_cmd = lpfc_get_scsi_buf(phba);
@@ -3256,7 +3261,7 @@ lpfc_send_taskmgmt(struct lpfc_vport *vport, struct lpfc_rport_data *rdata,
3256 "0702 Issue %s to TGT %d LUN %d " 3261 "0702 Issue %s to TGT %d LUN %d "
3257 "rpi x%x nlp_flag x%x\n", 3262 "rpi x%x nlp_flag x%x\n",
3258 lpfc_taskmgmt_name(task_mgmt_cmd), tgt_id, lun_id, 3263 lpfc_taskmgmt_name(task_mgmt_cmd), tgt_id, lun_id,
3259 rdata->pnode->nlp_rpi, rdata->pnode->nlp_flag); 3264 pnode->nlp_rpi, pnode->nlp_flag);
3260 3265
3261 status = lpfc_sli_issue_iocb_wait(phba, LPFC_FCP_RING, 3266 status = lpfc_sli_issue_iocb_wait(phba, LPFC_FCP_RING,
3262 iocbq, iocbqrsp, lpfc_cmd->timeout); 3267 iocbq, iocbqrsp, lpfc_cmd->timeout);