Merge tag 'nvme-6.0-2022-09-29' of git://git.infradead.org/nvme into block-6.0 block-6.0 block-6.0-2022-09-29
authorJens Axboe <axboe@kernel.dk>
Thu, 29 Sep 2022 15:04:02 +0000 (09:04 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 29 Sep 2022 15:04:02 +0000 (09:04 -0600)
Pull NVMe fixes from Christoph:

"nvme fixes for Linux 6.1

 - fix IOC_PR_CLEAR and IOC_PR_RELEASE ioctls for nvme devices
   (Michael Kelley)
 - disable Write Zeroes on Phison E3C/E4C (Tina Hsu)"

* tag 'nvme-6.0-2022-09-29' of git://git.infradead.org/nvme:
  nvme-pci: disable Write Zeroes on Phison E3C/E4C
  nvme: Fix IOC_PR_CLEAR and IOC_PR_RELEASE ioctls for nvme devices

drivers/nvme/host/core.c
drivers/nvme/host/pci.c

index 70ebf27ad10e30e0fc933cbd18381e8e3576986c..4754188d9b04d64ebea289dacc259b8751dec7f7 100644 (file)
@@ -2162,14 +2162,14 @@ static int nvme_pr_preempt(struct block_device *bdev, u64 old, u64 new,
 
 static int nvme_pr_clear(struct block_device *bdev, u64 key)
 {
-       u32 cdw10 = 1 | (key ? 1 << 3 : 0);
+       u32 cdw10 = 1 | (key ? 0 : 1 << 3);
 
-       return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_register);
+       return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_release);
 }
 
 static int nvme_pr_release(struct block_device *bdev, u64 key, enum pr_type type)
 {
-       u32 cdw10 = nvme_pr_type(type) << 8 | (key ? 1 << 3 : 0);
+       u32 cdw10 = nvme_pr_type(type) << 8 | (key ? 0 : 1 << 3);
 
        return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_release);
 }
index ca15602401235fdb0701fc0544f597c7eadd22ac..3bdb97205699cd083387f809223cba9151248307 100644 (file)
@@ -3475,6 +3475,10 @@ static const struct pci_device_id nvme_id_table[] = {
        { PCI_DEVICE(0x1987, 0x5016),   /* Phison E16 */
                .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN |
                                NVME_QUIRK_BOGUS_NID, },
+       { PCI_DEVICE(0x1987, 0x5019),  /* phison E19 */
+               .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
+       { PCI_DEVICE(0x1987, 0x5021),   /* Phison E21 */
+               .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
        { PCI_DEVICE(0x1b4b, 0x1092),   /* Lexar 256 GB SSD */
                .driver_data = NVME_QUIRK_NO_NS_DESC_LIST |
                                NVME_QUIRK_IGNORE_DEV_SUBNQN, },