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

Krzysztof Wilczyński kwilczynski at kernel.org
Wed Apr 22 05:42:15 AEST 2026


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


More information about the Linuxppc-dev mailing list