Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1978791rda; Tue, 24 Oct 2023 08:46:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG488K14YfpN0I40SrcG2lh6s9ZuVivhIGYiaXPh+P6jnaxbEl+XOEsN9SIXhgfWomA3Iam X-Received: by 2002:a05:6a00:35cd:b0:6b1:5d1a:bd0c with SMTP id dc13-20020a056a0035cd00b006b15d1abd0cmr21446507pfb.16.1698162362961; Tue, 24 Oct 2023 08:46:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698162362; cv=none; d=google.com; s=arc-20160816; b=Lzqc1ALerMPDP2WuJskggWyqR3PsC2a8KvL0yAT2y2BGpT7DshHt7WN4qjLvkkX+eM YsdKHYU/X5FiG0/5iNxjEe9bUo1S7vuaT42dzhJm5k++b+fcNSUaFC/IN0c4nQFFaGZm Uzx2495p/lF/BajZYdHizjqsAbW/JHIIWMz/iphEEkajI91gBtYW68VYGPm8mwJWErZ0 KdVvDQ50dFdUNZtVsYO00/RARdPJIgqIezymmMwW1VKuXfbcGzCam/dZIXA8P+w/Ts2A 6SRBXsJv1PZP7glCmdrtzyp2B58eB+QgAZikkjnpV5NVlmkuZ7tsnX55CUmeBwuIkKsI WBtQ== 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:dkim-signature; bh=erfMZa6ib2+SNdfbRAf2UspGg4EtKoLBzahsSjqpUJg=; fh=vKiCxiLdrAbrgKNAGM5vEdqbxtXvr2eAEBvG7fBtjBc=; b=X3/wSDoO5v2o7tJJGV8hmATinCGDPG29xWadJjCO8EBYxCLpnLd0tHFbO7NQNRdS1K PiabrHx6s15wfuu2QUYS3LnS0Hc4DVb4wyE009FfBRPZJYNu3g1Eu623EXyn+EqfNLcN EknepqtO3Dtrf04lLrwGs4hmqpJft7BxQwdnelRFi4wEbfXNTRMG03XyKGluK+hHmE8r fx+8FLVslOmyJiIAz3r8nCITzUp6ZIajzDsSCbx1DN8s5YqzSXzwn4pznwrAzrvcekf/ DFdOFJrEPWXewY+qAn/zqUrMeIrmk1Iwlr4y3zgqJPOHKMOtZKerBasHbwa0btQs424p h9LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zc+9Xqnz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id r201-20020a632bd2000000b00577bf1de778si8818077pgr.585.2023.10.24.08.46.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 08:46:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zc+9Xqnz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 2484380BA688; Tue, 24 Oct 2023 08:46:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234724AbjJXPpt (ORCPT + 99 others); Tue, 24 Oct 2023 11:45:49 -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> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 24 Oct 2023 08:46:00 -0700 (PDT) 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