Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1506930ybh; Thu, 23 Jul 2020 10:31:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFQ6tB40EA1MfRH6CnPKQiSW1WKV6VfbVheO2UPINADMsNCprPiedjgQFXar6pdYGWUQYI X-Received: by 2002:aa7:c450:: with SMTP id n16mr5073047edr.53.1595525467089; Thu, 23 Jul 2020 10:31:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595525467; cv=none; d=google.com; s=arc-20160816; b=CRV9WXrMXGWYpZ4bweYEMN7fDdng69Kya5tIuIsz+niOMu7GsyQrjnqGLBEhnr5dGd eepicPzd6kb/Ebd8H2UjvlbpvIxRYa/lfRJZ9JDSsd4I38dPH+eYSyp60Pat9AbIipRK YOshWtmMUdf0EtJ8zuiS8GmfJTGz+0P4dRW5EBP9q+ZX9UIm80ZS1Q1KevHJ3X9M6Bhi JkeSRwBY4ivH6EGHts6RGbrQ1Tmt0biVmf+CFVoLj8Qb04kvDuyHYHZC93fA/+tgS9jU /+v+L3rhySGm+qjwm1ZpwSu6bnqGgxEVGrXQ1Cv2N2wDSZQWQ0BEDOQFRPCes2Bqgu3X UH6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=x86L6gMUCFXqM2pkkJIuHlmOd0iUHXyzUU4ttqpfVpY=; b=GM4n6aLXMTVjEo4YsGUbkerUZ66dx2JpHKhQUlbsSzCHafycpoG8iYcPxVdruma2XV tnp9zYVxuyvOaIXMCNHhUBE+a4MN+emcvwVyqGuS7YB+NKUmbrk9QZqN31DzpbQwHpdL FU9is9DHOsuOuwVPE0Kb0s9HSR3wO//9moJNphJ3DzyxZh5uHcYP7kFktkaXCHH+hYs5 m+Lic68Ye+mUaAfH70yt+gf5VoxbcCwizlym8HDCfzvWcDmJSh4k1x6R2WpYamf1Y6hW Qr5YEe0ZF0kiVcRtYdpFig4GS36+Io4gKjik7xY0egYnKL2KtXkz+OupP2I/HgPykcCg EaJA== 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 o17si2446909ejg.160.2020.07.23.10.30.44; Thu, 23 Jul 2020 10:31:07 -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 S1730093AbgGWR3j (ORCPT + 99 others); Thu, 23 Jul 2020 13:29:39 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56394 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730025AbgGWR3i (ORCPT ); Thu, 23 Jul 2020 13:29:38 -0400 Received: from 61-220-137-37.hinet-ip.hinet.net ([61.220.137.37] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jyf1z-0001YW-VR; Thu, 23 Jul 2020 17:29:20 +0000 From: Kai-Heng Feng To: kbusch@kernel.org, axboe@fb.com, hch@lst.de, sagi@grimberg.me Cc: Kai-Heng Feng , kyounghwan sohn , linux-nvme@lists.infradead.org (open list:NVM EXPRESS DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v3] nvme/pci: Prevent SK hynix PC400 from using Write Zeroes command Date: Fri, 24 Jul 2020 01:29:10 +0800 Message-Id: <20200723172910.28350-1-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200723155731.22313-1-kai.heng.feng@canonical.com> References: <20200723155731.22313-1-kai.heng.feng@canonical.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After commit 6e02318eaea5 ("nvme: add support for the Write Zeroes command"), SK hynix PC400 becomes very slow with the following error message: [ 224.567695] blk_update_request: operation not supported error, dev nvme1n1, sector 499384320 op 0x9:(WRITE_ZEROES) flags 0x1000000 phys_seg 0 prio class 0] SK Hynix PC400 has a buggy firmware that treats NLB as max value instead of a range, so the NLB passed isn't a valid value to the firmware. According to SK hynix there are three commands are affected: - Write Zeroes - Compare - Write Uncorrectable Right now only Write Zeroes is implemented, so disable it completely on SK hynix PC400. BugLink: https://bugs.launchpad.net/bugs/1872383 Cc: kyounghwan sohn Signed-off-by: Kai-Heng Feng --- v3: - Simply disable Write Zeroes command. v2: - SK hynix found the root cause so change the approach accordingly. - lspci is wrong, the device is PC400 instead of SC300. drivers/nvme/host/pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index b1d18f0633c7..25a187e43dbe 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -3122,6 +3122,8 @@ static const struct pci_device_id nvme_id_table[] = { { PCI_DEVICE(0x1cc1, 0x8201), /* ADATA SX8200PNP 512GB */ .driver_data = NVME_QUIRK_NO_DEEPEST_PS | NVME_QUIRK_IGNORE_DEV_SUBNQN, }, + { PCI_DEVICE(0x1c5c, 0x1504), /* SK Hynix PC400 */ + .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) }, { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001), .driver_data = NVME_QUIRK_SINGLE_VECTOR }, -- 2.17.1