Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp831390pxv; Thu, 24 Jun 2021 22:31:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXc25+YTNC9z2IN7JvJhl3b9XaYVT8P08quFOxRAjw0BCRuODKBAfKnla6hknq1BS4taNS X-Received: by 2002:a5e:9602:: with SMTP id a2mr7353402ioq.146.1624599075184; Thu, 24 Jun 2021 22:31:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624599075; cv=none; d=google.com; s=arc-20160816; b=aMwMw5/86AYUpQmMheHKwa89zuqJ5f79B1DwcMbZxQfdOggPyltaCzTcsboWkX/QdP 76H/0pnpLxUDUZza7sXMoSSBiXc7uwGv6/WhOK8NPTnRAO7c1dnvar6fpSDha0jxqQyC zKH7x35Vn4UAMejXZ4WO7zhYDiTg8mwE44QOmAvwdT/dClDZAEb/lnfxyHp8ed+OQvPZ 4r36GEj57aoT/GpllgltAlykKqVawX51+PsGe5dAJ2/loH3/uwJ7HZsVk0u9nI119PaL 1QrTOOJLdcHO96gzQAkvafrl7kH7vNxYAE+0Sfa1UDWZz3SuEkai4iOh6aI/bEi6b1Zx yhGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=8GCe/rqwMuSQEtx5u6dA0aqoXDn5NnRZFHFFnhK8WUc=; b=Ba1TWi9N12jQB3xDNxd86bJMuvRyY3dJZKnIKdvJKe3IoHz0zyYta9oZZsSRxGiehJ VM3OelqPZxjTYFNpDhxdBDG/WYOfbaQlVFpehuH3wrk5Y59FTixVBJw0zOXzcg2wGDCF nAX0+E5r5E9YEeoMApkdV765Bk5r8MTUr5g/OOWbeceJ1rv7LaR9J0bh9UCZ/rTKy+4h hNoiTDDV4kLasRG49FjSnN/k3XidpSEUc7TY/5XAtTgd670aCVM4qlwxu1/ylJYZndGm RTy5npynzuLkja5UrZT8vT+WS37yd8hrYeROkJpirW0+R0EM+JAWhuMUgS+CelQ4xFLd F1hg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m11si6575240jaj.107.2021.06.24.22.31.03; Thu, 24 Jun 2021 22:31:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231406AbhFYFcW (ORCPT + 99 others); Fri, 25 Jun 2021 01:32:22 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:60300 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233136AbhFYFcV (ORCPT ); Fri, 25 Jun 2021 01:32:21 -0400 Received: from 1-171-95-206.dynamic-ip.hinet.net ([1.171.95.206] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lwePW-0003qp-A4; Fri, 25 Jun 2021 05:29:50 +0000 From: Kai-Heng Feng To: kbusch@kernel.org, axboe@fb.com, hch@lst.de, sagi@grimberg.me Cc: Kai-Heng Feng , Koba Ko , linux-nvme@lists.infradead.org (open list:NVM EXPRESS DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] Revert "nvme-pci: use simple suspend when a HMB is enabled" Date: Fri, 25 Jun 2021 13:29:44 +0800 Message-Id: <20210625052944.4140054-1-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit b97120b15ebd3de51325084136d3b9c3cce656d6. There are at least two issues introduced by that commit. Config space becomes inaccessible after s2idle: [ 827.776792] nvme 0000:58:00.0: can't change power state from D3cold to D0 (config space inaccessible) The NVMe in question is recovered correctly but PCIe ASPM setting is lost as result. The second one is more severe, the NVMe becomes unreliable and cause the rootfs unreadable after s2idle. Since reset DMA is not possible on suspend/resume, revert the commit to solve the regression. Cc: Koba Ko BugLink: https://bugs.launchpad.net/bugs/1912057 BugLink: https://bugs.launchpad.net/bugs/1927866 Fixes: b97120b15ebd ("nvme-pci: use simple suspend when a HMB is enabled") Signed-off-by: Kai-Heng Feng --- drivers/nvme/host/pci.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index a29b170701fc6..72d2121f82068 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -3079,15 +3079,9 @@ static int nvme_suspend(struct device *dev) * the PCI bus layer to put it into D3 in order to take the PCIe link * down, so as to allow the platform to achieve its minimum low-power * state (which may not be possible if the link is up). - * - * If a host memory buffer is enabled, shut down the device as the NVMe - * specification allows the device to access the host memory buffer in - * host DRAM from all power states, but hosts will fail access to DRAM - * during S3. */ if (pm_suspend_via_firmware() || !ctrl->npss || !pcie_aspm_enabled(pdev) || - ndev->nr_host_mem_descs || (ndev->ctrl.quirks & NVME_QUIRK_SIMPLE_SUSPEND)) return nvme_disable_prepare_reset(ndev, true); -- 2.31.1