From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: linux-scsi <linux-scsi@vger.kernel.org>,
Hannes Reinecke <hare@suse.de>, Bo Yang <Bo.Yang@lsi.com>
Cc: Christoph Hellwig <hch@lst.de>,
James Bottomley <James.Bottomley@suse.de>,
Nicholas Bellinger <nab@linux-iscsi.org>
Subject: [PATCH 1/3] megaraid_sas: Add smp_mb__after_atomic_*() for instance->fw_outstanding
Date: Sat, 27 Nov 2010 23:17:34 -0800 [thread overview]
Message-ID: <1290928656-31116-2-git-send-email-nab@linux-iscsi.org> (raw)
In-Reply-To: <1290928656-31116-1-git-send-email-nab@linux-iscsi.org>
From: Nicholas Bellinger <nab@linux-iscsi.org>
This patch adds four missing smp_mb__after_atomic_[inc,dec] barriers
for atomic_inc() and atomic_dec() usage with instance->fw_outstanding
within the main I/O dispatcher megasas_queue_command_lck(), completion
callback megasas_complete_cmd() and struct megasas_instance HW reset
queue drain in megasas_issue_pending_cmds_again().
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
---
drivers/scsi/megaraid/megaraid_sas.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
index 7451bc0..c103554 100644
--- a/drivers/scsi/megaraid/megaraid_sas.c
+++ b/drivers/scsi/megaraid/megaraid_sas.c
@@ -1398,6 +1398,7 @@ megasas_queue_command_lck(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd
* Issue the command to the FW
*/
atomic_inc(&instance->fw_outstanding);
+ smp_mb__after_atomic_inc();
instance->instancet->fire_cmd(instance, cmd->frame_phys_addr,
cmd->frame_count-1, instance->reg_set);
@@ -2068,6 +2069,7 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd,
if (exception) {
atomic_dec(&instance->fw_outstanding);
+ smp_mb__after_atomic_dec();
scsi_dma_unmap(cmd->scmd);
cmd->scmd->scsi_done(cmd->scmd);
@@ -2116,6 +2118,7 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd,
}
atomic_dec(&instance->fw_outstanding);
+ smp_mb__after_atomic_dec();
scsi_dma_unmap(cmd->scmd);
cmd->scmd->scsi_done(cmd->scmd);
@@ -2219,6 +2222,7 @@ megasas_issue_pending_cmds_again(struct megasas_instance *instance)
cmd, cmd->scmd->cmnd[0], cmd->scmd->serial_number);
atomic_inc(&instance->fw_outstanding);
+ smp_mb__after_atomic_inc();
instance->instancet->fire_cmd(instance,
cmd->frame_phys_addr,
cmd->frame_count-1, instance->reg_set);
--
1.7.2.3
next prev parent reply other threads:[~2010-11-28 7:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-28 7:17 [PATCH 0/3] megaraid_sas: Convert to host_lock less w/ interrupts disabled internally Nicholas A. Bellinger
2010-11-28 7:17 ` Nicholas A. Bellinger [this message]
2010-11-28 7:17 ` [PATCH 2/3] megaraid_sas: Convert instance->issuepend_done to atomic_t Nicholas A. Bellinger
2010-11-28 7:17 ` [PATCH 3/3] megaraid_sas: Convert SHT->queuecommand() to run host_lock-less Nicholas A. Bellinger
2010-11-29 16:41 ` Christoph Hellwig
2010-11-29 20:54 ` Nicholas A. Bellinger
2010-11-28 7:28 ` [PATCH 0/3] megaraid_sas: Convert to host_lock less w/ interrupts disabled internally Nicholas A. Bellinger
2010-11-29 15:56 ` Hannes Reinecke
2010-11-29 21:07 ` Nicholas A. Bellinger
2010-11-30 6:26 ` Yang, Bo
2010-11-30 21:21 ` Nicholas A. Bellinger
2010-11-30 22:05 ` Nicholas A. Bellinger
2010-11-30 22:30 ` Yang, Bo
2010-12-01 0:24 ` Nicholas A. Bellinger
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=1290928656-31116-2-git-send-email-nab@linux-iscsi.org \
--to=nab@linux-iscsi.org \
--cc=Bo.Yang@lsi.com \
--cc=James.Bottomley@suse.de \
--cc=hare@suse.de \
--cc=hch@lst.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.