hv_netvsc: avoid unnecessary wakeups on subchannel creation
authorStephen Hemminger <stephen@networkplumber.org>
Wed, 6 Sep 2017 20:53:06 +0000 (13:53 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 11 Sep 2017 21:21:30 +0000 (14:21 -0700)
Only need to wakeup the initiator after all sub-channels
are opened.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/rndis_filter.c

index 731bc7cc6f43de63523b2271ad751b67cc3c6786..065b204d8e17f6bde17be931ff8d1758f529e6cc 100644 (file)
@@ -1048,8 +1048,8 @@ static void netvsc_sc_open(struct vmbus_channel *new_sc)
        else
                netdev_notice(ndev, "sub channel open failed: %d\n", ret);
 
-       atomic_inc(&nvscdev->open_chn);
-       wake_up(&nvscdev->subchan_open);
+       if (atomic_inc_return(&nvscdev->open_chn) == nvscdev->num_chn)
+               wake_up(&nvscdev->subchan_open);
 }
 
 /* Open sub-channels after completing the handling of the device probe.