RE: [PATCH net v2 2/2] r8152: reset device when tx timeout

Hayes Wang
2015-07-29T02:06:51Z

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1212 bytes --]

Oliver Neukum [mailto:oneukum@suse.com]
> Sent: Tuesday, July 28, 2015 8:59 PM
[...]
> > > > static void rtl8152_tx_timeout(struct net_device *netdev) {
> > > > struct r8152 *tp = netdev_priv(netdev);
> > > > - int i;
> > > >
> > > > netif_warn(tp, tx_err, netdev, "Tx timeout\n");
> > > > - for (i = 0; i < RTL8152_MAX_TX; i++)
> > > > - usb_unlink_urb(tp->tx_info[i].urb);
> > > > +
> > > > + usb_queue_reset_device(tp->intf);
> > > > + cancel_delayed_work(&tp->schedule);
> > >
> > > Sorry to bother you again, but this looks wrong.
> > > You want to cancel first. There is no point in running any work
> > > before the reset is done. It will undo any progress anyway.
> >
> > Excuse me. Do you mean I don't need cancel the other work because it
> > wouldn't be run before the reset is finished?
>
> No, whatever the other work will do, the reset will undo.

Excuse me. I don't understand why I couldn't use usb_queue_reset_device() directly.
Why the reset will undo?

Best Regards,
Hayes

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éÝ¶\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dÊ‡Ú™ë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥