All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
To: Rajinikanth Pandurangan <Rajinikanth.Pandurangan@pmcs.com>,
	"jbottomley@parallels.com" <jbottomley@parallels.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Cc: "aacraid@pmc-sierra.com" <aacraid@pmc-sierra.com>,
	Harry Yang <Harry.Yang@pmcs.com>, Rich Bono <Rich.Bono@pmcs.com>,
	Achim Leubner <Achim.Leubner@pmcs.com>,
	Murthy Bhat <Murthy.Bhat@pmcs.com>
Subject: RE: [Patch V2 4/9] [SCSI] aacraid: Enable 64-bit write to controller  register
Date: Wed, 24 Jun 2015 05:41:08 +0000	[thread overview]
Message-ID: <B539A9786201A44A91E34268415A2B1AB7F78851@BBYEXM01.pmc-sierra.internal> (raw)
In-Reply-To: <1433986951-9033-6-git-send-email-rajinikanth.pandurangan@pmcs.com>

Reviewed-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>


-----Original Message-----
From: Rajinikanth Pandurangan 
Sent: Thursday, June 11, 2015 7:12 AM
To: jbottomley@parallels.com; linux-scsi@vger.kernel.org
Cc: aacraid@pmc-sierra.com; Harry Yang; Mahesh Rajashekhara; Rich Bono; Achim Leubner; Murthy Bhat; Rajinikanth Pandurangan
Subject: [Patch V2 4/9] [SCSI] aacraid: Enable 64-bit write to controller register

From: Rajinikanth Pandurangan <rajinikanth.pandurangan@pmcs.com>

Description:
        If writeq() not supported, then do atomic two 32bit write

Signed-off-by: Rajinikanth Pandurangan <rajinikanth.pandurangan@pmcs.com>
---
 drivers/scsi/aacraid/aacraid.h  |  9 +++++++++  drivers/scsi/aacraid/comminit.c |  1 +
 drivers/scsi/aacraid/src.c      | 12 ++++++++++--
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index 62b0999..e54f597 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -844,6 +844,10 @@ struct src_registers {
 						&((AEP)->regs.src.bar0->CSR))
 #define src_writel(AEP, CSR, value)	writel(value, \
 						&((AEP)->regs.src.bar0->CSR))
+#if defined(writeq)
+#define	src_writeq(AEP, CSR, value)	writeq(value, \
+						&((AEP)->regs.src.bar0->CSR))
+#endif
 
 #define SRC_ODR_SHIFT		12
 #define SRC_IDR_SHIFT		9
@@ -1163,6 +1167,11 @@ struct aac_dev
 	struct fsa_dev_info	*fsa_dev;
 	struct task_struct	*thread;
 	int			cardtype;
+	/*
+	 *This lock will protect the two 32-bit
+	 *writes to the Inbound Queue
+	 */
+	spinlock_t		iq_lock;
 
 	/*
 	 *	The following is the device specific extension.
diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c index e0a76d5..e4ff47e 100644
--- a/drivers/scsi/aacraid/comminit.c
+++ b/drivers/scsi/aacraid/comminit.c
@@ -424,6 +424,7 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
 	dev->management_fib_count = 0;
 	spin_lock_init(&dev->manage_lock);
 	spin_lock_init(&dev->sync_lock);
+	spin_lock_init(&dev->iq_lock);
 	dev->max_fib_size = sizeof(struct hw_fib);
 	dev->sg_tablesize = host->sg_tablesize = (dev->max_fib_size
 		- sizeof(struct aac_fibhdr)
diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c index eb07b3d..1409a0b 100644
--- a/drivers/scsi/aacraid/src.c
+++ b/drivers/scsi/aacraid/src.c
@@ -447,6 +447,10 @@ static int aac_src_deliver_message(struct fib *fib)
 	u32 fibsize;
 	dma_addr_t address;
 	struct aac_fib_xporthdr *pFibX;
+#if !defined(writeq)
+	unsigned long flags;
+#endif
+
 	u16 hdr_size = le16_to_cpu(fib->hw_fib_va->header.Size);
 
 	atomic_inc(&q->numpending);
@@ -511,10 +515,14 @@ static int aac_src_deliver_message(struct fib *fib)
 			return -EINVAL;
 		address |= fibsize;
 	}
-
+#if defined(writeq)
+	src_writeq(dev, MUnit.IQ_L, (u64)address); #else
+	spin_lock_irqsave(&fib->dev->iq_lock, flags);
 	src_writel(dev, MUnit.IQ_H, upper_32_bits(address) & 0xffffffff);
 	src_writel(dev, MUnit.IQ_L, address & 0xffffffff);
-
+	spin_unlock_irqrestore(&fib->dev->iq_lock, flags); #endif
 	return 0;
 }
 
--
1.9.3


  parent reply	other threads:[~2015-06-24  5:41 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-11  1:42 [Patch V2 0/9] [SCSI] aacraid: Patchset for aacraid driver version 41010 rajinikanth.pandurangan
2015-06-11  1:42 ` rajinikanth.pandurangan
2015-06-11  1:42 ` [Patch V2 1/9] [SCSI] aacraid: Fix for logical device name and UID not exposed to the OS rajinikanth.pandurangan
2015-06-16 11:27   ` Johannes Thumshirn
2015-06-24  5:40   ` Mahesh Rajashekhara
2015-06-25 15:21   ` Tomas Henzl
2015-06-11  1:42 ` [Patch V2 2/9] [SCSI] aacraid: Add Power Management support rajinikanth.pandurangan
2015-06-24  5:40   ` Mahesh Rajashekhara
2015-06-25 15:42   ` Tomas Henzl
2015-06-25 16:54     ` Rajinikanth Pandurangan
2015-06-25 17:52       ` Tomas Henzl
2015-06-11  1:42 ` [Patch V2 3/9] [SCSI] aacraid: Enable MSI interrupt for series-6 controller rajinikanth.pandurangan
2015-06-16 11:33   ` Johannes Thumshirn
2015-06-24  5:40   ` Mahesh Rajashekhara
2015-06-25 16:01   ` Tomas Henzl
2015-06-11  1:42 ` [Patch V2 4/9] [SCSI] aacraid: Enable 64-bit write to controller register rajinikanth.pandurangan
2015-06-11 10:01   ` Johannes Thumshirn
2015-06-11 18:08     ` Rajinikanth Pandurangan
2015-06-24  5:41   ` Mahesh Rajashekhara [this message]
2015-06-25 16:03   ` Tomas Henzl
2015-06-11  1:42 ` [Patch V2 5/9] [SCSI] aacraid: Tune response path if IsFastPath bit set rajinikanth.pandurangan
2015-06-18 17:30   ` Rajinikanth Pandurangan
2015-06-24  5:41   ` Mahesh Rajashekhara
2015-06-25 18:05   ` Tomas Henzl
2015-06-11  1:42 ` [Patch V2 6/9] [SCSI] aacraid: Reset irq affinity hints before releasing irq rajinikanth.pandurangan
2015-06-16 11:40   ` Johannes Thumshirn
2015-06-24  5:41   ` Mahesh Rajashekhara
2015-06-11  1:42 ` [Patch V2 7/9] [SCSI] aacraid: Unblock IOCTLs to controller once system resumed from suspend rajinikanth.pandurangan
2015-06-16 11:41   ` Johannes Thumshirn
2015-06-24  5:41   ` Mahesh Rajashekhara
2015-06-11  1:42 ` [Patch V2 8/9] [SCSI] aacraid: Send commit-config to controller firmware rajinikanth.pandurangan
2015-06-24  5:42   ` Mahesh Rajashekhara
2015-06-11  1:42 ` [Patch V2 9/9] [SCSI] aacraid: Update driver version rajinikanth.pandurangan
2015-06-16 11:43   ` Johannes Thumshirn
2015-06-24  5:42   ` Mahesh Rajashekhara

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=B539A9786201A44A91E34268415A2B1AB7F78851@BBYEXM01.pmc-sierra.internal \
    --to=mahesh.rajashekhara@pmcs.com \
    --cc=Achim.Leubner@pmcs.com \
    --cc=Harry.Yang@pmcs.com \
    --cc=Murthy.Bhat@pmcs.com \
    --cc=Rajinikanth.Pandurangan@pmcs.com \
    --cc=Rich.Bono@pmcs.com \
    --cc=aacraid@pmc-sierra.com \
    --cc=jbottomley@parallels.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 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.