LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] amd811e: fix dma_free_coherent warning
@ 2008-10-28  1:51 chunbo.luo
  2008-10-31  4:48 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: chunbo.luo @ 2008-10-28  1:51 UTC (permalink / raw)
  To: jeff, netdev, linux-kernel; +Cc: chunbo.luo

From: Chunbo Luo <chunbo.luo@windriver.com>

Acoording commit aa24886e379d2b641c5117e178b15ce1d5d366ba,
dma_free_coherent() need irqs enabled.

This patch fix following warning messages:

WARNING: at linux/arch/x86/kernel/pci-dma.c:376 dma_free_coherent+0xaa/0xb0()

Call Trace:
 [<ffffffff8023f80f>] warn_on_slowpath+0x5f/0x90
 [<ffffffff80496ffa>] ? __kfree_skb+0x3a/0xa0
 [<ffffffff802a4723>] ? discard_slab+0x23/0x40
 [<ffffffff8021274a>] dma_free_coherent+0xaa/0xb0
 [<ffffffff8043668f>] amd8111e_close+0x10f/0x1b0
 [<ffffffff8049f3ae>] dev_close+0x5e/0xb0
 [<ffffffff8049efa1>] dev_change_flags+0xa1/0x1e0
 [<ffffffff806b2171>] ic_close_devs+0x36/0x4e
 [<ffffffff806b29ee>] ip_auto_config+0x581/0x10f3
 [<ffffffff803a6e19>] ? kobject_add+0x69/0x90
 [<ffffffff803a698a>] ? kobject_get+0x1a/0x30
 [<ffffffff803a785b>] ? kobject_uevent+0xb/0x10
 [<ffffffff803a6c62>] ? kset_register+0x52/0x60
 [<ffffffff803a6f9b>] ? kset_create_and_add+0x6b/0xa0
 [<ffffffff804e2e74>] ? tcp_ca_find+0x24/0x50
 [<ffffffff806b246d>] ? ip_auto_config+0x0/0x10f3
 [<ffffffff8020903c>] _stext+0x3c/0x150
 [<ffffffff802772d3>] ? register_irq_proc+0xd3/0xf0
 [<ffffffff802f0000>] ? mb_cache_create+0x80/0x1f0
 [<ffffffff80688693>] kernel_init+0x141/0x1b8
 [<ffffffff80688552>] ? kernel_init+0x0/0x1b8
 [<ffffffff8020d609>] child_rip+0xa/0x11
 [<ffffffff80688552>] ? kernel_init+0x0/0x1b8
 [<ffffffff80688552>] ? kernel_init+0x0/0x1b8
 [<ffffffff8020d5ff>] ? child_rip+0x0/0x11

Signed-off-by: Chunbo Luo <chunbo.luo@windriver.com>
---
 drivers/net/amd8111e.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
index c54967f..6dd35e3 100644
--- a/drivers/net/amd8111e.c
+++ b/drivers/net/amd8111e.c
@@ -644,10 +644,6 @@ This function frees the  transmiter and receiver descriptor rings.
 */
 static void amd8111e_free_ring(struct amd8111e_priv* lp)
 {
-
-	/* Free transmit and receive skbs */
-	amd8111e_free_skbs(lp->amd8111e_net_dev);
-
 	/* Free transmit and receive descriptor rings */
 	if(lp->rx_ring){
 		pci_free_consistent(lp->pci_dev,
@@ -1231,7 +1227,9 @@ static int amd8111e_close(struct net_device * dev)
 
 	amd8111e_disable_interrupt(lp);
 	amd8111e_stop_chip(lp);
-	amd8111e_free_ring(lp);
+
+	/* Free transmit and receive skbs */
+	amd8111e_free_skbs(lp->amd8111e_net_dev);
 
 	netif_carrier_off(lp->amd8111e_net_dev);
 
@@ -1241,6 +1239,7 @@ static int amd8111e_close(struct net_device * dev)
 
 	spin_unlock_irq(&lp->lock);
 	free_irq(dev->irq, dev);
+	amd8111e_free_ring(lp);
 
 	/* Update the statistics before closing */
 	amd8111e_get_stats(dev);
-- 
1.5.5.1


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

* Re: [PATCH] amd811e: fix dma_free_coherent warning
  2008-10-28  1:51 [PATCH] amd811e: fix dma_free_coherent warning chunbo.luo
@ 2008-10-31  4:48 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2008-10-31  4:48 UTC (permalink / raw)
  To: chunbo.luo; +Cc: netdev, linux-kernel

chunbo.luo@windriver.com wrote:
> From: Chunbo Luo <chunbo.luo@windriver.com>
> 
> Acoording commit aa24886e379d2b641c5117e178b15ce1d5d366ba,
> dma_free_coherent() need irqs enabled.
> 
> This patch fix following warning messages:
> 
> WARNING: at linux/arch/x86/kernel/pci-dma.c:376 dma_free_coherent+0xaa/0xb0()
> 
> Call Trace:
>  [<ffffffff8023f80f>] warn_on_slowpath+0x5f/0x90
>  [<ffffffff80496ffa>] ? __kfree_skb+0x3a/0xa0
>  [<ffffffff802a4723>] ? discard_slab+0x23/0x40
>  [<ffffffff8021274a>] dma_free_coherent+0xaa/0xb0
>  [<ffffffff8043668f>] amd8111e_close+0x10f/0x1b0
>  [<ffffffff8049f3ae>] dev_close+0x5e/0xb0
>  [<ffffffff8049efa1>] dev_change_flags+0xa1/0x1e0
>  [<ffffffff806b2171>] ic_close_devs+0x36/0x4e
>  [<ffffffff806b29ee>] ip_auto_config+0x581/0x10f3
>  [<ffffffff803a6e19>] ? kobject_add+0x69/0x90
>  [<ffffffff803a698a>] ? kobject_get+0x1a/0x30
>  [<ffffffff803a785b>] ? kobject_uevent+0xb/0x10
>  [<ffffffff803a6c62>] ? kset_register+0x52/0x60
>  [<ffffffff803a6f9b>] ? kset_create_and_add+0x6b/0xa0
>  [<ffffffff804e2e74>] ? tcp_ca_find+0x24/0x50
>  [<ffffffff806b246d>] ? ip_auto_config+0x0/0x10f3
>  [<ffffffff8020903c>] _stext+0x3c/0x150
>  [<ffffffff802772d3>] ? register_irq_proc+0xd3/0xf0
>  [<ffffffff802f0000>] ? mb_cache_create+0x80/0x1f0
>  [<ffffffff80688693>] kernel_init+0x141/0x1b8
>  [<ffffffff80688552>] ? kernel_init+0x0/0x1b8
>  [<ffffffff8020d609>] child_rip+0xa/0x11
>  [<ffffffff80688552>] ? kernel_init+0x0/0x1b8
>  [<ffffffff80688552>] ? kernel_init+0x0/0x1b8
>  [<ffffffff8020d5ff>] ? child_rip+0x0/0x11
> 
> Signed-off-by: Chunbo Luo <chunbo.luo@windriver.com>
> ---
>  drivers/net/amd8111e.c |    9 ++++-----
>  1 files changed, 4 insertions(+), 5 deletions(-)

applied



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

end of thread, other threads:[~2008-10-31  4:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-28  1:51 [PATCH] amd811e: fix dma_free_coherent warning chunbo.luo
2008-10-31  4:48 ` 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).