linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [v2] nvme-pci: disable write zeros support on specific SSDs
@ 2022-03-15 13:20 Mark Hsieh
  2022-03-15 13:22 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Hsieh @ 2022-03-15 13:20 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-nvme, sagi, hch, axboe, kbusch, alsa-devel, Mark_Hsieh, Mark Hsieh

Like commit 5611ec2b9814 ("nvme-pci: prevent SK hynix PC400 from using
Write Zeroes command"), Micron has the same issue:
[ 6305.633887] blk_update_request: operation not supported error, dev
nvme0n1, sector 340812032 op 0x9:(WRITE_ZEROES) flags 0x0 phys_seg 0 prio class 0

So also disable Write Zeroes command on Micron.

Signed-off-by: Mark Hsieh <mark_hsieh@wistron.corp-partner.google.com>
---
 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 a7a502a5b2b5..68745e1d7b6a 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -3245,6 +3245,8 @@ static const struct pci_device_id nvme_id_table[] = {
 		.driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
 	{ PCI_DEVICE(0x2646, 0x500d),   /* Kingston OM3PDP3256B-AH 256G */
 		.driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
+	{ PCI_DEVICE(0x1344, 0x5411),   /* Micron 2450 MTFDKCD256TFK 256G */
+		.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, },
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] [v2] nvme-pci: disable write zeros support on specific SSDs
  2022-03-15 13:20 [PATCH] [v2] nvme-pci: disable write zeros support on specific SSDs Mark Hsieh
@ 2022-03-15 13:22 ` Christoph Hellwig
  2022-03-15 13:47   ` Sagi Grimberg
       [not found]   ` <TY2PR02MB2752B1742028968B3DAE02EBEA129@TY2PR02MB2752.apcprd02.prod.outlook.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Christoph Hellwig @ 2022-03-15 13:22 UTC (permalink / raw)
  To: Mark Hsieh
  Cc: linux-kernel, linux-nvme, sagi, hch, axboe, kbusch, alsa-devel,
	Mark_Hsieh

On Tue, Mar 15, 2022 at 09:20:59PM +0800, Mark Hsieh wrote:
> Like commit 5611ec2b9814 ("nvme-pci: prevent SK hynix PC400 from using
> Write Zeroes command"), Micron has the same issue:
> [ 6305.633887] blk_update_request: operation not supported error, dev
> nvme0n1, sector 340812032 op 0x9:(WRITE_ZEROES) flags 0x0 phys_seg 0 prio class 0
> 
> So also disable Write Zeroes command on Micron.

This still ignores all the questions I've asked.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [v2] nvme-pci: disable write zeros support on specific SSDs
  2022-03-15 13:22 ` Christoph Hellwig
@ 2022-03-15 13:47   ` Sagi Grimberg
       [not found]   ` <TY2PR02MB2752B1742028968B3DAE02EBEA129@TY2PR02MB2752.apcprd02.prod.outlook.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Sagi Grimberg @ 2022-03-15 13:47 UTC (permalink / raw)
  To: Christoph Hellwig, Mark Hsieh
  Cc: linux-kernel, linux-nvme, axboe, kbusch, alsa-devel, Mark_Hsieh


>> Like commit 5611ec2b9814 ("nvme-pci: prevent SK hynix PC400 from using
>> Write Zeroes command"), Micron has the same issue:
>> [ 6305.633887] blk_update_request: operation not supported error, dev
>> nvme0n1, sector 340812032 op 0x9:(WRITE_ZEROES) flags 0x0 phys_seg 0 prio class 0
>>
>> So also disable Write Zeroes command on Micron.
> 
> This still ignores all the questions I've asked.

For some reason I cannot find the original patch(es)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [v2] nvme-pci: disable write zeros support on specific SSDs
       [not found]   ` <TY2PR02MB2752B1742028968B3DAE02EBEA129@TY2PR02MB2752.apcprd02.prod.outlook.com>
@ 2022-03-17 17:10     ` Keith Busch
  0 siblings, 0 replies; 4+ messages in thread
From: Keith Busch @ 2022-03-17 17:10 UTC (permalink / raw)
  To: Mark Hsieh/WHQ/Wistron
  Cc: Christoph Hellwig, Mark Hsieh, linux-kernel, linux-nvme, sagi,
	axboe, alsa-devel

On Thu, Mar 17, 2022 at 07:03:52AM +0000, Mark Hsieh/WHQ/Wistron wrote:
> Sorry late reply as it take a while to confirm with Micron engineering team.
 
It would help keep the thread readable if you send mailing list messages in
plain text. 
 
> But more importantly something seems really broken here if the device claims to support Write Zeroes but then doesn't claims it is not supported.
> 
>   *   We support write zero command indeed, but if host send too much write zero commands in due to the architecture design, we need spend lots of time to handle it, so we want to add 2450 in the google check list to resolve this issue.
>   *   2450 doesn't violate the write zero command spec, but total write zero command handle time will be too long for host point of view.
> 
> Can you see if this only happens with some I/O size?  With our without the nounmap flag?  Does the device report non-MDTS command limits?
> 
>   *   If the LBA range of each write zero command is quite small, it will let drive spend more time to handle it.
>   *   With noun-map flag (Deallocate = 0)
>   *   We report MDTS as 256KB, but write zero command doesn't take it as a reference.

The driver already limits Write Zeroes to MDTS if it doesn't report non-MDTS
limits. The spec doesn't require a driver do that, but we do out of an
abundance of caution.

So you are saying that sending many small Write Zeroes is taking more time on
the drive side compared to a single larger Write Zeroes? Would it be successful
if we weren't splitting these?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-17 17:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-15 13:20 [PATCH] [v2] nvme-pci: disable write zeros support on specific SSDs Mark Hsieh
2022-03-15 13:22 ` Christoph Hellwig
2022-03-15 13:47   ` Sagi Grimberg
     [not found]   ` <TY2PR02MB2752B1742028968B3DAE02EBEA129@TY2PR02MB2752.apcprd02.prod.outlook.com>
2022-03-17 17:10     ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).