All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomas Henzl <thenzl@redhat.com>
To: "'linux-scsi@vger.kernel.org'" <linux-scsi@vger.kernel.org>
Cc: "Sumit.Saxena@avagotech.com" <Sumit.Saxena@avagotech.com>,
	"Desai, Kashyap" <Kashyap.Desai@avagotech.com>,
	Uday Lingala <uday.lingala@avagotech.com>,
	stable@vger.kernel.org
Subject: [PATCH v2] megaraid_sas: add an i/o barrier
Date: Mon, 1 Feb 2016 15:12:04 +0100	[thread overview]
Message-ID: <56AF67B4.2010702@redhat.com> (raw)

A barrier should be added to ensure proper
ordering of memory mapped writes.

V2: - added the barrier also to megasas_fire_cmd_skinny,
as suggested by Kashyap Desai

Signed-off-by: Tomas Henzl <thenzl@redhat.com>
---
 drivers/scsi/megaraid/megaraid_sas_base.c   | 1 +
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index cc92c8198d..9f7689515c 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -749,6 +749,7 @@ megasas_fire_cmd_skinny(struct megasas_instance *instance,
 	       &(regs)->inbound_high_queue_port);
 	writel((lower_32_bits(frame_phys_addr) | (frame_count<<1))|1,
 	       &(regs)->inbound_low_queue_port);
+	mmiowb();
 	spin_unlock_irqrestore(&instance->hba_lock, flags);
 }
 
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index d9d0029fb1..98a848bdfd 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -204,6 +204,7 @@ megasas_fire_cmd_fusion(struct megasas_instance *instance,
 		&instance->reg_set->inbound_low_queue_port);
 	writel(le32_to_cpu(req_desc->u.high),
 		&instance->reg_set->inbound_high_queue_port);
+	mmiowb();
 	spin_unlock_irqrestore(&instance->hba_lock, flags);
 #endif
 }
-- 
2.4.3

             reply	other threads:[~2016-02-01 14:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-01 14:12 Tomas Henzl [this message]
2016-02-01 20:41 ` [PATCH v2] megaraid_sas: add an i/o barrier Greg KH
2016-02-10 17:25 ` Martin K. Petersen
2016-02-10 17:25   ` Martin K. Petersen
2016-02-10 18:56   ` Kashyap Desai
2016-02-11  0:17 ` Martin K. Petersen
2016-02-11  0:17   ` 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=56AF67B4.2010702@redhat.com \
    --to=thenzl@redhat.com \
    --cc=Kashyap.Desai@avagotech.com \
    --cc=Sumit.Saxena@avagotech.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=uday.lingala@avagotech.com \
    /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.