* [PATCH 0/2] netxen: bug fixes
@ 2009-02-24 8:16 Dhananjay Phadke
2009-02-24 8:16 ` [PATCH 1/2] netxen: fix physical port mapping Dhananjay Phadke
2009-02-24 8:16 ` [PATCH 2/2] netxen: handle pci bar 0 mapping failure Dhananjay Phadke
0 siblings, 2 replies; 5+ messages in thread
From: Dhananjay Phadke @ 2009-02-24 8:16 UTC (permalink / raw)
To: netdev; +Cc: davem
Dave,
These are two critical fixes that need to go into net-2.6.
Thanks,
Dhananjay
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] netxen: fix physical port mapping
2009-02-24 8:16 [PATCH 0/2] netxen: bug fixes Dhananjay Phadke
@ 2009-02-24 8:16 ` Dhananjay Phadke
2009-02-24 11:44 ` David Miller
2009-02-24 8:16 ` [PATCH 2/2] netxen: handle pci bar 0 mapping failure Dhananjay Phadke
1 sibling, 1 reply; 5+ messages in thread
From: Dhananjay Phadke @ 2009-02-24 8:16 UTC (permalink / raw)
To: netdev; +Cc: davem
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
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/2] netxen: handle pci bar 0 mapping failure
2009-02-24 8:16 [PATCH 0/2] netxen: bug fixes Dhananjay Phadke
2009-02-24 8:16 ` [PATCH 1/2] netxen: fix physical port mapping Dhananjay Phadke
@ 2009-02-24 8:16 ` Dhananjay Phadke
2009-02-24 11:44 ` David Miller
1 sibling, 1 reply; 5+ messages in thread
From: Dhananjay Phadke @ 2009-02-24 8:16 UTC (permalink / raw)
To: netdev; +Cc: davem
PCI bar 0 is used for memory mapped register access.
If ioremap fails (returns NULL), register access results
in crash.
Use pci_ioremap_bar() instead of ioremap(), the latter
fails on on 32 bit powerpc where pci resource address is
> 32 bits.
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
---
drivers/net/netxen/netxen_nic_main.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index f425811..1308778 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -588,7 +588,12 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
adapter->pci_mem_read = netxen_nic_pci_mem_read_2M;
adapter->pci_mem_write = netxen_nic_pci_mem_write_2M;
- mem_ptr0 = ioremap(mem_base, mem_len);
+ mem_ptr0 = pci_ioremap_bar(pdev, 0);
+ if (mem_ptr0 == NULL) {
+ dev_err(&pdev->dev, "failed to map PCI bar 0\n");
+ return -EIO;
+ }
+
pci_len0 = mem_len;
first_page_group_start = 0;
first_page_group_end = 0;
--
1.6.0.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-02-24 11:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-24 8:16 [PATCH 0/2] netxen: bug fixes Dhananjay Phadke
2009-02-24 8:16 ` [PATCH 1/2] netxen: fix physical port mapping Dhananjay Phadke
2009-02-24 11:44 ` 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox