linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BK PATCHES] net driver fixes
@ 2003-11-08 17:27 Jeff Garzik
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2003-11-08 17:27 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, netdev


Linus, please do a

	bk pull bk://gkernel.bkbits.net/net-drivers-2.5

This will update the following files:

 drivers/net/b44.c     |   56 ++++++++++++++++++++++++++++++++++++++++++++++++--
 drivers/net/pcnet32.c |    4 +++
 2 files changed, 58 insertions(+), 2 deletions(-)

through these ChangeSets:

<ralf@linux-mips.org> (03/11/08 1.1416)
   [netdrvr pcnet32] add missing pci_dma_sync_single
   
   a patch for the pcnet32.c driver which adds a missing call to
   pci_dma_sync_single.  If a received packet is smaller than rx_copybreak
   the pcnet driver will recycle the receive buffer which requires calling
   pci_dma_sync_single.  Patch is against 2.6 but I it's also needed in 2.4.
   
   Without that call the processor might still have old stale data in
   the data cache when the processor accesses the recycled buffer.
   

<pp@ee.oulu.fi> (03/11/08 1.1415)
   [netdrvr b44] Fix irq enable/disable; fix oops due to lack of SET_NETDEV_DEV() call
   
   Also, add suspend/resume functions.


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

* Re: [BK PATCHES] net driver fixes
  2003-12-05 18:30 Jeff Garzik
@ 2003-12-05 18:54 ` Jeff Garzik
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2003-12-05 18:54 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, linux-kernel

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

Jeff Garzik wrote:
> Linus, please do a
> 
> 	bk pull bk://gkernel.bkbits.net/net-drivers-2.5
> 
> This will update the following files:
> 
>  drivers/net/pci-skeleton.c |    7 ---
>  drivers/net/pcnet32.c      |    2 
>  drivers/net/r8169.c        |    4 -
>  drivers/net/sis190.c       |    4 -
>  drivers/net/typhoon.c      |   97 ++++++++++++++++++++++++++++++++++++---------
>  5 files changed, 78 insertions(+), 36 deletions(-)


So following that email... you just wanna truncate this patch -- snip 
the typhoon portion and apply the rest?

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 2671 bytes --]


This will update the following files:

 drivers/net/pci-skeleton.c |    7 ---
 drivers/net/pcnet32.c      |    2 
 drivers/net/r8169.c        |    4 -
 drivers/net/sis190.c       |    4 -

through these ChangeSets:

<jgarzik@redhat.com> (03/12/05 1.1499)
   [netdrvr pcnet32] fix oops on unload
   
   Driver was calling pci_unregister_driver for each _device_, and then
   again at the end of the module unload routine.  Remove the call that's
   inside the loop, pci_unregister_driver should only be called once.
   
   Caught by Don Fry (and many others)

<viro@parcelfarce.linux.theplanet.co.uk> (03/12/03 1.1496.1.9)
   [netdrvr] remove manual driver poisoning of net_device
   
   Such poisoning can cause oopses either because the refcount is not
   zero when the poisoning occurs, or due to kernel debugging options
   being enabled.


diff -Nru a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c
--- a/drivers/net/pci-skeleton.c	Fri Dec  5 13:22:32 2003
+++ b/drivers/net/pci-skeleton.c	Fri Dec  5 13:22:32 2003
@@ -864,13 +864,6 @@
 
 	pci_release_regions (pdev);
 
-#ifndef NETDRV_NDEBUG
-	/* poison memory before freeing */
-	memset (dev, 0xBC,
-		sizeof (struct net_device) +
-		sizeof (struct netdrv_private));
-#endif /* NETDRV_NDEBUG */
-
 	free_netdev (dev);
 
 	pci_set_drvdata (pdev, NULL);
diff -Nru a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
--- a/drivers/net/pcnet32.c	Fri Dec  5 13:22:32 2003
+++ b/drivers/net/pcnet32.c	Fri Dec  5 13:22:32 2003
@@ -1766,8 +1766,6 @@
 	next_dev = lp->next;
 	unregister_netdev(pcnet32_dev);
 	release_region(pcnet32_dev->base_addr, PCNET32_TOTAL_SIZE);
-	if (lp->pci_dev)
-	    pci_unregister_driver(&pcnet32_driver);
 	pci_free_consistent(lp->pci_dev, sizeof(*lp), lp, lp->dma_addr);
 	free_netdev(pcnet32_dev);
 	pcnet32_dev = next_dev;
diff -Nru a/drivers/net/r8169.c b/drivers/net/r8169.c
--- a/drivers/net/r8169.c	Fri Dec  5 13:22:32 2003
+++ b/drivers/net/r8169.c	Fri Dec  5 13:22:32 2003
@@ -642,10 +642,6 @@
 	iounmap(tp->mmio_addr);
 	pci_release_regions(pdev);
 
-	// poison memory before freeing 
-	memset(dev, 0xBC,
-	       sizeof (struct net_device) + sizeof (struct rtl8169_private));
-
 	pci_disable_device(pdev);
 	free_netdev(dev);
 	pci_set_drvdata(pdev, NULL);
diff -Nru a/drivers/net/sis190.c b/drivers/net/sis190.c
--- a/drivers/net/sis190.c	Fri Dec  5 13:22:32 2003
+++ b/drivers/net/sis190.c	Fri Dec  5 13:22:32 2003
@@ -703,10 +703,6 @@
 	iounmap(tp->mmio_addr);
 	pci_release_regions(pdev);
 
-	// poison memory before freeing 
-	memset(dev, 0xBC,
-	       sizeof (struct net_device) + sizeof (struct sis190_private));
-
 	free_netdev(dev);
 	pci_set_drvdata(pdev, NULL);
 }

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

* [BK PATCHES] net driver fixes
@ 2003-12-05 18:30 Jeff Garzik
  2003-12-05 18:54 ` Jeff Garzik
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Garzik @ 2003-12-05 18:30 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, linux-kernel


Linus, please do a

	bk pull bk://gkernel.bkbits.net/net-drivers-2.5

This will update the following files:

 drivers/net/pci-skeleton.c |    7 ---
 drivers/net/pcnet32.c      |    2 
 drivers/net/r8169.c        |    4 -
 drivers/net/sis190.c       |    4 -
 drivers/net/typhoon.c      |   97 ++++++++++++++++++++++++++++++++++++---------
 5 files changed, 78 insertions(+), 36 deletions(-)

through these ChangeSets:

<jgarzik@redhat.com> (03/12/05 1.1499)
   [netdrvr pcnet32] fix oops on unload
   
   Driver was calling pci_unregister_driver for each _device_, and then
   again at the end of the module unload routine.  Remove the call that's
   inside the loop, pci_unregister_driver should only be called once.
   
   Caught by Don Fry (and many others)

<viro@parcelfarce.linux.theplanet.co.uk> (03/12/03 1.1496.1.9)
   [netdrvr] remove manual driver poisoning of net_device
   
   Such poisoning can cause oopses either because the refcount is not
   zero when the poisoning occurs, or due to kernel debugging options
   being enabled.

<dave@thedillows.org> (03/11/26 1.1486.1.1)
   Bug fixes:
   * Avoid short timeouts when waiting for a reset
   * Fix issue with loading runtime image on newer versions of the sleep image
   * Fix link status reporting

diff -Nru a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c
--- a/drivers/net/pci-skeleton.c	Fri Dec  5 13:22:32 2003
+++ b/drivers/net/pci-skeleton.c	Fri Dec  5 13:22:32 2003
@@ -864,13 +864,6 @@
 
 	pci_release_regions (pdev);
 
-#ifndef NETDRV_NDEBUG
-	/* poison memory before freeing */
-	memset (dev, 0xBC,
-		sizeof (struct net_device) +
-		sizeof (struct netdrv_private));
-#endif /* NETDRV_NDEBUG */
-
 	free_netdev (dev);
 
 	pci_set_drvdata (pdev, NULL);
diff -Nru a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
--- a/drivers/net/pcnet32.c	Fri Dec  5 13:22:32 2003
+++ b/drivers/net/pcnet32.c	Fri Dec  5 13:22:32 2003
@@ -1766,8 +1766,6 @@
 	next_dev = lp->next;
 	unregister_netdev(pcnet32_dev);
 	release_region(pcnet32_dev->base_addr, PCNET32_TOTAL_SIZE);
-	if (lp->pci_dev)
-	    pci_unregister_driver(&pcnet32_driver);
 	pci_free_consistent(lp->pci_dev, sizeof(*lp), lp, lp->dma_addr);
 	free_netdev(pcnet32_dev);
 	pcnet32_dev = next_dev;
diff -Nru a/drivers/net/r8169.c b/drivers/net/r8169.c
--- a/drivers/net/r8169.c	Fri Dec  5 13:22:32 2003
+++ b/drivers/net/r8169.c	Fri Dec  5 13:22:32 2003
@@ -642,10 +642,6 @@
 	iounmap(tp->mmio_addr);
 	pci_release_regions(pdev);
 
-	// poison memory before freeing 
-	memset(dev, 0xBC,
-	       sizeof (struct net_device) + sizeof (struct rtl8169_private));
-
 	pci_disable_device(pdev);
 	free_netdev(dev);
 	pci_set_drvdata(pdev, NULL);
diff -Nru a/drivers/net/sis190.c b/drivers/net/sis190.c
--- a/drivers/net/sis190.c	Fri Dec  5 13:22:32 2003
+++ b/drivers/net/sis190.c	Fri Dec  5 13:22:32 2003
@@ -703,10 +703,6 @@
 	iounmap(tp->mmio_addr);
 	pci_release_regions(pdev);
 
-	// poison memory before freeing 
-	memset(dev, 0xBC,
-	       sizeof (struct net_device) + sizeof (struct sis190_private));
-
 	free_netdev(dev);
 	pci_set_drvdata(pdev, NULL);
 }
diff -Nru a/drivers/net/typhoon.c b/drivers/net/typhoon.c
--- a/drivers/net/typhoon.c	Fri Dec  5 13:22:32 2003
+++ b/drivers/net/typhoon.c	Fri Dec  5 13:22:32 2003
@@ -85,8 +85,8 @@
 #define PKT_BUF_SZ		1536
 
 #define DRV_MODULE_NAME		"typhoon"
-#define DRV_MODULE_VERSION 	"1.5.1"
-#define DRV_MODULE_RELDATE	"03/06/26"
+#define DRV_MODULE_VERSION 	"1.5.2"
+#define DRV_MODULE_RELDATE	"03/11/25"
 #define PFX			DRV_MODULE_NAME ": "
 #define ERR_PFX			KERN_ERR PFX
 
@@ -127,7 +127,7 @@
 static char version[] __devinitdata =
     "typhoon.c: version " DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
 
-MODULE_AUTHOR("David Dillow <dillowd@y12.doe.gov>");
+MODULE_AUTHOR("David Dillow <dave@thedillows.org>");
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("3Com Typhoon Family (3C990, 3CR990, and variants)");
 MODULE_PARM(rx_copybreak, "i");
@@ -146,11 +146,12 @@
 	int capabilities;
 };
 
-#define TYPHOON_CRYPTO_NONE		0
-#define TYPHOON_CRYPTO_DES		1
-#define TYPHOON_CRYPTO_3DES		2
-#define	TYPHOON_CRYPTO_VARIABLE		4
-#define TYPHOON_FIBER			8
+#define TYPHOON_CRYPTO_NONE		0x00
+#define TYPHOON_CRYPTO_DES		0x01
+#define TYPHOON_CRYPTO_3DES		0x02
+#define	TYPHOON_CRYPTO_VARIABLE		0x04
+#define TYPHOON_FIBER			0x08
+#define TYPHOON_WAKEUP_NEEDS_RESET	0x10
 
 enum typhoon_cards {
 	TYPHOON_TX = 0, TYPHOON_TX95, TYPHOON_TX97, TYPHOON_SVR,
@@ -307,7 +308,8 @@
 /* We'll wait up to six seconds for a reset, and half a second normally.
  */
 #define TYPHOON_UDELAY			50
-#define TYPHOON_RESET_TIMEOUT		(6 * HZ)
+#define TYPHOON_RESET_TIMEOUT_SLEEP	(6 * HZ)
+#define TYPHOON_RESET_TIMEOUT_NOSLEEP	((6 * 1000000) / TYPHOON_UDELAY)
 #define TYPHOON_WAIT_TIMEOUT		((1000000 / 2) / TYPHOON_UDELAY)
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 28)
@@ -375,10 +377,12 @@
 typhoon_reset(unsigned long ioaddr, int wait_type)
 {
 	int i, err = 0;
-	int timeout = TYPHOON_RESET_TIMEOUT;
+	int timeout;
 
 	if(wait_type == WaitNoSleep)
-		timeout = (timeout * 1000000) / (HZ * TYPHOON_UDELAY);
+		timeout = TYPHOON_RESET_TIMEOUT_NOSLEEP;
+	else
+		timeout = TYPHOON_RESET_TIMEOUT_SLEEP;
 
 	writel(TYPHOON_INTR_ALL, ioaddr + TYPHOON_REG_INTR_MASK);
 	writel(TYPHOON_INTR_ALL, ioaddr + TYPHOON_REG_INTR_STATUS);
@@ -1858,6 +1862,11 @@
 	if(typhoon_wait_status(ioaddr, TYPHOON_STATUS_SLEEPING) < 0)
 		return -ETIMEDOUT;
 
+	/* Since we cannot monitor the status of the link while sleeping,
+	 * tell the world it went away.
+	 */
+	netif_carrier_off(tp->dev);
+
 	pci_enable_wake(tp->pdev, state, 1);
 	pci_disable_device(pdev);
 	return pci_set_power_state(pdev, state);
@@ -1872,8 +1881,13 @@
 	pci_set_power_state(pdev, 0);
 	pci_restore_state(pdev, tp->pci_state);
 
+	/* Post 2.x.x versions of the Sleep Image require a reset before
+	 * we can download the Runtime Image. But let's not make users of
+	 * the old firmware pay for the reset.
+	 */
 	writel(TYPHOON_BOOTCMD_WAKEUP, ioaddr + TYPHOON_REG_COMMAND);
-	if(typhoon_wait_status(ioaddr, TYPHOON_STATUS_WAITING_FOR_HOST) < 0)
+	if(typhoon_wait_status(ioaddr, TYPHOON_STATUS_WAITING_FOR_HOST) < 0 ||
+			(tp->capabilities & TYPHOON_WAKEUP_NEEDS_RESET))
 		return typhoon_reset(ioaddr, wait_type);
 
 	return 0;
@@ -2251,7 +2265,7 @@
 	void *shared;
 	dma_addr_t shared_dma;
 	struct cmd_desc xp_cmd;
-	struct resp_desc xp_resp;
+	struct resp_desc xp_resp[3];
 	int i;
 	int err = 0;
 
@@ -2380,15 +2394,15 @@
 	}
 
 	INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_MAC_ADDRESS);
-	if(typhoon_issue_command(tp, 1, &xp_cmd, 1, &xp_resp) < 0) {
+	if(typhoon_issue_command(tp, 1, &xp_cmd, 1, xp_resp) < 0) {
 		printk(ERR_PFX "%s: cannot read MAC address\n",
 		       pci_name(pdev));
 		err = -EIO;
 		goto error_out_reset;
 	}
 
-	*(u16 *)&dev->dev_addr[0] = htons(le16_to_cpu(xp_resp.parm1));
-	*(u32 *)&dev->dev_addr[2] = htonl(le32_to_cpu(xp_resp.parm2));
+	*(u16 *)&dev->dev_addr[0] = htons(le16_to_cpu(xp_resp[0].parm1));
+	*(u32 *)&dev->dev_addr[2] = htonl(le32_to_cpu(xp_resp[0].parm2));
 
 	if(!is_valid_ether_addr(dev->dev_addr)) {
 		printk(ERR_PFX "%s: Could not obtain valid ethernet address, "
@@ -2396,6 +2410,28 @@
 		goto error_out_reset;
 	}
 
+	/* Read the Sleep Image version last, so the response is valid
+	 * later when we print out the version reported.
+	 */
+	INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_VERSIONS);
+	if(typhoon_issue_command(tp, 1, &xp_cmd, 3, xp_resp) < 0) {
+		printk(ERR_PFX "%s: Could not get Sleep Image version\n",
+			pdev->slot_name);
+		goto error_out_reset;
+	}
+
+	tp->capabilities = typhoon_card_info[card_id].capabilities;
+	tp->xcvr_select = TYPHOON_XCVR_AUTONEG;
+
+	/* Typhoon 1.0 Sleep Images return one response descriptor to the
+	 * READ_VERSIONS command. Those versions are OK after waking up
+	 * from sleep without needing a reset. Typhoon 1.1+ Sleep Images
+	 * seem to need a little extra help to get started. Since we don't
+	 * know how to nudge it along, just kick it.
+	 */
+	if(xp_resp[0].numDesc != 0)
+		tp->capabilities |= TYPHOON_WAKEUP_NEEDS_RESET;
+
 	if(typhoon_sleep(tp, 3, 0) < 0) {
 		printk(ERR_PFX "%s: cannot put adapter to sleep\n",
 		       pci_name(pdev));
@@ -2403,9 +2439,6 @@
 		goto error_out_reset;
 	}
 
-	tp->capabilities = typhoon_card_info[card_id].capabilities;
-	tp->xcvr_select = TYPHOON_XCVR_AUTONEG;
-
 	/* The chip-specific entries in the device structure. */
 	dev->open		= typhoon_open;
 	dev->hard_start_xmit	= typhoon_start_tx;
@@ -2442,6 +2475,32 @@
 		printk("%2.2x:", dev->dev_addr[i]);
 	printk("%2.2x\n", dev->dev_addr[i]);
 
+	/* xp_resp still contains the response to the READ_VERSIONS command.
+	 * For debugging, let the user know what version he has.
+	 */
+	if(xp_resp[0].numDesc == 0) {
+		/* This is the Typhoon 1.0 type Sleep Image, last 16 bits
+		 * of version is Month/Day of build.
+		 */
+		u16 monthday = le32_to_cpu(xp_resp[0].parm2) & 0xffff;
+		printk(KERN_INFO "%s: Typhoon 1.0 Sleep Image built "
+			"%02u/%02u/2000\n", dev->name, monthday >> 8,
+			monthday & 0xff);
+	} else if(xp_resp[0].numDesc == 2) {
+		/* This is the Typhoon 1.1+ type Sleep Image
+		 */
+		u32 sleep_ver = le32_to_cpu(xp_resp[0].parm2);
+		u8 *ver_string = (u8 *) &xp_resp[1];
+		ver_string[25] = 0;
+		printk(KERN_INFO "%s: Typhoon 1.1+ Sleep Image version "
+			"%u.%u.%u.%u %s\n", dev->name, HIPQUAD(sleep_ver),
+			ver_string);
+	} else {
+		printk(KERN_WARNING "%s: Unknown Sleep Image version "
+			"(%u:%04x)\n", dev->name, xp_resp[0].numDesc,
+			le32_to_cpu(xp_resp[0].parm2));
+	}
+		
 	return 0;
 
 error_out_reset:

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

* [BK PATCHES] net driver fixes
@ 2003-02-13  7:57 Jeff Garzik
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2003-02-13  7:57 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: lkml

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



[-- Attachment #2: net-drivers-2.5.txt --]
[-- Type: text/plain, Size: 1165 bytes --]

Linus, please do a

	bk pull bk://kernel.bkbits.net/jgarzik/net-drivers-2.5

This will update the following files:

 drivers/net/amd8111e.c        |    2 +-
 drivers/net/arlan.c           |    2 +-
 drivers/net/fc/iph5526.c      |    2 +-
 drivers/net/tg3.c             |    7 +++++--
 drivers/net/tokenring/smctr.c |    2 +-
 5 files changed, 9 insertions(+), 6 deletions(-)

through these ChangeSets:

<jgarzik@redhat.com> (03/02/13 1.1037)
   [netdrvr arlan] fix the fixed fix. really.
   
   struct arlan_private clearly needs to be a pointer.

<jgarzik@redhat.com> (03/02/13 1.1036)
   [netdrvr tg3] DMA MRM bit only exists on 5700, 5701
   
   Fixed by David Miller, spotted by Manish Lachwani.

<jgarzik@redhat.com> (03/02/13 1.1035)
   [netdrvr amd8111e] remove stray ';', fixing register dump [#311]
   
   Fixes bugzilla bug #311.

<jgarzik@redhat.com> (03/02/13 1.1034)
   [tokenring smctr] remove stray ';' that prevented a loop from working [#312]
   
   Fixes broken node address check, and bugzilla bug #312.

<jgarzik@redhat.com> (03/02/13 1.1033)
   [netdrvr fc/iphase] correct PCI probe loop-end test logic [#323]
   
   Fixes bugzilla bug #323.


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

end of thread, other threads:[~2003-12-05 18:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-08 17:27 [BK PATCHES] net driver fixes Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2003-12-05 18:30 Jeff Garzik
2003-12-05 18:54 ` Jeff Garzik
2003-02-13  7:57 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).