Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4133315pxb; Mon, 8 Feb 2021 08:41:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwhftyJImwzbVWBGqXdzzQz6EXIvnrQa2yYXUf/+DbC2tMhqhR63cAYOYsOZQtn5aRQ1+IE X-Received: by 2002:a17:906:f6c4:: with SMTP id jo4mr17685524ejb.67.1612802512094; Mon, 08 Feb 2021 08:41:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612802512; cv=none; d=google.com; s=arc-20160816; b=asPP70qTmWg5lU+At/OxMd50W+v8ayDCkXCEUs7nHKPdftcXieE68sH+KCrLkQ86jY u3W/hwW9eBbTnvXUPHRCEtUPIs3clzabEgU68UqirxzwpeH056jQaSQbHP8D0ZPSbzU3 nEGyZsTsXj8bVHeV3Z40VN52MybjITBVN8vEfyspGEI94RKSUYfbvzg+/YJ9v7TRd/HI NymxF7cGslXUkbXgAm6kip5rwkeZ2w6P9TofMCPFiK8yErvUcy8l6lQvn/+Jbao8COb+ 86zHwzT7s1af6ovUrY1oFJENUaGAfrlRS+f92nkJqu741lx6rn9XgXg0Jx9QJZaXJY1G SkWg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uqG3WX4pNHrXmCi2gPNMoz8lhB+DlOo72VDKOtzvqiU=; b=mgEUpNBSwOzalmDGt0XpGoFvE3oDRxIg4SyhXXb9VsCdz6TR8hamNtRW800+f3GocQ L5izF/DcqIjWf5PR6e+iI6y54NO48ZLdv6RrYhArfIu97ozEMK2ijQs1l7aJ+y3RhagK dcZ+L9JKIrD05ED8F1yKyeds6QpVo4T4v6IdvF2f41FRdnJNfaxD224hNZpsqpUCpT9N wD+CZ+ATTWLkke7jc8DoQA3kF+qD7d/qJzDw5swjmbRqGDbT8v8QW6mOnnYyi5HkVCh8 V9shqu8tNMbIk77tqQfJI26hHG1/eAtvSxWn+WmnGdVra4jQBQMbY7530thME379t9SU RWOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TwOezqdj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr11si3674626ejc.518.2021.02.08.08.41.28; Mon, 08 Feb 2021 08:41:52 -0800 (PST) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TwOezqdj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233948AbhBHQkb (ORCPT + 99 others); Mon, 8 Feb 2021 11:40:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:60178 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231782AbhBHPPP (ORCPT ); Mon, 8 Feb 2021 10:15:15 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E151B64ECC; Mon, 8 Feb 2021 15:11:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612797062; bh=+eNF35DoJrXJpVdyv1WkaPTZ4N2uXYixGb+GnufcBMA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TwOezqdjhssBNv9Pf4e7lc59fpateJWjhv9hzG5UV91wwwV6H76PU8S8oFXq4V1JL YUO260t0QoDD/juEXyF1rTJfK1Etd4xdDU3ymJtJEfplBBaASIWZgVZ7RUSg6ObzQ0 VfXMTRXDq5RnzMhopL0tyFJ1K6yT9li4Bxis7gXQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thorsten Leemhuis , Christoph Hellwig Subject: [PATCH 5.4 44/65] nvme-pci: avoid the deepest sleep state on Kingston A2000 SSDs Date: Mon, 8 Feb 2021 16:01:16 +0100 Message-Id: <20210208145811.922714357@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210208145810.230485165@linuxfoundation.org> References: <20210208145810.230485165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thorsten Leemhuis commit 538e4a8c571efdf131834431e0c14808bcfb1004 upstream. Some Kingston A2000 NVMe SSDs sooner or later get confused and stop working when they use the deepest APST sleep while running Linux. The system then crashes and one has to cold boot it to get the SSD working again. Kingston seems to known about this since at least mid-September 2020: https://bbs.archlinux.org/viewtopic.php?pid=1926994#p1926994 Someone working for a German company representing Kingston to the German press confirmed to me Kingston engineering is aware of the issue and investigating; the person stated that to their current knowledge only the deepest APST sleep state causes trouble. Therefore, make Linux avoid it for now by applying the NVME_QUIRK_NO_DEEPEST_PS to this SSD. I have two such SSDs, but it seems the problem doesn't occur with them. I hence couldn't verify if this patch really fixes the problem, but all the data in front of me suggests it should. This patch can easily be reverted or improved upon if a better solution surfaces. FWIW, there are many reports about the issue scattered around the web; most of the users disabled APST completely to make things work, some just made Linux avoid the deepest sleep state: https://bugzilla.kernel.org/show_bug.cgi?id=195039#c65 https://bugzilla.kernel.org/show_bug.cgi?id=195039#c73 https://bugzilla.kernel.org/show_bug.cgi?id=195039#c74 https://bugzilla.kernel.org/show_bug.cgi?id=195039#c78 https://bugzilla.kernel.org/show_bug.cgi?id=195039#c79 https://bugzilla.kernel.org/show_bug.cgi?id=195039#c80 https://askubuntu.com/questions/1222049/nvmekingston-a2000-sometimes-stops-giving-response-in-ubuntu-18-04dell-inspir https://community.acer.com/en/discussion/604326/m-2-nvme-ssd-aspire-517-51g-issue-compatibility-kingston-a2000-linux-ubuntu For the record, some data from 'nvme id-ctrl /dev/nvme0' NVME Identify Controller: vid : 0x2646 ssvid : 0x2646 mn : KINGSTON SA2000M81000G fr : S5Z42105 [...] ps 0 : mp:9.00W operational enlat:0 exlat:0 rrt:0 rrl:0 rwt:0 rwl:0 idle_power:- active_power:- ps 1 : mp:4.60W operational enlat:0 exlat:0 rrt:1 rrl:1 rwt:1 rwl:1 idle_power:- active_power:- ps 2 : mp:3.80W operational enlat:0 exlat:0 rrt:2 rrl:2 rwt:2 rwl:2 idle_power:- active_power:- ps 3 : mp:0.0450W non-operational enlat:2000 exlat:2000 rrt:3 rrl:3 rwt:3 rwl:3 idle_power:- active_power:- ps 4 : mp:0.0040W non-operational enlat:15000 exlat:15000 rrt:4 rrl:4 rwt:4 rwl:4 idle_power:- active_power:- Cc: stable@vger.kernel.org # 4.14+ Signed-off-by: Thorsten Leemhuis Signed-off-by: Christoph Hellwig Signed-off-by: Greg Kroah-Hartman --- drivers/nvme/host/pci.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -3161,6 +3161,8 @@ static const struct pci_device_id nvme_i { PCI_DEVICE(0x1c5c, 0x1504), /* SK Hynix PC400 */ .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) }, + { PCI_DEVICE(0x2646, 0x2263), /* KINGSTON A2000 NVMe SSD */ + .driver_data = NVME_QUIRK_NO_DEEPEST_PS, }, { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001), .driver_data = NVME_QUIRK_SINGLE_VECTOR }, { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },