* [PATCHv1 1/4] netxen: fix bios version calculation
2010-03-25 7:06 [PATCHv1 0/4]netxen: bug fixes Amit Kumar Salecha
@ 2010-03-25 7:06 ` Amit Kumar Salecha
2010-03-25 7:06 ` [PATCHv1 2/4] netxen: fix warning in ioaddr for NX3031 chip Amit Kumar Salecha
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Amit Kumar Salecha @ 2010-03-25 7:06 UTC (permalink / raw)
To: davem; +Cc: netdev, ameen.rahman
Bios sub version from unified fw image is calculated incorrect.
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
drivers/net/netxen/netxen_nic_init.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 1c63610..7eb925a 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -761,7 +761,7 @@ nx_get_bios_version(struct netxen_adapter *adapter)
if (adapter->fw_type == NX_UNIFIED_ROMIMAGE) {
bios_ver = cpu_to_le32(*((u32 *) (&fw->data[prd_off])
+ NX_UNI_BIOS_VERSION_OFF));
- return (bios_ver << 24) + ((bios_ver >> 8) & 0xff00) +
+ return (bios_ver << 16) + ((bios_ver >> 8) & 0xff00) +
(bios_ver >> 24);
} else
return cpu_to_le32(*(u32 *)&fw->data[NX_BIOS_VERSION_OFFSET]);
--
1.6.0.2
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCHv1 2/4] netxen: fix warning in ioaddr for NX3031 chip
2010-03-25 7:06 [PATCHv1 0/4]netxen: bug fixes Amit Kumar Salecha
2010-03-25 7:06 ` [PATCHv1 1/4] netxen: fix bios version calculation Amit Kumar Salecha
@ 2010-03-25 7:06 ` Amit Kumar Salecha
2010-03-25 7:06 ` [PATCHv1 3/4] netxen: added sanity check for pci map Amit Kumar Salecha
2010-03-25 7:06 ` [PATCHv1 4/4] netxen: update version to 4.0.73 Amit Kumar Salecha
3 siblings, 0 replies; 7+ messages in thread
From: Amit Kumar Salecha @ 2010-03-25 7:06 UTC (permalink / raw)
To: davem; +Cc: netdev, ameen.rahman
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
crb_intr_mask/crb_sts_consumer is predefined for NX2031 not for
NX3031. For NX3031, these values get defined in rx context creation.
---
drivers/net/netxen/netxen_nic_ctx.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic_ctx.c b/drivers/net/netxen/netxen_nic_ctx.c
index 2a8ef5f..f26e547 100644
--- a/drivers/net/netxen/netxen_nic_ctx.c
+++ b/drivers/net/netxen/netxen_nic_ctx.c
@@ -669,13 +669,15 @@ int netxen_alloc_hw_resources(struct netxen_adapter *adapter)
}
sds_ring->desc_head = (struct status_desc *)addr;
- sds_ring->crb_sts_consumer =
- netxen_get_ioaddr(adapter,
- recv_crb_registers[port].crb_sts_consumer[ring]);
+ if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) {
+ sds_ring->crb_sts_consumer =
+ netxen_get_ioaddr(adapter,
+ recv_crb_registers[port].crb_sts_consumer[ring]);
- sds_ring->crb_intr_mask =
- netxen_get_ioaddr(adapter,
- recv_crb_registers[port].sw_int_mask[ring]);
+ sds_ring->crb_intr_mask =
+ netxen_get_ioaddr(adapter,
+ recv_crb_registers[port].sw_int_mask[ring]);
+ }
}
--
1.6.0.2
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCHv1 3/4] netxen: added sanity check for pci map
2010-03-25 7:06 [PATCHv1 0/4]netxen: bug fixes Amit Kumar Salecha
2010-03-25 7:06 ` [PATCHv1 1/4] netxen: fix bios version calculation Amit Kumar Salecha
2010-03-25 7:06 ` [PATCHv1 2/4] netxen: fix warning in ioaddr for NX3031 chip Amit Kumar Salecha
@ 2010-03-25 7:06 ` Amit Kumar Salecha
2010-03-25 19:04 ` David Miller
2010-03-25 7:06 ` [PATCHv1 4/4] netxen: update version to 4.0.73 Amit Kumar Salecha
3 siblings, 1 reply; 7+ messages in thread
From: Amit Kumar Salecha @ 2010-03-25 7:06 UTC (permalink / raw)
To: davem; +Cc: netdev, ameen.rahman
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Return value of ioremap is not checked, NULL check added.
---
drivers/net/netxen/netxen_nic_main.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 9a7a0f3..cf06a51 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -636,10 +636,24 @@ netxen_setup_pci_map(struct netxen_adapter *adapter)
mem_ptr2 = ioremap(mem_base + THIRD_PAGE_GROUP_START,
THIRD_PAGE_GROUP_SIZE);
pci_len0 = FIRST_PAGE_GROUP_SIZE;
+
+ if (mem_ptr0 == NULL || mem_ptr1 == NULL || mem_ptr2 == NULL) {
+ dev_err(&pdev->dev, "failed to map PCI bar 0\n");
+ err = -EIO;
+ goto err_out;
+ }
+
} else if (mem_len == NETXEN_PCI_32MB_SIZE) {
mem_ptr1 = ioremap(mem_base, SECOND_PAGE_GROUP_SIZE);
mem_ptr2 = ioremap(mem_base + THIRD_PAGE_GROUP_START -
SECOND_PAGE_GROUP_START, THIRD_PAGE_GROUP_SIZE);
+
+ if (mem_ptr1 == NULL || mem_ptr2 == NULL) {
+ dev_err(&pdev->dev, "failed to map PCI bar 0\n");
+ err = -EIO;
+ goto err_out;
+ }
+
} else if (mem_len == NETXEN_PCI_2MB_SIZE) {
mem_ptr0 = pci_ioremap_bar(pdev, 0);
--
1.6.0.2
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCHv1 3/4] netxen: added sanity check for pci map
2010-03-25 7:06 ` [PATCHv1 3/4] netxen: added sanity check for pci map Amit Kumar Salecha
@ 2010-03-25 19:04 ` David Miller
2010-03-26 10:40 ` Amit Salecha
0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2010-03-25 19:04 UTC (permalink / raw)
To: amit.salecha; +Cc: netdev, ameen.rahman
From: Amit Kumar Salecha <amit.salecha@qlogic.com>
Date: Thu, 25 Mar 2010 00:06:45 -0700
> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
>
> Return value of ioremap is not checked, NULL check added.
You're not even thinking when you make these changes.
Let's try again ok?
These ioremap() calls store the pointers into local variables.
So it doesn't work at all to just jump to err_out to clean
them up and iounmap them.
The unamp code you end up calling in netxen_pci_map() only does an
iounmap() on pointers stored in the netxen_adapter struct. At this
point they haven't been stored there yet.
So they still leak.
Can you tell my patience on this patch set is very much running
out? If you put half of the effort writing these patches as I
am putting into reviewing them, we wouldn't have to go back
and forth on this so many times.
Double check your work, and resubmit this whole patch set once you've
fixed this one, I think the other ones look fine.
Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCHv1 3/4] netxen: added sanity check for pci map
2010-03-25 19:04 ` David Miller
@ 2010-03-26 10:40 ` Amit Salecha
0 siblings, 0 replies; 7+ messages in thread
From: Amit Salecha @ 2010-03-26 10:40 UTC (permalink / raw)
To: David Miller; +Cc: netdev@vger.kernel.org, Ameen Rahman
David,
Sorry for inconvenience caused. I'll take care in future work.
I have submitted reworked patches.
-Amit
-----Original Message-----
From: David Miller [mailto:davem@davemloft.net]
Sent: Friday, March 26, 2010 12:35 AM
To: Amit Salecha
Cc: netdev@vger.kernel.org; Ameen Rahman
Subject: Re: [PATCHv1 3/4] netxen: added sanity check for pci map
From: Amit Kumar Salecha <amit.salecha@qlogic.com>
Date: Thu, 25 Mar 2010 00:06:45 -0700
> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
>
> Return value of ioremap is not checked, NULL check added.
You're not even thinking when you make these changes.
Let's try again ok?
These ioremap() calls store the pointers into local variables.
So it doesn't work at all to just jump to err_out to clean
them up and iounmap them.
The unamp code you end up calling in netxen_pci_map() only does an
iounmap() on pointers stored in the netxen_adapter struct. At this
point they haven't been stored there yet.
So they still leak.
Can you tell my patience on this patch set is very much running
out? If you put half of the effort writing these patches as I
am putting into reviewing them, we wouldn't have to go back
and forth on this so many times.
Double check your work, and resubmit this whole patch set once you've
fixed this one, I think the other ones look fine.
Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCHv1 4/4] netxen: update version to 4.0.73
2010-03-25 7:06 [PATCHv1 0/4]netxen: bug fixes Amit Kumar Salecha
` (2 preceding siblings ...)
2010-03-25 7:06 ` [PATCHv1 3/4] netxen: added sanity check for pci map Amit Kumar Salecha
@ 2010-03-25 7:06 ` Amit Kumar Salecha
3 siblings, 0 replies; 7+ messages in thread
From: Amit Kumar Salecha @ 2010-03-25 7:06 UTC (permalink / raw)
To: davem; +Cc: netdev, ameen.rahman
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
drivers/net/netxen/netxen_nic.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index 144d2e8..0f70383 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -53,8 +53,8 @@
#define _NETXEN_NIC_LINUX_MAJOR 4
#define _NETXEN_NIC_LINUX_MINOR 0
-#define _NETXEN_NIC_LINUX_SUBVERSION 72
-#define NETXEN_NIC_LINUX_VERSIONID "4.0.72"
+#define _NETXEN_NIC_LINUX_SUBVERSION 73
+#define NETXEN_NIC_LINUX_VERSIONID "4.0.73"
#define NETXEN_VERSION_CODE(a, b, c) (((a) << 24) + ((b) << 16) + (c))
#define _major(v) (((v) >> 24) & 0xff)
--
1.6.0.2
^ permalink raw reply related [flat|nested] 7+ messages in thread