public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 14/22] lpfc 8.3.39: Fixed bad book keeping in posting els sgls to port
@ 2013-04-18  0:18 James Smart
  0 siblings, 0 replies; only message in thread
From: James Smart @ 2013-04-18  0:18 UTC (permalink / raw)
  To: linux-scsi

Fixed bad book keeping in posting els sgls to port


Signed-off-by: James Smart <james.smart@emulex.com>

 ---

 lpfc_sli.c |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)


diff -upNr a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
--- a/drivers/scsi/lpfc/lpfc_sli.c	2013-04-15 18:26:39.379041174 -0400
+++ b/drivers/scsi/lpfc/lpfc_sli.c	2013-04-15 18:26:45.706041318 -0400
@@ -5999,7 +5999,7 @@ lpfc_sli4_repost_els_sgl_list(struct lpf
 	struct lpfc_sglq *sglq_entry = NULL;
 	struct lpfc_sglq *sglq_entry_next = NULL;
 	struct lpfc_sglq *sglq_entry_first = NULL;
-	int status, post_cnt = 0, num_posted = 0, block_cnt = 0;
+	int status, total_cnt, post_cnt = 0, num_posted = 0, block_cnt = 0;
 	int last_xritag = NO_XRI;
 	LIST_HEAD(prep_sgl_list);
 	LIST_HEAD(blck_sgl_list);
@@ -6011,6 +6011,7 @@ lpfc_sli4_repost_els_sgl_list(struct lpf
 	list_splice_init(&phba->sli4_hba.lpfc_sgl_list, &allc_sgl_list);
 	spin_unlock_irq(&phba->hbalock);
 
+	total_cnt = phba->sli4_hba.els_xri_cnt;
 	list_for_each_entry_safe(sglq_entry, sglq_entry_next,
 				 &allc_sgl_list, list) {
 		list_del_init(&sglq_entry->list);
@@ -6062,9 +6063,7 @@ lpfc_sli4_repost_els_sgl_list(struct lpf
 						sglq_entry->sli4_xritag);
 					list_add_tail(&sglq_entry->list,
 						      &free_sgl_list);
-					spin_lock_irq(&phba->hbalock);
-					phba->sli4_hba.els_xri_cnt--;
-					spin_unlock_irq(&phba->hbalock);
+					total_cnt--;
 				}
 			}
 		}
@@ -6092,9 +6091,7 @@ lpfc_sli4_repost_els_sgl_list(struct lpf
 					(sglq_entry_first->sli4_xritag +
 					 post_cnt - 1));
 			list_splice_init(&blck_sgl_list, &free_sgl_list);
-			spin_lock_irq(&phba->hbalock);
-			phba->sli4_hba.els_xri_cnt -= post_cnt;
-			spin_unlock_irq(&phba->hbalock);
+			total_cnt -= post_cnt;
 		}
 
 		/* don't reset xirtag due to hole in xri block */
@@ -6104,6 +6101,8 @@ lpfc_sli4_repost_els_sgl_list(struct lpf
 		/* reset els sgl post count for next round of posting */
 		post_cnt = 0;
 	}
+	/* update the number of XRIs posted for ELS */
+	phba->sli4_hba.els_xri_cnt = total_cnt;
 
 	/* free the els sgls failed to post */
 	lpfc_free_sgl_list(phba, &free_sgl_list);




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-04-18  0:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-18  0:18 [PATCH 14/22] lpfc 8.3.39: Fixed bad book keeping in posting els sgls to port James Smart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox