[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] netfront: Lockdep fixes



Hi Jeremy:

Jeremy Fitzhardinge <jeremy@xxxxxxxxxxxxx> wrote:
> 
> @@ -1307,10 +1307,10 @@ static int netif_poll(struct net_device 
>        int pages_flipped = 0;
>        int err;
> 
> -       spin_lock(&np->rx_lock);
> +       spin_lock_bh(&np->rx_lock);

The ->poll method is guaranteed to be called with BH disabled so
this isn't necessary.

> @@ -1588,7 +1588,7 @@ static void netif_release_rx_bufs(struct
>        while ((skb = __skb_dequeue(&free_list)) != NULL)
>                dev_kfree_skb(skb);
> 
> -       spin_unlock(&np->rx_lock);
> +       spin_unlock_bh(&np->rx_lock);
> }

Just a minor nit.  This is normally called with BH disabled,
except from uninit so you could put a local_bh_disable there
instead.

> static int network_close(struct net_device *dev)
> @@ -1708,8 +1708,8 @@ static int network_connect(struct net_de
>        IPRINTK("device %s has %sing receive path.\n",
>                dev->name, np->copying_receiver ? "copy" : "flipp");
> 
> +       spin_lock_bh(&np->rx_lock);
>        spin_lock_irq(&np->tx_lock);
> -       spin_lock(&np->rx_lock);
> 
>        /*
>         * Recovery procedure:
> @@ -1761,7 +1761,7 @@ static int network_connect(struct net_de
>        network_tx_buf_gc(dev);
>        network_alloc_rx_buffers(dev);
> 
> -       spin_unlock(&np->rx_lock);
> +       spin_unlock_bh(&np->rx_lock);
>        spin_unlock_irq(&np->tx_lock);

You can't enable BH with IRQs disabled.  Besides, for the sake of
symmetry these two should be reversed.

 
> @@ -2033,10 +2033,10 @@ static void netif_disconnect_backend(str
> static void netif_disconnect_backend(struct netfront_info *info)
> {
>        /* Stop old i/f to prevent errors whilst we rebuild the state. */
> +       spin_lock_bh(&info->rx_lock);
>        spin_lock_irq(&info->tx_lock);
> -       spin_lock(&info->rx_lock);
>        netfront_carrier_off(info);
> -       spin_unlock(&info->rx_lock);
> +       spin_unlock_bh(&info->rx_lock);
>        spin_unlock_irq(&info->tx_lock);

Ditto.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.