[PATCH] amd811e: fix dma_free_coherent warning - Kernel

This is a discussion on [PATCH] amd811e: fix dma_free_coherent warning - Kernel ; From: Chunbo Luo 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: [ ] warn_on_slowpath+0x5f/0x90 [ ] ? __kfree_skb+0x3a/0xa0 [ ] ? discard_slab+0x23/0x40 [ ] dma_free_coherent+0xaa/0xb0 [ ] amd8111e_close+0x10f/0x1b0 [ ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: [PATCH] amd811e: fix dma_free_coherent warning

  1. [PATCH] amd811e: fix dma_free_coherent warning

    From: Chunbo Luo

    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:
    [] warn_on_slowpath+0x5f/0x90
    [] ? __kfree_skb+0x3a/0xa0
    [] ? discard_slab+0x23/0x40
    [] dma_free_coherent+0xaa/0xb0
    [] amd8111e_close+0x10f/0x1b0
    [] dev_close+0x5e/0xb0
    [] dev_change_flags+0xa1/0x1e0
    [] ic_close_devs+0x36/0x4e
    [] ip_auto_config+0x581/0x10f3
    [] ? kobject_add+0x69/0x90
    [] ? kobject_get+0x1a/0x30
    [] ? kobject_uevent+0xb/0x10
    [] ? kset_register+0x52/0x60
    [] ? kset_create_and_add+0x6b/0xa0
    [] ? tcp_ca_find+0x24/0x50
    [] ? ip_auto_config+0x0/0x10f3
    [] _stext+0x3c/0x150
    [] ? register_irq_proc+0xd3/0xf0
    [] ? mb_cache_create+0x80/0x1f0
    [] kernel_init+0x141/0x1b8
    [] ? kernel_init+0x0/0x1b8
    [] child_rip+0xa/0x11
    [] ? kernel_init+0x0/0x1b8
    [] ? kernel_init+0x0/0x1b8
    [] ? child_rip+0x0/0x11

    Signed-off-by: Chunbo Luo
    ---
    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

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: [PATCH] amd811e: fix dma_free_coherent warning

    chunbo.luo@windriver.com wrote:
    > From: Chunbo Luo
    >
    > 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:
    > [] warn_on_slowpath+0x5f/0x90
    > [] ? __kfree_skb+0x3a/0xa0
    > [] ? discard_slab+0x23/0x40
    > [] dma_free_coherent+0xaa/0xb0
    > [] amd8111e_close+0x10f/0x1b0
    > [] dev_close+0x5e/0xb0
    > [] dev_change_flags+0xa1/0x1e0
    > [] ic_close_devs+0x36/0x4e
    > [] ip_auto_config+0x581/0x10f3
    > [] ? kobject_add+0x69/0x90
    > [] ? kobject_get+0x1a/0x30
    > [] ? kobject_uevent+0xb/0x10
    > [] ? kset_register+0x52/0x60
    > [] ? kset_create_and_add+0x6b/0xa0
    > [] ? tcp_ca_find+0x24/0x50
    > [] ? ip_auto_config+0x0/0x10f3
    > [] _stext+0x3c/0x150
    > [] ? register_irq_proc+0xd3/0xf0
    > [] ? mb_cache_create+0x80/0x1f0
    > [] kernel_init+0x141/0x1b8
    > [] ? kernel_init+0x0/0x1b8
    > [] child_rip+0xa/0x11
    > [] ? kernel_init+0x0/0x1b8
    > [] ? kernel_init+0x0/0x1b8
    > [] ? child_rip+0x0/0x11
    >
    > Signed-off-by: Chunbo Luo
    > ---
    > drivers/net/amd8111e.c | 9 ++++-----
    > 1 files changed, 4 insertions(+), 5 deletions(-)


    applied


    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread