netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 6/8] subdance: correct initial and close hardware step.
@ 2006-10-20 21:42 akpm
  2006-11-07  9:43 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2006-10-20 21:42 UTC (permalink / raw)
  To: jeff; +Cc: netdev, akpm, jesse

From: Jesse Huang <jesse@icplus.com.tw>

Correct initial and close hardware step.  In some embedded system down and up
IP100A will cause DMA crash.  We add some for safe down and up IP100A.

Signed-off-by: Jesse Huang <jesse@icplus.com.tw>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 drivers/net/sundance.c |    8 ++++++++
 1 files changed, 8 insertions(+)

diff -puN drivers/net/sundance.c~sundance-correct-initial-and-close-hardware-step drivers/net/sundance.c
--- a/drivers/net/sundance.c~sundance-correct-initial-and-close-hardware-step
+++ a/drivers/net/sundance.c
@@ -789,6 +789,7 @@ static int netdev_open(struct net_device
 {
 	struct netdev_private *np = netdev_priv(dev);
 	void __iomem *ioaddr = np->base;
+	unsigned long flags;
 	int i;
 
 	/* Do we need to reset the chip??? */
@@ -833,6 +834,10 @@ static int netdev_open(struct net_device
 		iowrite8(0x01, ioaddr + DebugCtrl1);
 	netif_start_queue(dev);
 
+	spin_lock_irqsave(&np->lock, flags);
+	reset_tx(dev);
+	spin_unlock_irqrestore(&np->lock, flags);
+
 	iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1);
 
 	if (netif_msg_ifup(np))
@@ -1652,6 +1657,9 @@ static int netdev_close(struct net_devic
 	/* Disable interrupts by clearing the interrupt mask. */
 	iowrite16(0x0000, ioaddr + IntrEnable);
 
+	/* Disable Rx and Tx DMA for safely release resource */
+	iowrite32(0x500, ioaddr + DMACtrl);
+
 	/* Stop the chip's Tx and Rx processes. */
 	iowrite16(TxDisable | RxDisable | StatsDisable, ioaddr + MACCtrl1);
 
_

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

* Re: [patch 6/8] subdance: correct initial and close hardware step.
  2006-10-20 21:42 [patch 6/8] subdance: correct initial and close hardware step akpm
@ 2006-11-07  9:43 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2006-11-07  9:43 UTC (permalink / raw)
  To: akpm; +Cc: netdev, jesse

akpm@osdl.org wrote:
> From: Jesse Huang <jesse@icplus.com.tw>
> 
> Correct initial and close hardware step.  In some embedded system down and up
> IP100A will cause DMA crash.  We add some for safe down and up IP100A.
> 
> Signed-off-by: Jesse Huang <jesse@icplus.com.tw>
> Signed-off-by: Andrew Morton <akpm@osdl.org>

applied



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

end of thread, other threads:[~2006-11-07  9:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-20 21:42 [patch 6/8] subdance: correct initial and close hardware step akpm
2006-11-07  9:43 ` 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).