aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/usbnet.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/usb/usbnet.c')
-rw-r--r--drivers/net/usb/usbnet.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 504282af27e5..72514c46b478 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1,20 +1,8 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
1/* 2/*
2 * USB Network driver infrastructure 3 * USB Network driver infrastructure
3 * Copyright (C) 2000-2005 by David Brownell 4 * Copyright (C) 2000-2005 by David Brownell
4 * Copyright (C) 2003-2005 David Hollis <dhollis@davehollis.com> 5 * Copyright (C) 2003-2005 David Hollis <dhollis@davehollis.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
18 */ 6 */
19 7
20/* 8/*
@@ -506,6 +494,7 @@ static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags)
506 494
507 if (netif_running (dev->net) && 495 if (netif_running (dev->net) &&
508 netif_device_present (dev->net) && 496 netif_device_present (dev->net) &&
497 test_bit(EVENT_DEV_OPEN, &dev->flags) &&
509 !test_bit (EVENT_RX_HALT, &dev->flags) && 498 !test_bit (EVENT_RX_HALT, &dev->flags) &&
510 !test_bit (EVENT_DEV_ASLEEP, &dev->flags)) { 499 !test_bit (EVENT_DEV_ASLEEP, &dev->flags)) {
511 switch (retval = usb_submit_urb (urb, GFP_ATOMIC)) { 500 switch (retval = usb_submit_urb (urb, GFP_ATOMIC)) {
@@ -1431,6 +1420,11 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
1431 spin_unlock_irqrestore(&dev->txq.lock, flags); 1420 spin_unlock_irqrestore(&dev->txq.lock, flags);
1432 goto drop; 1421 goto drop;
1433 } 1422 }
1423 if (netif_queue_stopped(net)) {
1424 usb_autopm_put_interface_async(dev->intf);
1425 spin_unlock_irqrestore(&dev->txq.lock, flags);
1426 goto drop;
1427 }
1434 1428
1435#ifdef CONFIG_PM 1429#ifdef CONFIG_PM
1436 /* if this triggers the device is still a sleep */ 1430 /* if this triggers the device is still a sleep */