staging: hv: fix a kernel warning in netvsc_linkstatus_callback()
authorHaiyang Zhang <haiyangz@microsoft.com>
Thu, 1 Sep 2011 19:19:42 +0000 (12:19 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Sep 2011 18:56:18 +0000 (11:56 -0700)
netif_notify_peers() caused a kernel warning in netvsc_linkstatus_callback(),
because netvsc_linkstatus_callback() is within IRQ context. So we move
the first call to netif_notify_peers() into queued work as well, but with
zero delay.

In addition to "staging-next", this should also be back-ported to stable
kernels 2.6.32 and later.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/hv/netvsc_drv.c

index 30a0cb2c0fea5e15811b930fdb20fe76d2a181e3..e6513be00c4d010d8d5623531f27c03d32cdda1d 100644 (file)
@@ -214,8 +214,8 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj,
        if (status == 1) {
                netif_carrier_on(net);
                netif_wake_queue(net);
-               netif_notify_peers(net);
                ndev_ctx = netdev_priv(net);
+               schedule_delayed_work(&ndev_ctx->dwork, 0);
                schedule_delayed_work(&ndev_ctx->dwork, msecs_to_jiffies(20));
        } else {
                netif_carrier_off(net);