netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dhananjay Phadke <dhananjay@netxen.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Amit Kumar Salecha <amit@qlogic.com>,
	Amit Kumar Salecha <amit@netxen.com>
Subject: [PATCH 1/5] netxen: change firmware write size
Date: Fri, 11 Sep 2009 14:28:11 -0700	[thread overview]
Message-ID: <1252704495-16118-2-git-send-email-dhananjay@netxen.com> (raw)
In-Reply-To: <1252704495-16118-1-git-send-email-dhananjay@netxen.com>

From: Amit Kumar Salecha <amit@qlogic.com>

Use 8 byte strides for firmware download into card
memory since oncard memory controller needs 8 byte
(64 bit) accesses. This avoids unnecessary rmw cycles.

Signed-off-by: Amit Kumar Salecha <amit@netxen.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
---
 drivers/net/netxen/netxen_nic_init.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 485b947..8926b0e 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -727,21 +727,28 @@ netxen_load_firmware(struct netxen_adapter *adapter)
 			flashaddr += 8;
 		}
 	} else {
-		u32 data;
+		u64 data;
+		u32 hi, lo;
 
-		size = (NETXEN_IMAGE_START - NETXEN_BOOTLD_START) / 4;
+		size = (NETXEN_IMAGE_START - NETXEN_BOOTLD_START) / 8;
 		flashaddr = NETXEN_BOOTLD_START;
 
 		for (i = 0; i < size; i++) {
 			if (netxen_rom_fast_read(adapter,
-					flashaddr, (int *)&data) != 0)
+					flashaddr, &lo) != 0)
+				return -EIO;
+			if (netxen_rom_fast_read(adapter,
+					flashaddr + 4, &hi) != 0)
 				return -EIO;
 
+			/* hi, lo are already in host endian byteorder */
+			data = (((u64)hi << 32) | lo);
+
 			if (adapter->pci_mem_write(adapter,
-						flashaddr, &data, 4))
+						flashaddr, &data, 8))
 				return -EIO;
 
-			flashaddr += 4;
+			flashaddr += 8;
 		}
 	}
 	msleep(1);
-- 
1.6.0.2


  reply	other threads:[~2009-09-11 21:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11 21:28 [PATCH 0/5] netxen: driver update for 2.6.32 Dhananjay Phadke
2009-09-11 21:28 ` Dhananjay Phadke [this message]
2009-09-11 21:28 ` [PATCH 2/5] netxen: improve pci memory access Dhananjay Phadke
2009-09-11 21:28 ` [PATCH 3/5] netxen: fix file firmware leak Dhananjay Phadke
2009-09-11 21:28 ` [PATCH 4/5] netxen: fix tx timeout recovery Dhananjay Phadke
2009-09-11 21:28 ` [PATCH 5/5] netxen: update copyright Dhananjay Phadke
2009-09-11 23:59 ` [PATCH 0/5] netxen: driver update for 2.6.32 David Miller

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=1252704495-16118-2-git-send-email-dhananjay@netxen.com \
    --to=dhananjay@netxen.com \
    --cc=amit@netxen.com \
    --cc=amit@qlogic.com \
    --cc=davem@davemloft.net \
    --cc=netdev@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;
as well as URLs for NNTP newsgroup(s).