[PATCH] pcnet32: fix a logic error with pci_set_dma_mask

Subsystems: networking drivers, pcnet32 network driver, the rest

STALE3943d

5 messages, 3 authors, 2015-11-24 · open the first message on its own page

[PATCH] pcnet32: fix a logic error with pci_set_dma_mask

From: Geliang Tang <hidden>
Date: 2015-10-09 10:46:03

pcnet32 can't work on my machine recently. It says "architecture
does not support 32bit PCI busmaster DMA". There is a logic error
in it: pci_set_dma_mask() return 0 means return successfully.

Signed-off-by: Geliang Tang <redacted>
---
 drivers/net/ethernet/amd/pcnet32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c
index e2afabf..2d9d216 100644
--- a/drivers/net/ethernet/amd/pcnet32.c
+++ b/drivers/net/ethernet/amd/pcnet32.c
@@ -1500,7 +1500,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
 		return -ENODEV;
 	}
 
-	if (!pci_set_dma_mask(pdev, PCNET32_DMA_MASK)) {
+	if (pci_set_dma_mask(pdev, PCNET32_DMA_MASK)) {
 		if (pcnet32_debug & NETIF_MSG_PROBE)
 			pr_err("architecture does not support 32bit PCI busmaster DMA\n");
 		return -ENODEV;
-- 
1.9.1

Re: [PATCH] pcnet32: fix a logic error with pci_set_dma_mask

From: David Miller <davem@davemloft.net>
Date: 2015-10-12 12:22:34

From: Geliang Tang <redacted>
Date: Fri,  9 Oct 2015 03:45:39 -0700
pcnet32 can't work on my machine recently. It says "architecture
does not support 32bit PCI busmaster DMA". There is a logic error
in it: pci_set_dma_mask() return 0 means return successfully.

Signed-off-by: Geliang Tang <redacted>
This driver doesn't call pci_set_dma_mask() in any of my tree(s).

Re: [PATCH] pcnet32: fix a logic error with pci_set_dma_mask

From: Geliang Tang <hidden>
Date: 2015-10-13 07:56:12

On Mon, Oct 12, 2015 at 05:38:14AM -0700, David Miller wrote:
From: Geliang Tang <redacted>
Date: Fri,  9 Oct 2015 03:45:39 -0700
quoted
pcnet32 can't work on my machine recently. It says "architecture
does not support 32bit PCI busmaster DMA". There is a logic error
in it: pci_set_dma_mask() return 0 means return successfully.

Signed-off-by: Geliang Tang <redacted>
This driver doesn't call pci_set_dma_mask() in any of my tree(s).
This patch is against linux-next tree. It was introduced by commit
9c034d4 'pcnet32: use pci_set_dma_mask insted of pci_dma_supported'.

Re: [PATCH] pcnet32: fix a logic error with pci_set_dma_mask

From: Don Fry <pcnet32@frontier.com>
Date: 2015-10-22 04:01:42

On Mon, 2015-10-12 at 05:38 -0700, David Miller wrote:
From: Geliang Tang <redacted>
Date: Fri,  9 Oct 2015 03:45:39 -0700
quoted
pcnet32 can't work on my machine recently. It says "architecture
does not support 32bit PCI busmaster DMA". There is a logic error
in it: pci_set_dma_mask() return 0 means return successfully.

Signed-off-by: Geliang Tang <redacted>
This driver doesn't call pci_set_dma_mask() in any of my tree(s).
I failed.  My system with pcnet32 boards was down with a dead power
supply and a visual review was not good enough.  I missed that
pci_dma_supported returns 1 on success and pci_set_dma_mask returns 0 on
success.  The original patch needs to have the ! removed as Geliang Tang
points out.

Acked-by:  Don Fry <pcnet32@frontier.com>

Re: [PATCH] pcnet32: fix a logic error with pci_set_dma_mask

From: Geliang Tang <hidden>
Date: 2015-11-24 04:05:26

On Wed, Oct 21, 2015 at 09:01:26PM -0700, Don Fry wrote:
On Mon, 2015-10-12 at 05:38 -0700, David Miller wrote:
quoted
From: Geliang Tang <redacted>
Date: Fri,  9 Oct 2015 03:45:39 -0700
quoted
pcnet32 can't work on my machine recently. It says "architecture
does not support 32bit PCI busmaster DMA". There is a logic error
in it: pci_set_dma_mask() return 0 means return successfully.

Signed-off-by: Geliang Tang <redacted>
This driver doesn't call pci_set_dma_mask() in any of my tree(s).
I failed.  My system with pcnet32 boards was down with a dead power
supply and a visual review was not good enough.  I missed that
pci_dma_supported returns 1 on success and pci_set_dma_mask returns 0 on
success.  The original patch needs to have the ! removed as Geliang Tang
points out.

Acked-by:  Don Fry <pcnet32@frontier.com>
Hi:

It has been a month since I submitted this patch. I'm wondering is it
still valid and wether it will be applied? 

A recent commit targeting at the same problem (commit 1a47de6 various:
fix pci_set_dma_mask return value checking) has been applied. But my
commit, which I reported and submitted earlier, hasn't been applied. I'd
like to know if there's anything wrong with it? 

Thank you!

- Geliang Tang
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help