From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755458AbbG1I5w (ORCPT ); Tue, 28 Jul 2015 04:57:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:52155 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752038AbbG1I5u (ORCPT ); Tue, 28 Jul 2015 04:57:50 -0400 Message-ID: <1438073799.11934.4.camel@suse.com> Subject: Re: [PATCH net 2/2] r8152: reset device when tx timeout From: Oliver Neukum To: Hayes Wang Cc: netdev@vger.kernel.org, nic_swsd@realtek.com, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Date: Tue, 28 Jul 2015 10:56:39 +0200 In-Reply-To: <1394712342-15778-158-Taiwan-albertk@realtek.com> References: <1394712342-15778-156-Taiwan-albertk@realtek.com> <1394712342-15778-158-Taiwan-albertk@realtek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2015-07-28 at 15:36 +0800, Hayes Wang wrote: > The device reset is necessary if the hw becomes abnormal and stops > transmitting packets. You are not the first one to face this problem. Hence there is a helper: * usb_queue_reset_device - Reset a USB device from an atomic context * @iface: USB interface belonging to the device to reset * * This function can be used to reset a USB device from an atomic * context, where usb_reset_device() won't work (as it blocks). Please use it if you can. Your version for example is buggy. It will oops if you unplug the device while a reset is scheduled. Regards Oliver