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

From: Hayes Wang
Date: Wed Jul 29 2015 - 07:09:47 EST


Oliver Neukum [mailto:oneukum@xxxxxxxx]
> Sent: Wednesday, July 29, 2015 3:22 PM
[...]
> Now, I think I got the reason for the confusion.
>
> You are using cancel_delayed_work(&tp->schedule); after you queue a reset.
> Therefore the order in which the work and the reset will be executed is undefined.
> Usually the scheduled work will be canceled, but not always.

Actually, the order is not important for me. There are some protections to avoid
the work and the reset run at the same time. Besides, the reset could be run before
or after the work. I cancel the work because I want to let the reset start as early as
possible. If the work runs before the reset, the reset wouldn't start until the work is
finished.

> That is not good.

I think I had better to remove cancel_delay_work(), because it makes confusion.
And, it doesn't seem to be necessary. Thanks.

Best Regards,
Hayes