netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PCI fix for some platforms
@ 2004-06-30  8:52 Andriy Korud
  2004-06-30  9:01 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Andriy Korud @ 2004-06-30  8:52 UTC (permalink / raw)
  To: netdev; +Cc: prism54-private

[-- Attachment #1: Type: text/plain, Size: 405 bytes --]

Hi,
i've noticed that on some platforms (noticed on PPC/XScale embedded) PCI cacheline size is not initialized properly and therefore card uses slow "PCI read memory" command instead of optimal "PCI read memory line", which cause serious bendwidth limitations in case of 3+ cards on single PCI bus.

Attached patch that fix this issue - please merge review.

regards,

--

Andriy Korud

 



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: pci-fix.patch --]
[-- Type: text/x-diff; name="pci-fix.patch", Size: 803 bytes --]

diff -ur prism54-cvs-latest/ksrc/islpci_dev.c prism54-cvs-latest-fix/ksrc/islpci_dev.c
--- prism54-cvs-latest/ksrc/islpci_dev.c	2004-05-29 18:06:49.000000000 +0300
+++ prism54-cvs-latest-fix/ksrc/islpci_dev.c	2004-06-29 18:52:02.006520304 +0300
@@ -773,6 +773,7 @@
 struct net_device *
 islpci_setup(struct pci_dev *pdev)
 {
+	u_int8_t cz;
 	islpci_private *priv;
 	struct net_device *ndev = alloc_etherdev(sizeof (islpci_private));
 
@@ -785,6 +786,12 @@
 	SET_NETDEV_DEV(ndev, &pdev->dev);
 #endif
 
+	pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &csz);
+        if (csz == 0) {
+		csz = L1_CACHE_BYTES / sizeof(u_int32_t);
+		pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, csz);
+	}
+
 	/* setup the structure members */
 	ndev->base_addr = pci_resource_start(pdev, 0);
 	ndev->irq = pdev->irq;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-06-30  9:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-30  8:52 PCI fix for some platforms Andriy Korud
2004-06-30  9:01 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).