Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'block-6.9-20240510' of git://git.kernel.dk/linux

Pull block fixes from Jens Axboe:

- NVMe pull request via Keith:
- nvme target fixes (Sagi, Dan, Maurizo)
- new vendor quirk for broken MSI (Sean)

- Virtual boundary fix for a regression in this merge window (Ming)

* tag 'block-6.9-20240510' of git://git.kernel.dk/linux:
nvmet-rdma: fix possible bad dereference when freeing rsps
nvmet: prevent sprintf() overflow in nvmet_subsys_nsid_exists()
nvmet: make nvmet_wq unbound
nvmet-auth: return the error code to the nvmet_auth_ctrl_hash() callers
nvme-pci: Add quirk for broken MSIs
block: set default max segment size in case of virt_boundary

+29 -21
+4 -1
block/blk-settings.c
··· 188 188 * bvec and lower layer bio splitting is supposed to handle the two 189 189 * correctly. 190 190 */ 191 - if (!lim->virt_boundary_mask) { 191 + if (lim->virt_boundary_mask) { 192 + if (!lim->max_segment_size) 193 + lim->max_segment_size = UINT_MAX; 194 + } else { 192 195 /* 193 196 * The maximum segment size has an odd historic 64k default that 194 197 * drivers probably should override. Just like the I/O size we
+5
drivers/nvme/host/nvme.h
··· 162 162 * Disables simple suspend/resume path. 163 163 */ 164 164 NVME_QUIRK_FORCE_NO_SIMPLE_SUSPEND = (1 << 20), 165 + 166 + /* 167 + * MSI (but not MSI-X) interrupts are broken and never fire. 168 + */ 169 + NVME_QUIRK_BROKEN_MSI = (1 << 21), 165 170 }; 166 171 167 172 /*
+11 -3
drivers/nvme/host/pci.c
··· 2224 2224 .priv = dev, 2225 2225 }; 2226 2226 unsigned int irq_queues, poll_queues; 2227 + unsigned int flags = PCI_IRQ_ALL_TYPES | PCI_IRQ_AFFINITY; 2227 2228 2228 2229 /* 2229 2230 * Poll queues don't need interrupts, but we need at least one I/O queue ··· 2248 2247 irq_queues = 1; 2249 2248 if (!(dev->ctrl.quirks & NVME_QUIRK_SINGLE_VECTOR)) 2250 2249 irq_queues += (nr_io_queues - poll_queues); 2251 - return pci_alloc_irq_vectors_affinity(pdev, 1, irq_queues, 2252 - PCI_IRQ_ALL_TYPES | PCI_IRQ_AFFINITY, &affd); 2250 + if (dev->ctrl.quirks & NVME_QUIRK_BROKEN_MSI) 2251 + flags &= ~PCI_IRQ_MSI; 2252 + return pci_alloc_irq_vectors_affinity(pdev, 1, irq_queues, flags, 2253 + &affd); 2253 2254 } 2254 2255 2255 2256 static unsigned int nvme_max_io_queues(struct nvme_dev *dev) ··· 2480 2477 { 2481 2478 int result = -ENOMEM; 2482 2479 struct pci_dev *pdev = to_pci_dev(dev->dev); 2480 + unsigned int flags = PCI_IRQ_ALL_TYPES; 2483 2481 2484 2482 if (pci_enable_device_mem(pdev)) 2485 2483 return result; ··· 2497 2493 * interrupts. Pre-enable a single MSIX or MSI vec for setup. We'll 2498 2494 * adjust this later. 2499 2495 */ 2500 - result = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES); 2496 + if (dev->ctrl.quirks & NVME_QUIRK_BROKEN_MSI) 2497 + flags &= ~PCI_IRQ_MSI; 2498 + result = pci_alloc_irq_vectors(pdev, 1, 1, flags); 2501 2499 if (result < 0) 2502 2500 goto disable; 2503 2501 ··· 3396 3390 .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY | 3397 3391 NVME_QUIRK_DISABLE_WRITE_ZEROES| 3398 3392 NVME_QUIRK_IGNORE_DEV_SUBNQN, }, 3393 + { PCI_DEVICE(0x15b7, 0x5008), /* Sandisk SN530 */ 3394 + .driver_data = NVME_QUIRK_BROKEN_MSI }, 3399 3395 { PCI_DEVICE(0x1987, 0x5012), /* Phison E12 */ 3400 3396 .driver_data = NVME_QUIRK_BOGUS_NID, }, 3401 3397 { PCI_DEVICE(0x1987, 0x5016), /* Phison E16 */
+1 -1
drivers/nvme/target/auth.c
··· 480 480 nvme_auth_free_key(transformed_key); 481 481 out_free_tfm: 482 482 crypto_free_shash(shash_tfm); 483 - return 0; 483 + return ret; 484 484 } 485 485 486 486 int nvmet_auth_ctrl_exponential(struct nvmet_req *req,
+2 -3
drivers/nvme/target/configfs.c
··· 757 757 bool nvmet_subsys_nsid_exists(struct nvmet_subsys *subsys, u32 nsid) 758 758 { 759 759 struct config_item *ns_item; 760 - char name[4] = {}; 760 + char name[12]; 761 761 762 - if (sprintf(name, "%u", nsid) <= 0) 763 - return false; 762 + snprintf(name, sizeof(name), "%u", nsid); 764 763 mutex_lock(&subsys->namespaces_group.cg_subsys->su_mutex); 765 764 ns_item = config_group_find_item(&subsys->namespaces_group, name); 766 765 mutex_unlock(&subsys->namespaces_group.cg_subsys->su_mutex);
+2 -1
drivers/nvme/target/core.c
··· 1686 1686 if (!buffered_io_wq) 1687 1687 goto out_free_zbd_work_queue; 1688 1688 1689 - nvmet_wq = alloc_workqueue("nvmet-wq", WQ_MEM_RECLAIM, 0); 1689 + nvmet_wq = alloc_workqueue("nvmet-wq", 1690 + WQ_MEM_RECLAIM | WQ_UNBOUND, 0); 1690 1691 if (!nvmet_wq) 1691 1692 goto out_free_buffered_work_queue; 1692 1693
+4 -12
drivers/nvme/target/rdma.c
··· 474 474 return 0; 475 475 476 476 out_free: 477 - while (--i >= 0) { 478 - struct nvmet_rdma_rsp *rsp = &queue->rsps[i]; 479 - 480 - list_del(&rsp->free_list); 481 - nvmet_rdma_free_rsp(ndev, rsp); 482 - } 477 + while (--i >= 0) 478 + nvmet_rdma_free_rsp(ndev, &queue->rsps[i]); 483 479 kfree(queue->rsps); 484 480 out: 485 481 return ret; ··· 486 490 struct nvmet_rdma_device *ndev = queue->dev; 487 491 int i, nr_rsps = queue->recv_queue_size * 2; 488 492 489 - for (i = 0; i < nr_rsps; i++) { 490 - struct nvmet_rdma_rsp *rsp = &queue->rsps[i]; 491 - 492 - list_del(&rsp->free_list); 493 - nvmet_rdma_free_rsp(ndev, rsp); 494 - } 493 + for (i = 0; i < nr_rsps; i++) 494 + nvmet_rdma_free_rsp(ndev, &queue->rsps[i]); 495 495 kfree(queue->rsps); 496 496 } 497 497