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 branch 'for-6.19/cxl-elc' into cxl-for-next

- Add extended linear cache size sysfs attribute.
- Adjust failure emission of extended linear cache detection in cxl_acpi.

+61 -26
+10 -1
Documentation/ABI/testing/sysfs-bus-cxl
··· 496 496 changed, only freed by writing 0. The kernel makes no guarantees 497 497 that data is maintained over an address space freeing event, and 498 498 there is no guarantee that a free followed by an allocate 499 - results in the same address being allocated. 499 + results in the same address being allocated. If extended linear 500 + cache is present, the size indicates extended linear cache size 501 + plus the CXL region size. 500 502 503 + What: /sys/bus/cxl/devices/regionZ/extended_linear_cache_size 504 + Date: October, 2025 505 + KernelVersion: v6.19 506 + Contact: linux-cxl@vger.kernel.org 507 + Description: 508 + (RO) The size of extended linear cache, if there is an extended 509 + linear cache. Otherwise the attribute will not be visible. 501 510 502 511 What: /sys/bus/cxl/devices/regionZ/mode 503 512 Date: January, 2023
+7 -10
drivers/cxl/acpi.c
··· 372 372 373 373 rc = hmat_get_extended_linear_cache_size(&res, nid, &cache_size); 374 374 if (rc) 375 - return rc; 375 + return 0; 376 376 377 377 /* 378 378 * The cache range is expected to be within the CFMWS. ··· 397 397 int rc; 398 398 399 399 rc = cxl_acpi_set_cache_size(cxlrd); 400 - if (!rc) 401 - return; 402 - 403 - if (rc != -EOPNOTSUPP) { 400 + if (rc) { 404 401 /* 405 - * Failing to support extended linear cache region resize does not 402 + * Failing to retrieve extended linear cache region resize does not 406 403 * prevent the region from functioning. Only causes cxl list showing 407 404 * incorrect region size. 408 405 */ 409 406 dev_warn(cxlrd->cxlsd.cxld.dev.parent, 410 - "Extended linear cache calculation failed rc:%d\n", rc); 411 - } 407 + "Extended linear cache retrieval failed rc:%d\n", rc); 412 408 413 - /* Ignoring return code */ 414 - cxlrd->cache_size = 0; 409 + /* Ignoring return code */ 410 + cxlrd->cache_size = 0; 411 + } 415 412 } 416 413 417 414 DEFINE_FREE(put_cxlrd, struct cxl_root_decoder *,
+44 -15
drivers/cxl/core/region.c
··· 467 467 } 468 468 static DEVICE_ATTR_RW(commit); 469 469 470 - static umode_t cxl_region_visible(struct kobject *kobj, struct attribute *a, 471 - int n) 472 - { 473 - struct device *dev = kobj_to_dev(kobj); 474 - struct cxl_region *cxlr = to_cxl_region(dev); 475 - 476 - /* 477 - * Support tooling that expects to find a 'uuid' attribute for all 478 - * regions regardless of mode. 479 - */ 480 - if (a == &dev_attr_uuid.attr && cxlr->mode != CXL_PARTMODE_PMEM) 481 - return 0444; 482 - return a->mode; 483 - } 484 - 485 470 static ssize_t interleave_ways_show(struct device *dev, 486 471 struct device_attribute *attr, char *buf) 487 472 { ··· 745 760 } 746 761 static DEVICE_ATTR_RW(size); 747 762 763 + static ssize_t extended_linear_cache_size_show(struct device *dev, 764 + struct device_attribute *attr, 765 + char *buf) 766 + { 767 + struct cxl_region *cxlr = to_cxl_region(dev); 768 + struct cxl_region_params *p = &cxlr->params; 769 + ssize_t rc; 770 + 771 + ACQUIRE(rwsem_read_intr, rwsem)(&cxl_rwsem.region); 772 + if ((rc = ACQUIRE_ERR(rwsem_read_intr, &rwsem))) 773 + return rc; 774 + return sysfs_emit(buf, "%#llx\n", p->cache_size); 775 + } 776 + static DEVICE_ATTR_RO(extended_linear_cache_size); 777 + 748 778 static struct attribute *cxl_region_attrs[] = { 749 779 &dev_attr_uuid.attr, 750 780 &dev_attr_commit.attr, ··· 768 768 &dev_attr_resource.attr, 769 769 &dev_attr_size.attr, 770 770 &dev_attr_mode.attr, 771 + &dev_attr_extended_linear_cache_size.attr, 771 772 NULL, 772 773 }; 774 + 775 + static umode_t cxl_region_visible(struct kobject *kobj, struct attribute *a, 776 + int n) 777 + { 778 + struct device *dev = kobj_to_dev(kobj); 779 + struct cxl_region *cxlr = to_cxl_region(dev); 780 + 781 + /* 782 + * Support tooling that expects to find a 'uuid' attribute for all 783 + * regions regardless of mode. 784 + */ 785 + if (a == &dev_attr_uuid.attr && cxlr->mode != CXL_PARTMODE_PMEM) 786 + return 0444; 787 + 788 + /* 789 + * Don't display extended linear cache attribute if there is no 790 + * extended linear cache. 791 + */ 792 + if (a == &dev_attr_extended_linear_cache_size.attr && 793 + cxlr->params.cache_size == 0) 794 + return 0; 795 + 796 + return a->mode; 797 + } 773 798 774 799 static const struct attribute_group cxl_region_group = { 775 800 .attrs = cxl_region_attrs, ··· 3604 3579 dev_warn(cxlmd->dev.parent, 3605 3580 "Extended linear cache calculation failed rc:%d\n", rc); 3606 3581 } 3582 + 3583 + rc = sysfs_update_group(&cxlr->dev.kobj, &cxl_region_group); 3584 + if (rc) 3585 + return rc; 3607 3586 3608 3587 rc = insert_resource(cxlrd->res, res); 3609 3588 if (rc) {