Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3440680pxk; Mon, 28 Sep 2020 18:33:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIy6WeardIA1qntXnxCWAvwKINuXvDEZtzinUu2yjvxDaH8tQsP3KWuVwlEXl/mAhCTXeH X-Received: by 2002:aa7:d30b:: with SMTP id p11mr814588edq.80.1601343182538; Mon, 28 Sep 2020 18:33:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601343182; cv=none; d=google.com; s=arc-20160816; b=K0lLGigvkegxzP2yZ6lVheG5xhxwzDLlbGi4/xPvLNX5sEF4ZhMyEdauDmMhjCHpwd 6/ARu8vspdZsn8SpFRB/75Gbl65HNYdKJgzTRqV4sIhaZcYKoI5mAsySiFr9qcFTvrmD IPc9lHKBFF+ERNP1gkLRqe/zHR7jO58+ZUWJDoFe/w5hcVNDmJ/IgOF5OXOHCRVqh1/8 QsMT5wPi5wqKwTHRR6ElT6zX+zl9OhfjEVJlstWW9PCCfrH3129Jf1/MgrD+Jz2iTIQU hrQQuro/ctt3u1UqMXNpf736sEZRk86dkfs7LtsiB7F9kdBid8LHQM27/LcRz5Nmyorq UfFw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pDlPwCN5G1IsPDw4K4gsR65Lr2AWiMl9JYk4bl1rJgQ=; b=L+pxY5Pmv95oQdNrZmgBmzLKFQDs0Zoo0XvfQ8+xCUqR1lKl8lG8eW5o6Bq3OZyqSN n1hOTpJPJVR+RAvA8C0xRSfdbWWPENLo1u0IYFyrODYOgQDTiRZSbhBWIUo+DE16xm+n 5iVulPzjMUW59eOLxv9gcNS62QQ9JTuagGMG3RSJOpDCczriZWyPkmZG1v52wOvCb2Bo 5bQrRmgDmzDXVcnzX9e9qe9QUPu941K0pwWLzpHwQJIWonbcwpzeR51kB0EXHUj4gUZ+ PYervXJ9cQQNSICSGe+Ebu6Z2ve5zY4MvnIkAx4G/v2+sKRmLQuNg+8juJRw6VKDNOAc m6/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="A2MA/n4B"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l18si1636678ejr.492.2020.09.28.18.32.33; Mon, 28 Sep 2020 18:33:02 -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; dkim=pass header.i=@kernel.org header.s=default header.b="A2MA/n4B"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727452AbgI2Ba5 (ORCPT + 99 others); Mon, 28 Sep 2020 21:30:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:39776 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727043AbgI2Bao (ORCPT ); Mon, 28 Sep 2020 21:30:44 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4D838221EF; Tue, 29 Sep 2020 01:30:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601343044; bh=tSj8Ri06+wF3ANOcZBQI6Ri2GA0CBE4r2n61sONm++Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A2MA/n4BBLTmeq67Z3vT/xua6zY537GpikPTETUV9Yq9HCoHtMeiGGoCM3wNzaQJo cl/RqdInhjZjFT0VNZFLMIvt2Cwfp6J+w/uBm72LzvStJMT9Czxz8vSztGeaDVVn7v tvt6jdeq2mzytU6m0zpdVIzFEqiQk2saxzkI02bA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: David Milburn , Eric Sandeen , Eric Sandeen , Christoph Hellwig , Sasha Levin , linux-nvme@lists.infradead.org Subject: [PATCH AUTOSEL 5.8 12/29] nvme-pci: disable the write zeros command for Intel 600P/P3100 Date: Mon, 28 Sep 2020 21:30:09 -0400 Message-Id: <20200929013027.2406344-12-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200929013027.2406344-1-sashal@kernel.org> References: <20200929013027.2406344-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Milburn [ Upstream commit ce4cc3133dc72c31bd49ddcf22d0f9eeff47a761 ] The write zeros command does not work with 4k range. bash-4.4# ./blkdiscard /dev/nvme0n1p2 bash-4.4# strace -efallocate xfs_io -c "fzero 536895488 2048" /dev/nvme0n1p2 fallocate(3, FALLOC_FL_ZERO_RANGE, 536895488, 2048) = 0 +++ exited with 0 +++ bash-4.4# dd bs=1 if=/dev/nvme0n1p2 skip=536895488 count=512 | hexdump -C 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000200 bash-4.4# ./blkdiscard /dev/nvme0n1p2 bash-4.4# strace -efallocate xfs_io -c "fzero 536895488 4096" /dev/nvme0n1p2 fallocate(3, FALLOC_FL_ZERO_RANGE, 536895488, 4096) = 0 +++ exited with 0 +++ bash-4.4# dd bs=1 if=/dev/nvme0n1p2 skip=536895488 count=512 | hexdump -C 00000000 5c 61 5c b0 96 21 1b 5e 85 0c 07 32 9c 8c eb 3c |\a\..!.^...2...<| 00000010 4a a2 06 ca 67 15 2d 8e 29 8d a8 a0 7e 46 8c 62 |J...g.-.)...~F.b| 00000020 bb 4c 6c c1 6b f5 ae a5 e4 a9 bc 93 4f 60 ff 7a |.Ll.k.......O`.z| Reported-by: Eric Sandeen Signed-off-by: David Milburn Tested-by: Eric Sandeen Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/host/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 69a19fe241063..90346cba87d1e 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -3093,7 +3093,8 @@ static const struct pci_device_id nvme_id_table[] = { { PCI_VDEVICE(INTEL, 0xf1a5), /* Intel 600P/P3100 */ .driver_data = NVME_QUIRK_NO_DEEPEST_PS | NVME_QUIRK_MEDIUM_PRIO_SQ | - NVME_QUIRK_NO_TEMP_THRESH_CHANGE }, + NVME_QUIRK_NO_TEMP_THRESH_CHANGE | + NVME_QUIRK_DISABLE_WRITE_ZEROES, }, { PCI_VDEVICE(INTEL, 0xf1a6), /* Intel 760p/Pro 7600p */ .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN, }, { PCI_VDEVICE(INTEL, 0x5845), /* Qemu emulated controller */ -- 2.25.1