From: <Sumit.Saxena@avagotech.com>
To: linux-scsi@vger.kernel.org
Cc: thenzl@redhat.com, martin.petersen@oracle.com, hch@infradead.org,
jbottomley@parallels.com, kashyap.desai@avagotech.com,
aradford@gmail.com
Subject: [PATCH 02/11] megaraid_sas : Use writeq for 64bit pci write to avoid spinlock overhead
Date: Sat, 6 Sep 2014 18:55:46 +0530 [thread overview]
Message-ID: <201409061328.s86DS4h1012830@palmhbs0.lsi.com> (raw)
Use writeq() for 64bit PCI write instead of writel() to avoid additional lock overhead.
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
---
drivers/scsi/megaraid/megaraid_sas_fusion.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index 57b47fe..c69c1ac 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -1065,6 +1065,13 @@ megasas_fire_cmd_fusion(struct megasas_instance *instance,
u32 req_desc_hi,
struct megasas_register_set __iomem *regs)
{
+#if defined(writeq) && defined(CONFIG_64BIT)
+ u64 req_data = 0;
+
+ req_data = req_desc_hi;
+ req_data = ((req_data << 32) | (u32)req_desc_lo);
+ writeq(le64_to_cpu(req_data), &(regs)->inbound_low_queue_port);
+#else
unsigned long flags;
spin_lock_irqsave(&instance->hba_lock, flags);
@@ -1072,6 +1079,7 @@ megasas_fire_cmd_fusion(struct megasas_instance *instance,
writel(le32_to_cpu(req_desc_lo), &(regs)->inbound_low_queue_port);
writel(le32_to_cpu(req_desc_hi), &(regs)->inbound_high_queue_port);
spin_unlock_irqrestore(&instance->hba_lock, flags);
+#endif
}
/**
--
1.8.3.1
next reply other threads:[~2014-09-06 13:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-06 13:25 Sumit.Saxena [this message]
2014-09-09 13:30 ` [PATCH 02/11] megaraid_sas : Use writeq for 64bit pci write to avoid spinlock overhead Tomas Henzl
2014-09-10 10:15 ` Kashyap Desai
2014-09-10 11:16 ` Tomas Henzl
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=201409061328.s86DS4h1012830@palmhbs0.lsi.com \
--to=sumit.saxena@avagotech.com \
--cc=aradford@gmail.com \
--cc=hch@infradead.org \
--cc=jbottomley@parallels.com \
--cc=kashyap.desai@avagotech.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=thenzl@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox