From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752651AbbG2CGv (ORCPT ); Tue, 28 Jul 2015 22:06:51 -0400 Received: from rtits2.realtek.com ([60.250.210.242]:47762 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750945AbbG2CGu (ORCPT ); Tue, 28 Jul 2015 22:06:50 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.54 with qID t6T26fmZ010961, This message is accepted by code: ctloc85258 From: Hayes Wang To: Oliver Neukum CC: "netdev@vger.kernel.org" , nic_swsd , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" Subject: RE: [PATCH net v2 2/2] r8152: reset device when tx timeout Thread-Topic: [PATCH net v2 2/2] r8152: reset device when tx timeout Thread-Index: AQHQyS4AWs20zW5jRUuoEFJdQdKEO53wRVKAgACJJdD//4NNgIABYUqQ Date: Wed, 29 Jul 2015 02:06:40 +0000 Message-ID: <0835B3720019904CB8F7AA43166CEEB2F3C673@RTITMBSV03.realtek.com.tw> References: <1394712342-15778-156-Taiwan-albertk@realtek.com> <1394712342-15778-159-Taiwan-albertk@realtek.com> <1394712342-15778-161-Taiwan-albertk@realtek.com> <1438085645.1787.4.camel@suse.com> <0835B3720019904CB8F7AA43166CEEB2F3C538@RTITMBSV03.realtek.com.tw> <1438088317.1787.5.camel@suse.com> In-Reply-To: <1438088317.1787.5.camel@suse.com> Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.21.71.143] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id t6T26ugN022112 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Ç+‰·Ÿ®‰­†+%ŠËÿ±éݶ¥Šwÿº{.nÇ+‰·¥Š{±þG«�éÿŠ{ayºʇڙë,j­¢f£¢·hš�ï�êÿ‘êçz_è®(­éšŽŠÝ¢j"�ú¶m§ÿÿ¾«þG«�éÿ¢¸?™¨è­Ú&£ø§~�á¶iO•æ¬z·švØ^¶m§ÿÿà ÿ¶ìÿ¢¸?–I¥