From patchwork Tue Jul 28 08:45:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1337626 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=IMda4KeR; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BG9J10FLGz9sTv; Tue, 28 Jul 2020 18:46:09 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1k0LFM-0002LI-KC; Tue, 28 Jul 2020 08:46:04 +0000 Received: from mail-pg1-f196.google.com ([209.85.215.196]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1k0LFJ-0002J7-TA for kernel-team@lists.ubuntu.com; Tue, 28 Jul 2020 08:46:02 +0000 Received: by mail-pg1-f196.google.com with SMTP id e8so11469066pgc.5 for ; Tue, 28 Jul 2020 01:46:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ud82Q+GDNY8FLwt0HA1RiSzeCAQY8pkvSmFoY/TDbg8=; b=IMda4KeRREt9QDHF38xLNGixV/Xdi+F1WX/ZD+itc+IPwvfd+TiJ2zVBelSF33mgPB /pLbDC62B9hRD5XliCjjiJvVFrGBYdLHAJj+v3wt4TKVCoST9fWp6XbnjkQf095Qzfzv d5iqkVimUQs4bSOCkagFra0oazyd6YlOrWxUALCttY/C3imarHn4N4CbiuddzOCBYXgs QgZeQx/NCXWG11mq8guRVnpC5Ia5zWDKOw1DRJ8ugUfS3G7RfT96b6SC5jYx6qL+Idqg rQMu/TFLZZXDmjh98SY2pVBGsZ3yYWhEvDZj3AjGrtA13bjqxfRjtcMqJVLMwMMQrye9 25JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Ud82Q+GDNY8FLwt0HA1RiSzeCAQY8pkvSmFoY/TDbg8=; b=Ttv+X0HVNbi32F6bE7S9/uKMEMyDH5L4hyv/jlRk6QgBwafAWALh6d5E4fWiqWcig/ U03hPOOnM/q8K17en21RC7zdwcLLDNAkWLFaPZBIixTlHXwccDnEYHWBrEUwGtjqMSZe KrWKX38SE3Qu7vGfxsLLysWd4ISxyp1CWCi4+RrgrsYFzyzMpyjt0enAFYVs6KoqfLU1 TGzPrrhkfjC+6m2K4oYnu7cp6z1qIUtSUF/rhiW5I8uumaVUyyeu28GJ68LVM0EPW9iB az2hgNm819fG+4CiqgK9B6BsHjuERtIhV0+zmXs5HaPzpHQjvf4ws3FtoCGnE7xPcNsL YVYQ== X-Gm-Message-State: AOAM531LxiGzsMZi7Uvi+ymohSjpN56srDgy+LNrLNG91Mk53fvZyshS V3mPXmFwx6yQ7L6v0dhXvZQEXL4HNkk= X-Google-Smtp-Source: ABdhPJw36zF2gGk//+VOuLiSYoEBpG1OSd1/K8gWTJkazlMHEbrORLwjBM1zDfPxXVhJXjAemXuoNw== X-Received: by 2002:a63:f91d:: with SMTP id h29mr23390441pgi.185.1595925959695; Tue, 28 Jul 2020 01:45:59 -0700 (PDT) Received: from localhost (220-135-95-34.HINET-IP.hinet.net. [220.135.95.34]) by smtp.gmail.com with ESMTPSA id i14sm2145876pjz.25.2020.07.28.01.45.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2020 01:45:59 -0700 (PDT) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/1][SRU][F][G][OEM-5.6] nvme-pci: prevent SK hynix PC400 from using Write Zeroes command Date: Tue, 28 Jul 2020 16:45:54 +0800 Message-Id: <20200728084554.14827-2-acelan.kao@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200728084554.14827-1-acelan.kao@canonical.com> References: <20200728084554.14827-1-acelan.kao@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.215.196; envelope-from=acelan@gmail.com; helo=mail-pg1-f196.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Kai-Heng Feng 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 Signed-off-by: Christoph Hellwig (cherry picked from commit 5611ec2b9814bc91f7b0a8d804c1fc152e2025d9 nvme/nvme-5.8) Signed-off-by: AceLan Kao Acked-by: Stefan Bader --- 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 cd64ddb129e5..3208f378a46b 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -3125,6 +3125,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 },