# Re: \[PATCH 4/7\] usbnet: remove EVENT\_DEV\_OPEN flag

- From: Ming Lei \<hidden\>
- Date: 2012-06-13 09:21:40 
- List: netdev
- Page: https://ratatoskr.run/netdev/2012/06/10897092
- Thread: https://ratatoskr.run/netdev/2012/06/10897092/t.md

```text
On Wed, Jun 13, 2012 at 4:28 PM, Bjørn Mork [ref] wrote:
>
> BTW, does the "&& (dev->net->flags & IFF_UP)" really make any
> difference, or could the test be simplified to
>
>    (netif_running(dev->net))

Neither netif_running(dev->net) nor  (dev->net->flags & IFF_UP)
is enough.

In the start of usbnet_open(), the usb device may be waken up and
usbnet_resume will see netif_running(dev->net) in the situation, so
may cause problem since the interface hasn't been UP yet.

If just checking on (dev->net->flags & IFF_UP), it still may cause
problem in usbnet_resume as pointed by Oliver.

So looks only checking on both netif_running(dev->net) and
(dev->net->flags & IFF_UP) is OK.

Thanks,
-- 
Ming Lei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
```
