Re: [PATCH v5 07/23] PCI/sysfs: Convert PCI resource files to static attributes

Krzysztof Wilczyński
2026-04-21T19:42:17Z

Hello,

> @@ -1685,14 +1700,14 @@ static ssize_t __resource_resize_store(struct device *dev, int n,
> pci_write_config_word(pdev, PCI_COMMAND,
> cmd & ~PCI_COMMAND_MEMORY);
>
> - pci_remove_resource_files(pdev);
> + sysfs_remove_groups(&pdev->dev.kobj, pci_dev_resource_attr_groups);
>
> ret = pci_resize_resource(pdev, n, size, 0);
>
> pci_assign_unassigned_bus_resources(bus);
>
> - if (pci_create_resource_files(pdev))
> - pci_warn(pdev, "Failed to recreate resource files after BAR resizing\n");
> + if (sysfs_create_groups(&pdev->dev.kobj, pci_dev_resource_attr_groups))
> + pci_warn(pdev, "Failed to recreate resource groups after BAR resizing\n");
>
> pci_write_config_word(pdev, PCI_COMMAND, cmd);
> pm_put:

Moving __resource_resize_store() and everything else related to resizable
BAR resources behind the HAVE_PCI_MMAP and/or ARCH_GENERIC_PCI_MMAP_RESOURCE
check, where either is required for resizable BAR support, would stop this
from being included on architectures that offer no support for resizable
BARs.

Something for the next version.

Thank you,

Krzysztof