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

Krzysztof Wilczyński <[email protected]>
Newsgroups gmane.linux.ports.ppc.embedded,gmane.linux.kernel.pci,gmane.linux.ports.alpha
Message-ID <20260421194215.GC1684602@rocinante>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.