From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4737BC00A8F for ; Tue, 24 Oct 2023 15:45:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234764AbjJXPpu (ORCPT ); Tue, 24 Oct 2023 11:45:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234660AbjJXPpr (ORCPT ); Tue, 24 Oct 2023 11:45:47 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1543A10A for ; Tue, 24 Oct 2023 08:45:44 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4621DC433C8; Tue, 24 Oct 2023 15:45:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1698162343; bh=OwCxtPQ+z0MdwHi7seYQAGchK7270NewGnlvtxqCa/4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=zc+9XqnzcMLfCLcSEemS5g8T472F71zf4Qy6HVN+g0LSZ2K6JyhsxEoJLOJxltTfS jh2+EY78icHApVMgoVpSCvDKB+Mf6ijjEtWn5GYBsp/bU5aMvc1NqGAGzoQM5AMC54 KS9rxeRJ/f+n/NjXsK6Qj8an2W2A0eXewS9ZV4gQ= Date: Tue, 24 Oct 2023 17:45:40 +0200 From: "gregkh@linuxfoundation.org" To: Alan Stern Cc: "Li, Meng" , "linux-usb@vger.kernel.org" , "usb-storage@lists.one-eyed-alien.net" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] usb: storage: add shutdown function for usb storage driver Message-ID: <2023102428-zit-quickness-9b73@gregkh> References: <20231023054111.2744872-1-Meng.Li@windriver.com> <33bd0779-bfe7-4c87-8fe6-ea8455df3b6b@rowland.harvard.edu> <3fe5b43c-a5aa-4c6a-8614-03a4d9dd53e2@rowland.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3fe5b43c-a5aa-4c6a-8614-03a4d9dd53e2@rowland.harvard.edu> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 24, 2023 at 11:35:19AM -0400, Alan Stern wrote: > On Tue, Oct 24, 2023 at 03:43:56AM +0000, Li, Meng wrote: > > > > > > > -----Original Message----- > > > From: Alan Stern > > > > On Mon, Oct 23, 2023 at 01:41:11PM +0800, Meng Li wrote: > > > > On ls1043/ls1046 rdb platform, if a PCIe-USB host controller is > > > > installed, and an USB disk is also installed on the PCIe card, when > > > > executing "reboot -f" to reset the board, there will be below error reported: > > > > usb 2-2: device not accepting address 2, error -108 > > > > > This issue is introduced by linux-yocto commit 837547b64a34("driver: net: > > > > dpaa: release resource when executing kexec") that cause to spend more > > > > time on shutdown operation. So, the 2 platforms with DPAA are not > > > > reset immediately after executing force reboot command. Moreover, the > > > > usb-storage thread is still in active status, there is still control > > > > data transferred between USB disk and PCIe host controller. But now > > > > the shutdown callback of usb pci driver had been invoked to stop the > > > > PCIe host controller completely. In this situation, the data transferring failed > > > and report error. > > > > > > That's _supposed_ to happen. By design, the "reboot -f" command is meant > > > to carry out an immediate reboot, without using the init system, unmounting > > > filesystems, or doing other cleanup operations. > > > > > > > As my above said, I understand what you mean. I also thought over what you said. > > I am not sure, but I still sent patch to upstream community, and want to get some suggest from more authoritative maintainer. > > > > > If you want a clean reboot with no errors, don't use the "-f" option. > > > > > > > There is also error report even if I use command "reboot" > > Okay, that's a different matter. In fact, I don't know what is supposed > to happen during a clean reboot. Define "clean" :) reboot is a system thing that happens before the reboot syscall happens. So which are we talking nabout here? > Greg, do you know? Should we take the time to disconnect all the USB > devices during a system shutdown? In the past we have not. And if we switch to do so, we might get some complaints as we would now delaying the shutdown process to be longer than before. > What happens with non-USB disk drives? Or other removable devices? It would have to come from "above" in the device tree, so does the PCI or platform bus say that they should be shut down and their child devices? thanks, greg k-h