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 'cxl-fixes-6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl

Pull cxl fixes from Dan Williams:
"A build regression fix, a device compatibility fix, and an original
bug preventing creation of large (16 device) interleave sets:

- Fix unit test build regression fallout from global
"missing-prototypes" change

- Fix compatibility with devices that do not support interrupts

- Fix overflow when calculating the capacity of large interleave sets"

* tag 'cxl-fixes-6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl:
cxl/region:Fix overflow issue in alloc_hpa()
cxl/pci: Skip irq features if MSI/MSI-X are not supported
tools/testing/nvdimm: Disable "missing prototypes / declarations" warnings
tools/testing/cxl: Disable "missing prototypes / declarations" warnings

+23 -13
+2 -2
drivers/cxl/core/region.c
··· 525 525 struct cxl_root_decoder *cxlrd = to_cxl_root_decoder(cxlr->dev.parent); 526 526 struct cxl_region_params *p = &cxlr->params; 527 527 struct resource *res; 528 - u32 remainder = 0; 528 + u64 remainder = 0; 529 529 530 530 lockdep_assert_held_write(&cxl_region_rwsem); 531 531 ··· 545 545 (cxlr->mode == CXL_DECODER_PMEM && uuid_is_null(&p->uuid))) 546 546 return -ENXIO; 547 547 548 - div_u64_rem(size, SZ_256M * p->interleave_ways, &remainder); 548 + div64_u64_rem(size, (u64)SZ_256M * p->interleave_ways, &remainder); 549 549 if (remainder) 550 550 return -EINVAL; 551 551
+15 -11
drivers/cxl/pci.c
··· 382 382 return rc; 383 383 } 384 384 385 - static int cxl_pci_setup_mailbox(struct cxl_memdev_state *mds) 385 + static int cxl_pci_setup_mailbox(struct cxl_memdev_state *mds, bool irq_avail) 386 386 { 387 387 struct cxl_dev_state *cxlds = &mds->cxlds; 388 388 const int cap = readl(cxlds->regs.mbox + CXLDEV_MBOX_CAPS_OFFSET); ··· 441 441 INIT_DELAYED_WORK(&mds->security.poll_dwork, cxl_mbox_sanitize_work); 442 442 443 443 /* background command interrupts are optional */ 444 - if (!(cap & CXLDEV_MBOX_CAP_BG_CMD_IRQ)) 444 + if (!(cap & CXLDEV_MBOX_CAP_BG_CMD_IRQ) || !irq_avail) 445 445 return 0; 446 446 447 447 msgnum = FIELD_GET(CXLDEV_MBOX_CAP_IRQ_MSGNUM_MASK, cap); ··· 588 588 return devm_add_action_or_reset(mds->cxlds.dev, free_event_buf, buf); 589 589 } 590 590 591 - static int cxl_alloc_irq_vectors(struct pci_dev *pdev) 591 + static bool cxl_alloc_irq_vectors(struct pci_dev *pdev) 592 592 { 593 593 int nvecs; 594 594 ··· 605 605 PCI_IRQ_MSIX | PCI_IRQ_MSI); 606 606 if (nvecs < 1) { 607 607 dev_dbg(&pdev->dev, "Failed to alloc irq vectors: %d\n", nvecs); 608 - return -ENXIO; 608 + return false; 609 609 } 610 - return 0; 610 + return true; 611 611 } 612 612 613 613 static irqreturn_t cxl_event_thread(int irq, void *id) ··· 743 743 } 744 744 745 745 static int cxl_event_config(struct pci_host_bridge *host_bridge, 746 - struct cxl_memdev_state *mds) 746 + struct cxl_memdev_state *mds, bool irq_avail) 747 747 { 748 748 struct cxl_event_interrupt_policy policy; 749 749 int rc; ··· 754 754 */ 755 755 if (!host_bridge->native_cxl_error) 756 756 return 0; 757 + 758 + if (!irq_avail) { 759 + dev_info(mds->cxlds.dev, "No interrupt support, disable event processing.\n"); 760 + return 0; 761 + } 757 762 758 763 rc = cxl_mem_alloc_event_buf(mds); 759 764 if (rc) ··· 794 789 struct cxl_register_map map; 795 790 struct cxl_memdev *cxlmd; 796 791 int i, rc, pmu_count; 792 + bool irq_avail; 797 793 798 794 /* 799 795 * Double check the anonymous union trickery in struct cxl_regs ··· 852 846 else 853 847 dev_warn(&pdev->dev, "Media not active (%d)\n", rc); 854 848 855 - rc = cxl_alloc_irq_vectors(pdev); 856 - if (rc) 857 - return rc; 849 + irq_avail = cxl_alloc_irq_vectors(pdev); 858 850 859 - rc = cxl_pci_setup_mailbox(mds); 851 + rc = cxl_pci_setup_mailbox(mds, irq_avail); 860 852 if (rc) 861 853 return rc; 862 854 ··· 913 909 } 914 910 } 915 911 916 - rc = cxl_event_config(host_bridge, mds); 912 + rc = cxl_event_config(host_bridge, mds, irq_avail); 917 913 if (rc) 918 914 return rc; 919 915
+2
tools/testing/cxl/Kbuild
··· 65 65 cxl_core-y += cxl_core_test.o 66 66 cxl_core-y += cxl_core_exports.o 67 67 68 + KBUILD_CFLAGS := $(filter-out -Wmissing-prototypes -Wmissing-declarations, $(KBUILD_CFLAGS)) 69 + 68 70 obj-m += test/
+2
tools/testing/cxl/test/Kbuild
··· 8 8 cxl_test-y := cxl.o 9 9 cxl_mock-y := mock.o 10 10 cxl_mock_mem-y := mem.o 11 + 12 + KBUILD_CFLAGS := $(filter-out -Wmissing-prototypes -Wmissing-declarations, $(KBUILD_CFLAGS))
+2
tools/testing/nvdimm/Kbuild
··· 82 82 libnvdimm-y += libnvdimm_test.o 83 83 libnvdimm-y += config_check.o 84 84 85 + KBUILD_CFLAGS := $(filter-out -Wmissing-prototypes -Wmissing-declarations, $(KBUILD_CFLAGS)) 86 + 85 87 obj-m += test/