diff mbox

[2/9] sky2: more receive shutdown

Message ID 20090617173139.582840975@vyatta.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

stephen hemminger June 17, 2009, 5:30 p.m. UTC
Reset more parts of the receive path when device is take offline.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Comments

David Miller June 18, 2009, 1:50 a.m. UTC | #1
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Wed, 17 Jun 2009 10:30:33 -0700

> Reset more parts of the receive path when device is take offline.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.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
Graham Murray June 20, 2009, 7:14 a.m. UTC | #2
Stephen Hemminger <shemminger@vyatta.com> writes:

> Reset more parts of the receive path when device is take offline.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> --- a/drivers/net/sky2.c	2009-06-17 10:29:50.630937431 -0700
> +++ b/drivers/net/sky2.c	2009-06-17 10:29:52.005685817 -0700
> @@ -1151,7 +1151,14 @@ stopped:
>  
>  	/* reset the Rx prefetch unit */
>  	sky2_write32(hw, Y2_QADDR(rxq, PREF_UNIT_CTRL), PREF_UNIT_RST_SET);
> -	mmiowb();
> +
> +	/* Reset the RAM Buffer receive queue */
> +	sky2_write8(hw, RB_ADDR(rxq, RB_CTRL), RB_RST_SET);
> +
> +	/* Reset Rx MAC FIFO */
> +	sky2_write8(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), GMF_RST_SET);
> +
> +	sky2_read8(hw, B0_CTST);
>  }
>  
>  /* Clean out receive buffer area, assumes receiver hardware stopped */

With this this patch applied, the receive on my network card does not
work from boot. Git bisect identified this as the 'bad' commit and after
reverting it all works properly.

Here are the entries for sky2 and eth0 from the system log for a boot
with the patch enabled:-

Jun 20 06:38:25 newton sky2 driver version 1.23
Jun 20 06:38:25 newton sky2 0000:04:00.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
Jun 20 06:38:25 newton sky2 0000:04:00.0: setting latency timer to 64
Jun 20 06:38:25 newton sky2 0000:04:00.0: Yukon-2 EC chip revision 2
Jun 20 06:38:25 newton sky2 0000:04:00.0: irq 30 for MSI/MSI-X
Jun 20 06:38:25 newton sky2 eth0: addr 00:1b:fc:65:82:93
Jun 20 06:38:25 newton sky2 0000:03:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
Jun 20 06:38:25 newton sky2 0000:03:00.0: setting latency timer to 64
Jun 20 06:38:25 newton sky2 0000:03:00.0: Yukon-2 EC chip revision 2
Jun 20 06:38:25 newton sky2 0000:03:00.0: irq 31 for MSI/MSI-X
Jun 20 06:38:25 newton sky2 eth1: addr 00:1b:fc:65:7c:be
Jun 20 06:38:25 newton sky2 eth0: enabling interface
Jun 20 06:38:25 newton ADDRCONF(NETDEV_UP): eth0: link is not ready
Jun 20 06:38:28 newton sky2 eth0: Link is up at 100 Mbps, full duplex, flow control both
Jun 20 06:38:28 newton ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

lspci -v
03:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8053 PCI-E Gigabit Ethernet Controller (rev 20)
        Subsystem: ASUSTeK Computer Inc. Marvell 88E8053 Gigabit Ethernet controller PCIe (Asus)
        Flags: bus master, fast devsel, latency 0, IRQ 31
        Memory at ff7fc000 (64-bit, non-prefetchable) [size=16K]
        I/O ports at a800 [size=256]
        Expansion ROM at ff7c0000 [disabled] [size=128K]
        Capabilities: [48] Power Management version 2
        Capabilities: [50] Vital Product Data
        Capabilities: [5c] MSI: Mask- 64bit+ Count=1/2 Enable+
        Capabilities: [e0] Express Legacy Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Kernel driver in use: sky2
        Kernel modules: sky2
--
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
Graham Murray June 22, 2009, 5:13 a.m. UTC | #3
Graham Murray <gmurray@webwayone.co.uk> writes:

> With this this patch applied, the receive on my network card does not
> work from boot. Git bisect identified this as the 'bad' commit and after
> reverting it all works properly.

I should add that there is no panic, BUG, oops etc, nor any other
printk messages, the interface just does not work.
--
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

--- a/drivers/net/sky2.c	2009-06-17 10:29:50.630937431 -0700
+++ b/drivers/net/sky2.c	2009-06-17 10:29:52.005685817 -0700
@@ -1151,7 +1151,14 @@  stopped:
 
 	/* reset the Rx prefetch unit */
 	sky2_write32(hw, Y2_QADDR(rxq, PREF_UNIT_CTRL), PREF_UNIT_RST_SET);
-	mmiowb();
+
+	/* Reset the RAM Buffer receive queue */
+	sky2_write8(hw, RB_ADDR(rxq, RB_CTRL), RB_RST_SET);
+
+	/* Reset Rx MAC FIFO */
+	sky2_write8(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), GMF_RST_SET);
+
+	sky2_read8(hw, B0_CTST);
 }
 
 /* Clean out receive buffer area, assumes receiver hardware stopped */