Received: by 10.223.176.5 with SMTP id f5csp1012955wra; Fri, 2 Feb 2018 09:41:55 -0800 (PST) X-Google-Smtp-Source: AH8x227jj3uvsINb4lj7tP2aoQH3VjZfYibAuSJ6FK6Gszjh56I9NT2IL3iT15u6jm/+9uZkCxr1 X-Received: by 2002:a17:902:50e:: with SMTP id 14-v6mr35372942plf.360.1517593315247; Fri, 02 Feb 2018 09:41:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517593315; cv=none; d=google.com; s=arc-20160816; b=wiCrf8MW4kyPmzUqz3VEe7+F0DmXkcu0qMZgU+T2vYDm2FfCKeN98OaRevd7GF6kj/ S2ihzpmD4otvdET9E6dqwppsMvA8A7L2Ot5ykq72awYd8jV834EXyLHzxHYu4jobgrtD 3FXHxeRgBObzhd5L8bC6kLeiaGis6yuNJrWiFQ0lQhv08JoIuzNXGFbSu5Vapu95oZG8 kQh9YJ47qOnnGOcR+H+3sGBugZN/W8l8lrNbx8rODqkVJVMKOlreSiF11jZUkPSJ1MkO 3XD7O7GEknn+uLiNL+P50oQnD4XezFoccKKLhlrHXQmhQZmFLk7/EJv8iwUZGFarEOZW bVyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=5jhEvJ+c5n1igWezhtLNK9WU52/PMDw5NifM4T3hlE4=; b=GOBcBRG5YZ/+M9tX3jl6n+9axykh3QUoQASQitO/xV+N2ORnx+dPpXlpOoL2ci4I5f shpfDn2ejzKKFMhNPpolRsUJIlirlLtYU6+UsOs4VbUbPo5Ztb57UpQMRiOEE2VoqlMD Em/41NdjNE4WLJbDelmtlk+t0LHVJVIld52qjYimQL+EJj4rRKvx0ko3lSLsmr94NGBP P/dbVJYshWQwVa5uG0Zvm9PUB9tDpFugiiqq+ydDPgCImLxX5bKGRZXumZ13rGUXCkfT j6inO0hX8tyKw1PblTNEzn3YDjQYJBz9Vv2IRtRRMTeOrNUGvVW6iRNeFwccrY0p+GPQ GK9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o18si2108677pfa.407.2018.02.02.09.41.40; Fri, 02 Feb 2018 09:41:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753251AbeBBRPV (ORCPT + 99 others); Fri, 2 Feb 2018 12:15:21 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:37798 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753057AbeBBRJH (ORCPT ); Fri, 2 Feb 2018 12:09:07 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E7E13DEE; Fri, 2 Feb 2018 17:09:06 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kai-Heng Feng , Christoph Hellwig , Sasha Levin Subject: [PATCH 4.14 049/156] nvme-pci: disable APST on Samsung SSD 960 EVO + ASUS PRIME B350M-A Date: Fri, 2 Feb 2018 17:57:10 +0100 Message-Id: <20180202140842.503134182@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140840.242829545@linuxfoundation.org> References: <20180202140840.242829545@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kai-Heng Feng [ Upstream commit 8427bbc224863e14d905c87920d4005cb3e88ac3 ] The NVMe device in question drops off the PCIe bus after system suspend. I've tried several approaches to workaround this issue, but none of them works: - NVME_QUIRK_DELAY_BEFORE_CHK_RDY - NVME_QUIRK_NO_DEEPEST_PS - Disable APST before controller shutdown - Delay between controller shutdown and system suspend - Explicitly set power state to 0 before controller shutdown Fortunately it's a desktop, so disable APST won't hurt the battery. Also, change the quirk function name to reflect it's for vendor combination quirks. BugLink: https://bugs.launchpad.net/bugs/1705748 Signed-off-by: Kai-Heng Feng Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/nvme/host/pci.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2282,7 +2282,7 @@ static int nvme_dev_map(struct nvme_dev return -ENODEV; } -static unsigned long check_dell_samsung_bug(struct pci_dev *pdev) +static unsigned long check_vendor_combination_bug(struct pci_dev *pdev) { if (pdev->vendor == 0x144d && pdev->device == 0xa802) { /* @@ -2297,6 +2297,14 @@ static unsigned long check_dell_samsung_ (dmi_match(DMI_PRODUCT_NAME, "XPS 15 9550") || dmi_match(DMI_PRODUCT_NAME, "Precision 5510"))) return NVME_QUIRK_NO_DEEPEST_PS; + } else if (pdev->vendor == 0x144d && pdev->device == 0xa804) { + /* + * Samsung SSD 960 EVO drops off the PCIe bus after system + * suspend on a Ryzen board, ASUS PRIME B350M-A. + */ + if (dmi_match(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC.") && + dmi_match(DMI_BOARD_NAME, "PRIME B350M-A")) + return NVME_QUIRK_NO_APST; } return 0; @@ -2336,7 +2344,7 @@ static int nvme_probe(struct pci_dev *pd if (result) goto unmap; - quirks |= check_dell_samsung_bug(pdev); + quirks |= check_vendor_combination_bug(pdev); result = nvme_init_ctrl(&dev->ctrl, &pdev->dev, &nvme_pci_ctrl_ops, quirks);