[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20141219.154402.54691026682141762.davem@davemloft.net>
Date: Fri, 19 Dec 2014 15:44:02 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: hayeswang@...ltek.com
Cc: netdev@...r.kernel.org, nic_swsd@...ltek.com,
linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Subject: Re: [PATCH net-next 2/2] r8152: check the status before submitting
rx
From: Hayes Wang <hayeswang@...ltek.com>
Date: Fri, 19 Dec 2014 16:56:00 +0800
> Don't submit the rx if the device is unplugged, linking down,
> or stopped.
...
> @@ -1789,6 +1789,11 @@ int r8152_submit_rx(struct r8152 *tp, struct rx_agg *agg, gfp_t mem_flags)
> {
> int ret;
>
> + /* The rx would be stopped, so skip submitting */
> + if (test_bit(RTL8152_UNPLUG, &tp->flags) ||
> + !test_bit(WORK_ENABLE, &tp->flags) || !(tp->speed & LINK_STATUS))
> + return 0;
> +
I think netif_carrier_off() should always be true in all three of those
situations, and would be a much simpler test than what you've coded
here.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists