Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1972626rda; Tue, 24 Oct 2023 08:35:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGpTV6ldeTEEkPMhGkaSASAMW+3iDgldq5tHtRSw/Xdb9hoOS0IUAfNcyq4jiMe5mR1YD+3 X-Received: by 2002:a17:90a:d40d:b0:27d:420:7b34 with SMTP id r13-20020a17090ad40d00b0027d04207b34mr13623449pju.37.1698161756255; Tue, 24 Oct 2023 08:35:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698161756; cv=none; d=google.com; s=arc-20160816; b=TfeGntegAbsS46y+YWKwXuP1QbsvyUnEl56QO/VeFDeAN8cQnmA3+y8sDdhq/PkISH 4RactIOmHzC4/xirRPxvRPX7enC7qxtrfYctLAM8ybYeaXvlB3kFcaneq0xtVUUYHNp1 Yoksz+hsErl47768Wk8yXB9kRYu5bTYSe55vjsE0hv3ANoa4mTlRYdqOI2eYugKiSjHt DMFJ6Nar+De+BDPYZzwl4uZM9CcmxqDfE7ydvcOr98SkrhF1G3vODESeQCp9qg955IFu CteJp109DXCRDCq0T+XoG4t+jp9X9U6/VIQ2TUeOjsIhGneCAFtlAtWqto3ja5J7SM+7 dY8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=iPcveMgdBz/HyuFkTozrSwD9LxyuSgzbvSeNZxLh+8s=; fh=HTcH9FwWfokSIxcREMnaC56gnwz2mltpvLaBMofE/C4=; b=bnyjPJ0qdhqiZzVSNniw19fMOxd2uFchTROXqzIUg9IYFC8XVt5LQ/Tj9am8hp2AKA PguVrMisjynMKv1nPd5r7eZ6ccmIBUukqdCqhsSMpufdtGde7u/ZxRqCNZ+ujKZ0P/zb pNHhB3bfutY3ha1UYtPW5gNzDHr40e0gtFdYNj6cbp6/DsQs3TAIcuCfrMrbNLhdpDGK bYUDXbKLWy1S0R3gPqeaqaG0vtMD1NRikmz2w9CQkIsgZ10WpFb6Bm5MSjFYFJJQaXqz gMiDyX/T9WVFRRvPMKCtZ5Bl6r3Hm5TggfS4AB9dmGjdjxLbn1+965f1D+5HFJXouAj7 Nl9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id 22-20020a17090a019600b00278ee2b717fsi8586239pjc.85.2023.10.24.08.35.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 08:35:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 37108807D408; Tue, 24 Oct 2023 08:35:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343786AbjJXPfj (ORCPT + 99 others); Tue, 24 Oct 2023 11:35:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343829AbjJXPfY (ORCPT ); Tue, 24 Oct 2023 11:35:24 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 0C3DB171A for ; Tue, 24 Oct 2023 08:35:19 -0700 (PDT) Received: (qmail 461087 invoked by uid 1000); 24 Oct 2023 11:35:19 -0400 Date: Tue, 24 Oct 2023 11:35:19 -0400 From: Alan Stern To: "Li, Meng" Cc: "gregkh@linuxfoundation.org" , "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: <3fe5b43c-a5aa-4c6a-8614-03a4d9dd53e2@rowland.harvard.edu> References: <20231023054111.2744872-1-Meng.Li@windriver.com> <33bd0779-bfe7-4c87-8fe6-ea8455df3b6b@rowland.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 24 Oct 2023 08:35:52 -0700 (PDT) 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. Greg, do you know? Should we take the time to disconnect all the USB devices during a system shutdown? What happens with non-USB disk drives? Or other removable devices? Alan Stern