Netdev List
 help / color / mirror / Atom feed
From: Dhananjay Phadke <dhananjay@netxen.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net
Subject: [PATCH 1/2] netxen: fix physical port mapping
Date: Tue, 24 Feb 2009 00:16:58 -0800	[thread overview]
Message-ID: <1235463419-25146-2-git-send-email-dhananjay@netxen.com> (raw)
In-Reply-To: <1235463419-25146-1-git-send-email-dhananjay@netxen.com>

The PCI function to physical port mapping is valid only for
old firmware. New firmware (4.0.0+) abstracts this.
So driver should never try to access phy using invalid
mapping. The behavior is unpredictable when PCI functions
4-7 are enabled on the same NIC.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
---
 drivers/net/netxen/netxen_nic_main.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 9f33e44..f425811 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -795,9 +795,12 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	 * See if the firmware gave us a virtual-physical port mapping.
 	 */
 	adapter->physical_port = adapter->portnum;
-	i = adapter->pci_read_normalize(adapter, CRB_V2P(adapter->portnum));
-	if (i != 0x55555555)
-		adapter->physical_port = i;
+	if (adapter->fw_major < 4) {
+		i = adapter->pci_read_normalize(adapter,
+				CRB_V2P(adapter->portnum));
+		if (i != 0x55555555)
+			adapter->physical_port = i;
+	}
 
 	adapter->flags &= ~(NETXEN_NIC_MSI_ENABLED | NETXEN_NIC_MSIX_ENABLED);
 
-- 
1.6.0.2


  reply	other threads:[~2009-02-24  8:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-24  8:16 [PATCH 0/2] netxen: bug fixes Dhananjay Phadke
2009-02-24  8:16 ` Dhananjay Phadke [this message]
2009-02-24 11:44   ` [PATCH 1/2] netxen: fix physical port mapping David Miller
2009-02-24  8:16 ` [PATCH 2/2] netxen: handle pci bar 0 mapping failure Dhananjay Phadke
2009-02-24 11:44   ` 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=1235463419-25146-2-git-send-email-dhananjay@netxen.com \
    --to=dhananjay@netxen.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