Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1344923ybl; Fri, 16 Aug 2019 13:17:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbbCddOf51+DxquoILmQ7lV3oF+uP5qYof2RYlCWZ5KhxDENW3UOhC/x+tAmFhN43q60rP X-Received: by 2002:a62:2603:: with SMTP id m3mr12910048pfm.163.1565986638061; Fri, 16 Aug 2019 13:17:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565986638; cv=none; d=google.com; s=arc-20160816; b=kuRL1OGqB7+2mkpzeX9kdQIazQO7y6dcZXRPrgthSh/SybleZjTIqFyuLg2Aep2mma YBP644G+F/np9allbeG1Hsf0P49GgvAgafz3Bs+ipRgZF5Y5AF2FbRvaABq64Vp31sUc KyycTsmIrSUbCkAu0HGErw845DAIUig0zURgeJwkLjTwETNuMGlM71GkZOCS7qap3/OC VBR6GSujv02IWEA6nLpM50LTdoCPrQ71qajvjuU00Qb4ftYnkAB+Bt8XQCFD56dteYv7 XSaAvOaEJs8sq8IFw2hD9voB9clLuebVJETptfhGi3YclHms1G0HjL8GYkI/fdVMMpcC mWSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=byIyIAcsx9RfQFbu3qFPuEicP5xSR00LoS2Y9uj8ii0=; b=nwDYLurGkaBkOs4wceM/5rPDxfB7WUVUavHmmLFU9oh7Z8/t2NUcpIpCaCokBjMc6s 3di6bXGMYe/YtY9EAJNPIrJAo0+7CYLsvfAsS65Hho/afLMTJVnAPj9Lw29SIa7OII4d TBd+Jh9QWcuKrEHtDmFDI+EE04EhO4u8B67TEYBKhfVcUe4rAgJr/3XtN0yMh4DgmxGl G767IQcspvSQc/0JihNnZVeRYY9lSRqHoZTpV2EXolSHx/gfnoRjlV0aSA6CVPi0DBUT MKddbiqWnnfqEUxEb0TSFTy3ZkI6SbC8Hp/3VVoWu8hnI8LvQuZYP0ctKOksPZ+uRd2d xL+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dell.com header.s=smtpout1 header.b=pC81BiAK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=dell.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j12si4955149pfe.188.2019.08.16.13.17.02; Fri, 16 Aug 2019 13:17:18 -0700 (PDT) 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; dkim=pass header.i=@dell.com header.s=smtpout1 header.b=pC81BiAK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=dell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727612AbfHPUQ0 (ORCPT + 99 others); Fri, 16 Aug 2019 16:16:26 -0400 Received: from mx0b-00154904.pphosted.com ([148.163.137.20]:40622 "EHLO mx0b-00154904.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727589AbfHPUQ0 (ORCPT ); Fri, 16 Aug 2019 16:16:26 -0400 Received: from pps.filterd (m0170396.ppops.net [127.0.0.1]) by mx0b-00154904.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7GKFBiX010128 for ; Fri, 16 Aug 2019 16:16:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dell.com; h=from : to : cc : subject : date : message-id; s=smtpout1; bh=byIyIAcsx9RfQFbu3qFPuEicP5xSR00LoS2Y9uj8ii0=; b=pC81BiAK5oniR6YMJj0GIYZ3K3PP/V3c1+qFgNfpedzAnQGAeFY4zmdI/8iAhJhFAk4Y YpvaCSQxFNJ+oq1p15KqiP2lrO5mEXmiARTs8JkFF1gdvzHJmBhlvXpkMDC8XKNuZpR0 UKnI/z5VBsIGL6wQwZNcW8TwMLr4cg7ITmXHrmf9EnUG6PGyNPjlQ6ZOqMcR47kExMES raqV+caYfSXoF4QGKByvFHiSlEyc+J6ujPT86lbBeGZSrdw4Mam5H7LxmTbzbA1RS504 x+dOKpIqgcYZ5KBwxtDpe22DSSiUrAAs7SVJ9PDHFwPQyB8VKlth26UEr6BVWHcVrRFG jA== Received: from mx0b-00154901.pphosted.com (mx0a-00154901.pphosted.com [67.231.149.39]) by mx0b-00154904.pphosted.com with ESMTP id 2udkjbkrht-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 16 Aug 2019 16:16:24 -0400 Received: from pps.filterd (m0090350.ppops.net [127.0.0.1]) by mx0b-00154901.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7GKDDqp145338 for ; Fri, 16 Aug 2019 16:16:23 -0400 Received: from ausxippc110.us.dell.com (AUSXIPPC110.us.dell.com [143.166.85.200]) by mx0b-00154901.pphosted.com with ESMTP id 2ue08ajkjw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 16 Aug 2019 16:16:23 -0400 X-LoopCount0: from 10.173.37.27 X-PREM-Routing: D-Outbound X-IronPort-AV: E=Sophos;i="5.60,349,1549951200"; d="scan'208";a="844705379" From: Mario Limonciello To: Keith Busch Cc: Jens Axboe , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org, LKML , Ryan Hong , Crag Wang , sjg@google.com, Charles Hyde , Jared Dominguez , Mario Limonciello Subject: [PATCH v3] nvme: Add quirk for LiteON CL1 devices running FW 22301111 Date: Fri, 16 Aug 2019 15:16:19 -0500 Message-Id: <1565986579-10466-1-git-send-email-mario.limonciello@dell.com> X-Mailer: git-send-email 2.7.4 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-08-16_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=964 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908160206 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908160207 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org One of the components in LiteON CL1 device has limitations that can be encountered based upon boundary race conditions using the nvme bus specific suspend to idle flow. When this situation occurs the drive doesn't resume properly from suspend-to-idle. LiteON has confirmed this problem and fixed in the next firmware version. As this firmware is already in the field, avoid running nvme specific suspend to idle flow. Fixes: d916b1be94b6 ("nvme-pci: use host managed power state for suspend") Link: http://lists.infradead.org/pipermail/linux-nvme/2019-July/thread.html Signed-off-by: Mario Limonciello Signed-off-by: Charles Hyde --- drivers/nvme/host/core.c | 10 ++++++++++ drivers/nvme/host/nvme.h | 5 +++++ drivers/nvme/host/pci.c | 3 ++- 3 files changed, 17 insertions(+), 1 deletion(-) This patch is the spiritual successor to the previously submitted patch "[PATCH] drivers/nvme: save/restore HMB on suspend/resume". After discussion with LiteON, they agreed to resolve the issue in their next firmware release. This patch is dependent upon commit 4eaefe8c621c6195c91044396ed8060c179f7aae which is currently in Linus' tree for the next 5.3-rcX but not yet in nvme-5.4. changes from v2: * Fix whitespace to match other nearby code changes from v1: * Group all 3 possible CL1 strings together * Remove the resume code because it's already implied by ndev->last_ps = U32_MAX diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 8f3fbe5..a1c8c19 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2251,6 +2251,16 @@ static const struct nvme_core_quirk_entry core_quirks[] = { .vid = 0x1179, .mn = "THNSF5256GPUK TOSHIBA", .quirks = NVME_QUIRK_NO_APST, + }, + { + /* + * This LiteON CL1-3D*-Q11 firmware version has a race + * condition associated with actions related to suspend to idle + * LiteON has resolved the problem in future firmware + */ + .vid = 0x14a4, + .fr = "22301111", + .quirks = NVME_QUIRK_SIMPLE_SUSPEND, } }; diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index 26b563f..fe1ca0d 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h @@ -92,6 +92,11 @@ enum nvme_quirks { * Broken Write Zeroes. */ NVME_QUIRK_DISABLE_WRITE_ZEROES = (1 << 9), + + /* + * Force simple suspend/resume path. + */ + NVME_QUIRK_SIMPLE_SUSPEND = (1 << 10), }; /* diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 108e109..b366f54 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2875,7 +2875,8 @@ static int nvme_suspend(struct device *dev) * state (which may not be possible if the link is up). */ if (pm_suspend_via_firmware() || !ctrl->npss || - !pcie_aspm_enabled(pdev)) { + !pcie_aspm_enabled(pdev) || + (ndev->ctrl.quirks & NVME_QUIRK_SIMPLE_SUSPEND)) { nvme_dev_disable(ndev, true); return 0; } -- 2.7.4