[PATCH v2] nvme/pci: Add new quirk for SK hynix PC400 NLB off-by-one bug

Kai-Heng Feng kai.heng.feng at canonical.com
Thu Jul 23 12:10:39 EDT 2020


> On Jul 24, 2020, at 00:03, Christoph Hellwig <hch at lst.de> wrote:
> 
> On Thu, Jul 23, 2020 at 11:57:31PM +0800, Kai-Heng Feng wrote:
>> 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
>> 
>> Write Uncorrectable isn't implemented yet, so add a new quirk to
>> workaround the former two commands.
> 
> compare isn't implemented either in the kernel, and we certainly
> aren't going to do these quirks for passthrough.  So I think we really
> want a "write zeroes is buggy" quirk and just disable issuing that
> command from the driver.

Ok, will send a new version based on your suggestion.

> 
>> 
>> BugLink: https://bugs.launchpad.net/bugs/1872383
>> Cc: kyounghwan sohn <kyounghwan.sohn at sk.com>
>> Signed-off-by: Kai-Heng Feng <kai.heng.feng at canonical.com>
>> ---
>> v2:
>> - SK hynix found the root cause so change the approach accordingly.
>> - lspci is wrong, the device is PC400 instead of SC300.
> 
> I don't remember seing a v1..

Well, because it took some time for the vendor to find the root cause...
Here's the v1:
https://lkml.org/lkml/2020/4/17/169

Kai-Heng




More information about the Linux-nvme mailing list