public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Smart <jsmart2021@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: James Smart <jsmart2021@gmail.com>,
	Dick Kennedy <dick.kennedy@broadcom.com>
Subject: [PATCH 2/9] lpfc: Maintain atomic consistency of queue_claimed flag
Date: Fri,  1 May 2020 14:43:03 -0700	[thread overview]
Message-ID: <20200501214310.91713-3-jsmart2021@gmail.com> (raw)
In-Reply-To: <20200501214310.91713-1-jsmart2021@gmail.com>

A previous change introduced the atomic use of queue_claimed flag for
eq's and cq's.  The code works fine, but the clearing of the
queue_claimed flag is not atomic.

Change queue_claimed = 0 into xchg(&queue_claimed, 0) to be consistent
for change under atomicity.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
---
 drivers/scsi/lpfc/lpfc_sli.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index b6fb665e6ec4..9ce37560f4c0 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -538,7 +538,7 @@ lpfc_sli4_process_eq(struct lpfc_hba *phba, struct lpfc_queue *eq,
 	if (count > eq->EQ_max_eqe)
 		eq->EQ_max_eqe = count;
 
-	eq->queue_claimed = 0;
+	xchg(&eq->queue_claimed, 0);
 
 rearm_and_exit:
 	/* Always clear the EQ. */
@@ -13694,7 +13694,7 @@ __lpfc_sli4_process_cq(struct lpfc_hba *phba, struct lpfc_queue *cq,
 				"0369 No entry from completion queue "
 				"qid=%d\n", cq->queue_id);
 
-	cq->queue_claimed = 0;
+	xchg(&cq->queue_claimed, 0);
 
 rearm_and_exit:
 	phba->sli4_hba.sli4_write_cq_db(phba, cq, consumed,
-- 
2.26.1


  parent reply	other threads:[~2020-05-01 21:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-01 21:43 [PATCH 0/9] lpfc: Update lpfc to revision 12.8.0.1 James Smart
2020-05-01 21:43 ` [PATCH 1/9] lpfc: Synchronize NVME transport and lpfc driver devloss_tmo James Smart
2020-05-03 14:42   ` James Smart
2020-05-07  9:11   ` Hannes Reinecke
2020-05-01 21:43 ` James Smart [this message]
2020-05-07  9:12   ` [PATCH 2/9] lpfc: Maintain atomic consistency of queue_claimed flag Hannes Reinecke
2020-05-01 21:43 ` [PATCH 3/9] lpfc: Remove re-binding of nvme rport during registration James Smart
2020-05-07  9:13   ` Hannes Reinecke
2020-05-01 21:43 ` [PATCH 4/9] lpfc: Fix negation of else clause in lpfc_prep_node_fc4type James Smart
2020-05-07  9:14   ` Hannes Reinecke
2020-05-01 21:43 ` [PATCH 5/9] lpfc: Change default queue allocation for reduced memory consumption James Smart
2020-05-07  9:49   ` Hannes Reinecke
2020-05-01 21:43 ` [PATCH 6/9] lpfc: Remove unnecessary lockdep_assert_held calls James Smart
2020-05-07  9:50   ` Hannes Reinecke
2020-05-01 21:43 ` [PATCH 7/9] lpfc: Fix noderef and address space warnings James Smart
2020-05-07  9:50   ` Hannes Reinecke
2020-05-01 21:43 ` [PATCH 8/9] lpfc: Fix MDS Diagnostic Enablement definition James Smart
2020-05-07  9:50   ` Hannes Reinecke
2020-05-01 21:43 ` [PATCH 9/9] lpfc: Update lpfc version to 12.8.0.1 James Smart
2020-05-07  9:51   ` Hannes Reinecke
2020-05-08  2:54 ` [PATCH 0/9] lpfc: Update lpfc to revision 12.8.0.1 Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200501214310.91713-3-jsmart2021@gmail.com \
    --to=jsmart2021@gmail.com \
    --cc=dick.kennedy@broadcom.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox