mirror of https://gitee.com/openkylin/linux.git
[SCSI] lpfc 8.3.42: Fixed inconsistent spin lock usage.
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
This commit is contained in:
parent
afbd8d8884
commit
164cecd1b9
|
@ -3031,10 +3031,10 @@ lpfc_sli4_xri_sgl_update(struct lpfc_hba *phba)
|
||||||
phba->sli4_hba.scsi_xri_max);
|
phba->sli4_hba.scsi_xri_max);
|
||||||
|
|
||||||
spin_lock_irq(&phba->scsi_buf_list_get_lock);
|
spin_lock_irq(&phba->scsi_buf_list_get_lock);
|
||||||
spin_lock_irq(&phba->scsi_buf_list_put_lock);
|
spin_lock(&phba->scsi_buf_list_put_lock);
|
||||||
list_splice_init(&phba->lpfc_scsi_buf_list_get, &scsi_sgl_list);
|
list_splice_init(&phba->lpfc_scsi_buf_list_get, &scsi_sgl_list);
|
||||||
list_splice(&phba->lpfc_scsi_buf_list_put, &scsi_sgl_list);
|
list_splice(&phba->lpfc_scsi_buf_list_put, &scsi_sgl_list);
|
||||||
spin_unlock_irq(&phba->scsi_buf_list_put_lock);
|
spin_unlock(&phba->scsi_buf_list_put_lock);
|
||||||
spin_unlock_irq(&phba->scsi_buf_list_get_lock);
|
spin_unlock_irq(&phba->scsi_buf_list_get_lock);
|
||||||
|
|
||||||
if (phba->sli4_hba.scsi_xri_cnt > phba->sli4_hba.scsi_xri_max) {
|
if (phba->sli4_hba.scsi_xri_cnt > phba->sli4_hba.scsi_xri_max) {
|
||||||
|
@ -3070,10 +3070,10 @@ lpfc_sli4_xri_sgl_update(struct lpfc_hba *phba)
|
||||||
psb->cur_iocbq.sli4_xritag = phba->sli4_hba.xri_ids[lxri];
|
psb->cur_iocbq.sli4_xritag = phba->sli4_hba.xri_ids[lxri];
|
||||||
}
|
}
|
||||||
spin_lock_irq(&phba->scsi_buf_list_get_lock);
|
spin_lock_irq(&phba->scsi_buf_list_get_lock);
|
||||||
spin_lock_irq(&phba->scsi_buf_list_put_lock);
|
spin_lock(&phba->scsi_buf_list_put_lock);
|
||||||
list_splice_init(&scsi_sgl_list, &phba->lpfc_scsi_buf_list_get);
|
list_splice_init(&scsi_sgl_list, &phba->lpfc_scsi_buf_list_get);
|
||||||
INIT_LIST_HEAD(&phba->lpfc_scsi_buf_list_put);
|
INIT_LIST_HEAD(&phba->lpfc_scsi_buf_list_put);
|
||||||
spin_unlock_irq(&phba->scsi_buf_list_put_lock);
|
spin_unlock(&phba->scsi_buf_list_put_lock);
|
||||||
spin_unlock_irq(&phba->scsi_buf_list_get_lock);
|
spin_unlock_irq(&phba->scsi_buf_list_get_lock);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -926,10 +926,10 @@ lpfc_sli4_repost_scsi_sgl_list(struct lpfc_hba *phba)
|
||||||
|
|
||||||
/* get all SCSI buffers need to repost to a local list */
|
/* get all SCSI buffers need to repost to a local list */
|
||||||
spin_lock_irq(&phba->scsi_buf_list_get_lock);
|
spin_lock_irq(&phba->scsi_buf_list_get_lock);
|
||||||
spin_lock_irq(&phba->scsi_buf_list_put_lock);
|
spin_lock(&phba->scsi_buf_list_put_lock);
|
||||||
list_splice_init(&phba->lpfc_scsi_buf_list_get, &post_sblist);
|
list_splice_init(&phba->lpfc_scsi_buf_list_get, &post_sblist);
|
||||||
list_splice(&phba->lpfc_scsi_buf_list_put, &post_sblist);
|
list_splice(&phba->lpfc_scsi_buf_list_put, &post_sblist);
|
||||||
spin_unlock_irq(&phba->scsi_buf_list_put_lock);
|
spin_unlock(&phba->scsi_buf_list_put_lock);
|
||||||
spin_unlock_irq(&phba->scsi_buf_list_get_lock);
|
spin_unlock_irq(&phba->scsi_buf_list_get_lock);
|
||||||
|
|
||||||
/* post the list of scsi buffer sgls to port if available */
|
/* post the list of scsi buffer sgls to port if available */
|
||||||
|
@ -1137,22 +1137,21 @@ lpfc_get_scsi_buf_s3(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp)
|
||||||
{
|
{
|
||||||
struct lpfc_scsi_buf * lpfc_cmd = NULL;
|
struct lpfc_scsi_buf * lpfc_cmd = NULL;
|
||||||
struct list_head *scsi_buf_list_get = &phba->lpfc_scsi_buf_list_get;
|
struct list_head *scsi_buf_list_get = &phba->lpfc_scsi_buf_list_get;
|
||||||
unsigned long gflag = 0;
|
unsigned long iflag = 0;
|
||||||
unsigned long pflag = 0;
|
|
||||||
|
|
||||||
spin_lock_irqsave(&phba->scsi_buf_list_get_lock, gflag);
|
spin_lock_irqsave(&phba->scsi_buf_list_get_lock, iflag);
|
||||||
list_remove_head(scsi_buf_list_get, lpfc_cmd, struct lpfc_scsi_buf,
|
list_remove_head(scsi_buf_list_get, lpfc_cmd, struct lpfc_scsi_buf,
|
||||||
list);
|
list);
|
||||||
if (!lpfc_cmd) {
|
if (!lpfc_cmd) {
|
||||||
spin_lock_irqsave(&phba->scsi_buf_list_put_lock, pflag);
|
spin_lock(&phba->scsi_buf_list_put_lock);
|
||||||
list_splice(&phba->lpfc_scsi_buf_list_put,
|
list_splice(&phba->lpfc_scsi_buf_list_put,
|
||||||
&phba->lpfc_scsi_buf_list_get);
|
&phba->lpfc_scsi_buf_list_get);
|
||||||
INIT_LIST_HEAD(&phba->lpfc_scsi_buf_list_put);
|
INIT_LIST_HEAD(&phba->lpfc_scsi_buf_list_put);
|
||||||
list_remove_head(scsi_buf_list_get, lpfc_cmd,
|
list_remove_head(scsi_buf_list_get, lpfc_cmd,
|
||||||
struct lpfc_scsi_buf, list);
|
struct lpfc_scsi_buf, list);
|
||||||
spin_unlock_irqrestore(&phba->scsi_buf_list_put_lock, pflag);
|
spin_unlock(&phba->scsi_buf_list_put_lock);
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&phba->scsi_buf_list_get_lock, gflag);
|
spin_unlock_irqrestore(&phba->scsi_buf_list_get_lock, iflag);
|
||||||
return lpfc_cmd;
|
return lpfc_cmd;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -1170,11 +1169,10 @@ static struct lpfc_scsi_buf*
|
||||||
lpfc_get_scsi_buf_s4(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp)
|
lpfc_get_scsi_buf_s4(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp)
|
||||||
{
|
{
|
||||||
struct lpfc_scsi_buf *lpfc_cmd, *lpfc_cmd_next;
|
struct lpfc_scsi_buf *lpfc_cmd, *lpfc_cmd_next;
|
||||||
unsigned long gflag = 0;
|
unsigned long iflag = 0;
|
||||||
unsigned long pflag = 0;
|
|
||||||
int found = 0;
|
int found = 0;
|
||||||
|
|
||||||
spin_lock_irqsave(&phba->scsi_buf_list_get_lock, gflag);
|
spin_lock_irqsave(&phba->scsi_buf_list_get_lock, iflag);
|
||||||
list_for_each_entry_safe(lpfc_cmd, lpfc_cmd_next,
|
list_for_each_entry_safe(lpfc_cmd, lpfc_cmd_next,
|
||||||
&phba->lpfc_scsi_buf_list_get, list) {
|
&phba->lpfc_scsi_buf_list_get, list) {
|
||||||
if (lpfc_test_rrq_active(phba, ndlp,
|
if (lpfc_test_rrq_active(phba, ndlp,
|
||||||
|
@ -1185,11 +1183,11 @@ lpfc_get_scsi_buf_s4(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!found) {
|
if (!found) {
|
||||||
spin_lock_irqsave(&phba->scsi_buf_list_put_lock, pflag);
|
spin_lock(&phba->scsi_buf_list_put_lock);
|
||||||
list_splice(&phba->lpfc_scsi_buf_list_put,
|
list_splice(&phba->lpfc_scsi_buf_list_put,
|
||||||
&phba->lpfc_scsi_buf_list_get);
|
&phba->lpfc_scsi_buf_list_get);
|
||||||
INIT_LIST_HEAD(&phba->lpfc_scsi_buf_list_put);
|
INIT_LIST_HEAD(&phba->lpfc_scsi_buf_list_put);
|
||||||
spin_unlock_irqrestore(&phba->scsi_buf_list_put_lock, pflag);
|
spin_unlock(&phba->scsi_buf_list_put_lock);
|
||||||
list_for_each_entry_safe(lpfc_cmd, lpfc_cmd_next,
|
list_for_each_entry_safe(lpfc_cmd, lpfc_cmd_next,
|
||||||
&phba->lpfc_scsi_buf_list_get, list) {
|
&phba->lpfc_scsi_buf_list_get, list) {
|
||||||
if (lpfc_test_rrq_active(
|
if (lpfc_test_rrq_active(
|
||||||
|
@ -1200,7 +1198,7 @@ lpfc_get_scsi_buf_s4(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&phba->scsi_buf_list_get_lock, gflag);
|
spin_unlock_irqrestore(&phba->scsi_buf_list_get_lock, iflag);
|
||||||
if (!found)
|
if (!found)
|
||||||
return NULL;
|
return NULL;
|
||||||
return lpfc_cmd;
|
return lpfc_cmd;
|
||||||
|
|
Loading…
Reference in New Issue