Patchwork netxen: fix dma mask update calculation

login
register
mail settings
Submitter Dhananjay Phadke
Date Aug. 4, 2009, 8:39 p.m.
Message ID <1249418343-15741-1-git-send-email-dhananjay@netxen.com>
Download mbox | patch
Permalink /patch/30737/
State Accepted
Delegated to: David Miller
Headers show

Comments

Dhananjay Phadke - Aug. 4, 2009, 8:39 p.m.
Fix dma mask calculation that caps at 63-bit addressing even
when firmware advertises full 64-bit support.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
---
 drivers/net/netxen/netxen_nic_main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
David Miller - Aug. 5, 2009, 5:22 p.m.
From: Dhananjay Phadke <dhananjay@netxen.com>
Date: Tue,  4 Aug 2009 13:39:03 -0700

> Fix dma mask calculation that caps at 63-bit addressing even
> when firmware advertises full 64-bit support.
> 
> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 3cd8cfc..70c05c4 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -260,7 +260,7 @@  nx_update_dma_mask(struct netxen_adapter *adapter)
 	change = 0;
 
 	shift = NXRD32(adapter, CRB_DMA_SHIFT);
-	if (shift >= 32)
+	if (shift > 32)
 		return 0;
 
 	if (NX_IS_REVISION_P3(adapter->ahw.revision_id) && (shift > 9))
@@ -272,7 +272,7 @@  nx_update_dma_mask(struct netxen_adapter *adapter)
 		old_mask = pdev->dma_mask;
 		old_cmask = pdev->dev.coherent_dma_mask;
 
-		mask = (1ULL<<(32+shift)) - 1;
+		mask = DMA_BIT_MASK(32+shift);
 
 		err = pci_set_dma_mask(pdev, mask);
 		if (err)