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 BD0B6C38142 for ; Thu, 19 Jan 2023 07:55:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229576AbjASHzK (ORCPT ); Thu, 19 Jan 2023 02:55:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229973AbjASHyl (ORCPT ); Thu, 19 Jan 2023 02:54:41 -0500 X-Greylist: delayed 351 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 18 Jan 2023 23:54:33 PST Received: from soltyk.jannau.net (soltyk.jannau.net [144.76.91.90]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E79F10F for ; Wed, 18 Jan 2023 23:54:32 -0800 (PST) Received: by soltyk.jannau.net (Postfix, from userid 1000) id 2656026F67C; Thu, 19 Jan 2023 08:48:36 +0100 (CET) Date: Thu, 19 Jan 2023 08:48:36 +0100 From: Janne Grunau To: Christoph Hellwig Cc: Hector Martin , Sven Peter , Keith Busch , Jens Axboe , Sagi Grimberg , Alyssa Rosenzweig , Eric Curtin , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] nvme-apple: Reset controller during shutdown Message-ID: <20230119074836.GC3576@jannau.net> References: <20230114-apple-nvme-suspend-fixes-v6.2-v2-0-9157bf633dba@jannau.net> <20230114-apple-nvme-suspend-fixes-v6.2-v2-1-9157bf633dba@jannau.net> <20230118052450.GA24742@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230118052450.GA24742@lst.de> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hej, On 2023-01-18 06:24:50 +0100, Christoph Hellwig wrote: > On Tue, Jan 17, 2023 at 07:25:00PM +0100, Janne Grunau wrote: > > + /* > > + * Always reset the NVMe controller on shutdown. The reset is > > + * required to shutdown the co-processor cleanly. > > + */ > > Hmm. This comment doesn't seem to match the discussion we had last > week. Which would be: > > /* > * NVMe requires a reset before setting up a controller to > * ensure it is in a clean state. For NVMe PCIe this is > * done in the setup path to be able to deal with controllers > * in any kind of state. For for Apple devices, the firmware > * will not be available at that time and the reset will > * time out. Thus reset after shutting the NVMe controller > * down and before shutting the firmware down. > */ yes, it differs from the discussion last week. I tried to issue the reset later in the setup path after the firmware was brought back up. That fixes the hang but the device is still not useable. So it appears we need to reset the controller before the firmware is shutdown. Janne