r8152: don't execute runtime suspend if the tx is not empty
authorhayeswang <hayeswang@realtek.com>
Mon, 23 Jan 2017 06:18:43 +0000 (14:18 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 Feb 2017 08:45:09 +0000 (09:45 +0100)
[ Upstream commit 6a0b76c04ec157c88ca943debf78a8ee58469f2d ]

Runtime suspend shouldn't be executed if the tx queue is not empty,
because the device is not idle.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/usb/r8152.c

index ed512a41c5c9555e44efc7ce605134de2e5b5b18..fbb1867ff25c9e27ce9f27c40f7513f9c02aa8c5 100644 (file)
@@ -3442,6 +3442,8 @@ static bool delay_autosuspend(struct r8152 *tp)
         */
        if (!sw_linking && tp->rtl_ops.in_nway(tp))
                return true;
+       else if (!skb_queue_empty(&tp->tx_queue))
+               return true;
        else
                return false;
 }