Skip to contentSkip to conversation

skge: add quirk to limit DMA

PATCH In review Stanislaw Gruszka 3 participants 4 messages Sep 29, 2010 – Oct 5, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 skge: add quirk to limit DMA

Skge devices installed on some Gigabyte motherboards are not able to perform 64 dma correctly due to board PCI implementation, so limit DMA to 32bit if such boards are detected.

Bug was reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=447489

---
 drivers/net/skge.c |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)
drivers/net/skge.c +21 -1
index a8a6358..571d4c3 100644
@@ -43,6 +43,7 @@
 #include <linux/seq_file.h>
 #include <linux/mii.h>
 #include <linux/slab.h>
+#include <linux/dmi.h>
 #include <asm/irq.h>
 
 #include "skge.h"
@@ -3869,6 +3870,8 @@ static void __devinit skge_show_addr(struct net_device *dev)
 	netif_info(skge, probe, skge->netdev, "addr %pM\n", dev->dev_addr);
 }
 
+static int only_32bit_dma;
+
 static int __devinit skge_probe(struct pci_dev *pdev,
 				const struct pci_device_id *ent)
 {
@@ -3890,7 +3893,7 @@ static int __devinit skge_probe(struct pci_dev *pdev,
 
 	pci_set_master(pdev);
 
-	if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
+	if (!only_32bit_dma && !pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
 		using_dac = 1;
 		err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
 	} else if (!(err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) {
@@ -4148,8 +4151,25 @@ static struct pci_driver skge_driver = {
 	.shutdown =	skge_shutdown,
 };
 
+#ifndef CONFIG_DMI
+#warning "DMA quirk for Gigabyte nForce boards will not be applied"
+#endif
+
+static struct dmi_system_id skge_32bit_dma_boards[] = {
+	{
+		.ident = "Gigabyte nForce boards",
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co"),
+			DMI_MATCH(DMI_BOARD_NAME, "nForce"),
+		},
+	},
+	{}
+};
+
 static int __init skge_init_module(void)
 {
+	if (dmi_check_system(skge_32bit_dma_boards))
+		only_32bit_dma = 1;
 	skge_debug_init();
 	return pci_register_driver(&skge_driver);
 }
Signature · 1 line
1.5.5.6
maintainer
#1 lore raw

From: Stanislaw Gruszka <[email protected]>
Date: Wed, 29 Sep 2010 11:33:23 +0200

Quoted 9 lines

Skge devices installed on some Gigabyte motherboards are not able to perform 64 dma correctly due to board PCI implementation, so limit DMA to 32bit if such boards are detected.

Bug was reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=447489

Stephen? Can I get an ACK or some kind of other status on this?

#2 lore raw
Quoted 7 lines · On Tue, 05 Oct 2010 00:18:00 -0700 (PDT) David Miller <[email protected]>…

From: Stanislaw Gruszka <[email protected]>
Date: Wed, 29 Sep 2010 11:33:23 +0200

Quoted 4 lines

Skge devices installed on some Gigabyte motherboards are not able to perform 64 dma correctly due to board PCI implementation, so limit DMA to 32bit if such boards are detected.

Quoted 7 lines
Quoted 5 lines

Bug was reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=447489

Stephen? Can I get an ACK or some kind of other status on this?

I was hoping to find the hardware somewhere to dig deeper into this. But until I know more please apply the patch. There are two possibilities that still exist, 1) it is true for all devices on this motherboard (in which cases it should be a PCI quirk),
2) it is a driver bug. The test was going to be putting a skge pci card in a slot on the MB.

maintainer
#3 lore raw

From: Stephen Hemminger <[email protected]>
Date: Wed, 6 Oct 2010 06:58:45 +0900

Quoted 16 lines
Quoted 13 lines · On Tue, 05 Oct 2010 00:18:00 -0700 (PDT) David Miller <[email protected]>…

From: Stanislaw Gruszka <[email protected]>
Date: Wed, 29 Sep 2010 11:33:23 +0200

Quoted 9 lines

Skge devices installed on some Gigabyte motherboards are not able to perform 64 dma correctly due to board PCI implementation, so limit DMA to 32bit if such boards are detected.

Bug was reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=447489

Quoted 8 lines
Quoted 1 line

Stephen? Can I get an ACK or some kind of other status on this?

I was hoping to find the hardware somewhere to dig deeper into this. But until I know more please apply the patch. There are two possibilities that still exist, 1) it is true for all devices on this motherboard (in which cases it should be a PCI quirk),
2) it is a driver bug. The test was going to be putting a skge pci card in a slot on the MB.

Ok, thanks Stephen, I'll apply his patch for now.