From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934148AbdKGOet (ORCPT ); Tue, 7 Nov 2017 09:34:49 -0500 Received: from mga06.intel.com ([134.134.136.31]:29607 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751458AbdKGOer (ORCPT ); Tue, 7 Nov 2017 09:34:47 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,359,1505804400"; d="scan'208";a="918519316" Subject: Re: [PATCH v3] usb:xhci fix panic in xhci_free_virt_devices_depth_first To: Yu Chen , mathias.nyman@intel.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: fanning4@hisilicon.com, lirui39@hisilicon.com, yangdi10@hisilicon.com, wangbinghui@hisilicon.com, groeck@google.com, john.stultz@linaro.org References: <20171107020138.89251-1-chenyu56@huawei.com> From: Mathias Nyman Message-ID: Date: Tue, 7 Nov 2017 16:36:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171107020138.89251-1-chenyu56@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07.11.2017 04:01, Yu Chen wrote: > From: Yu Chen > > Check vdev->real_port 0 to avoid panic > [ 9.261347] [] xhci_free_virt_devices_depth_first+0x58/0x108 > [ 9.261352] [] xhci_mem_cleanup+0x1bc/0x570 > [ 9.261355] [] xhci_stop+0x140/0x1c8 > [ 9.261365] [] usb_remove_hcd+0xfc/0x1d0 > [ 9.261369] [] xhci_plat_remove+0x6c/0xa8 > [ 9.261377] [] platform_drv_remove+0x2c/0x70 > [ 9.261384] [] __device_release_driver+0x80/0x108 > [ 9.261387] [] device_release_driver+0x2c/0x40 > [ 9.261392] [] bus_remove_device+0xe0/0x120 > [ 9.261396] [] device_del+0x114/0x210 > [ 9.261399] [] platform_device_del+0x30/0xa0 > [ 9.261403] [] dwc3_otg_work+0x204/0x488 > [ 9.261407] [] event_work+0x304/0x5b8 > [ 9.261414] [] process_one_work+0x148/0x490 > [ 9.261417] [] worker_thread+0x50/0x4a0 > [ 9.261421] [] kthread+0xe8/0x100 > [ 9.261427] [] ret_from_fork+0x10/0x50 > > The problem can occur if xhci_plat_remove() is called shortly after > xhci_plat_probe(). While xhci_free_virt_devices_depth_first been > called before the device has been setup and get real_port initialized. > The problem occurred on Hikey960 and was reproduced by Guenter Roeck > on Kevin with chromeos-4.4. > > Cc: Guenter Roeck > Signed-off-by: Fan Ning > Signed-off-by: Li Rui > Signed-off-by: yangdi > Signed-off-by: Yu Chen > Thanks, adding to queue, and adding stable 4.10+ tag as well -Mathias