diff mbox

[net] be2net: Fix 32-bit DMA Mask handling

Message ID e97260be-0d58-4285-a8e5-c9b030d60132@CMEXHTCAS2.ad.emulex.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Somnath Kotur June 11, 2013, 11:48 a.m. UTC
Fix to set the coherent DMA mask only if dma_set_mask() succeeded, and to
error out if either fails.

Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Comments

David Miller June 13, 2013, 8:28 a.m. UTC | #1
From: Somnath Kotur <somnath.kotur@emulex.com>
Date: Tue, 11 Jun 2013 17:18:22 +0530

> Fix to set the coherent DMA mask only if dma_set_mask() succeeded, and to
> error out if either fails.
> 
> Signed-off-by: Somnath Kotur <somnath.kotur@emulex.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
diff mbox

Patch

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 8bc1b21..a0b4be5 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -4262,6 +4262,9 @@  static int be_probe(struct pci_dev *pdev, const struct pci_device_id *pdev_id)
 		netdev->features |= NETIF_F_HIGHDMA;
 	} else {
 		status = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
+		if (!status)
+			status = dma_set_coherent_mask(&pdev->dev,
+						       DMA_BIT_MASK(32));
 		if (status) {
 			dev_err(&pdev->dev, "Could not set PCI DMA Mask\n");
 			goto free_netdev;