ata: pata_macio: Fix PCI region leak
PATCH v2 1/1 ata: pata_macio: Fix PCI region leak
pci_request_regions() became a managed devres functions if the PCI device was enabled with pcim_enable_device(), which is the case for pata_macio.
The PCI subsystem recently removed this hybrid feature from pci_request_region(). When doing so, pata_macio was forgotten to be ported to use pcim_request_all_regions(). If that function is not used, pata_macio will fail on driver-reload because the PCI regions will remain blocked.
Fix the region leak by replacing pci_request_regions() with its managed counterpart, pcim_request_all_regions().
---
Changes in v2:
- Add Fixes: tag and rephrase commit message, since the merge window closed already. (Niklas)
--- drivers/ata/pata_macio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/pata_macio.c +1 -1
@@ -1298,7 +1298,7 @@ static int pata_macio_pci_attach(struct pci_dev *pdev, priv->dev = &pdev->dev;/* Get MMIO regions */ -if (pci_request_regions (pdev,"pata-macio" )) { +if (pcim_request_all_regions (pdev,"pata-macio" )) {dev_err (&pdev->dev,"Cannot obtain PCI resources\n" );return -EBUSY ;
Signature · 1 line
2.49.0
Quoted 11 lines · Philipp Stanner
pci_request_regions()became a managed devres functions if the PCI device was enabled withpcim_enable_device(), which is the case forpata_macio.The PCI subsystem recently removed this hybrid feature from
pci_request_region(). When doing so,pata_maciowas forgotten to be ported to usepcim_request_all_regions(). If that function is not used,pata_maciowill fail on driver-reload because the PCI regions will remain blocked.
Quoted 7 lines
Fix the region leak by replacing
pci_request_regions()with its managed
counterpart,pcim_request_all_regions().Fixes 51f6aec99cb0 ("PCI: Remove hybrid devres nature from requestfunctions")
Signed-off-by Philipp Stanner <[email protected]>
Forgot Damien's Reviewed-by.
P.
Quoted 23 lines
---
Changes in v2:
- Add Fixes: tag and rephrase commit message, since the merge window
closed already. (Niklas)
---
drivers/ata/pata_macio.c | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/ata/pata_macio.c +0
-0@@ -1298,7 +1298,7 @@ static int pata_macio_pci_attach(struct pci_dev *pdev, priv->dev = &pdev->dev;
/* Get MMIO regions */drivers/ata/pata_macio.c +1
-1-if (pci_request_regions (pdev,"pata-macio" )) { +if (pcim_request_all_regions (pdev,"pata-macio" )) {dev_err(&pdev->dev,
"Cannot obtain PCI resources\n"); return-EBUSY;
Quoted 16 lines · Philipp Stanner
Quoted 15 lines · Philipp Stanner
pci_request_regions()became a managed devres functions if the PCI device was enabled withpcim_enable_device(), which is the case forpata_macio.The PCI subsystem recently removed this hybrid feature from
pci_request_region(). When doing so,pata_maciowas forgotten to be ported to usepcim_request_all_regions(). If that function is not used,pata_maciowill fail on driver-reload because the PCI regions will remain blocked.Fix the region leak by replacing
pci_request_regions()with its managed
counterpart,pcim_request_all_regions().
Quoted 5 lines
Quoted 3 lines
Fixes 51f6aec99cb0 ("PCI: Remove hybrid devres nature from requestfunctions")
Signed-off-by Philipp Stanner <[email protected]>Forgot Damien's Reviewed-by.
Then put it here, if maintainers use b4, it will automatically harvest them.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 10 lines · Philipp Stanner
pci_request_regions()became a managed devres functions if the PCI device was enabled withpcim_enable_device(), which is the case forpata_macio.The PCI subsystem recently removed this hybrid feature from
pci_request_region(). When doing so,pata_maciowas forgotten to be ported to usepcim_request_all_regions(). If that function is not used,pata_maciowill fail on driver-reload because the PCI regions will remain blocked.
Quoted 6 lines
Fix the region leak by replacing
pci_request_regions()with its managed counterpart,pcim_request_all_regions().Fixes 51f6aec99cb0 ("PCI: Remove hybrid devres nature from request functions")Signed-off-by Philipp Stanner <[email protected]>---
Quoted 20 lines
Changes in v2:
- Add Fixes: tag and rephrase commit message, since the merge window closed already. (Niklas)--- drivers/ata/pata_macio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/ata/pata_macio.c +1
-1@@ -1298,7 +1298,7 @@ static int pata_macio_pci_attach(struct pci_dev *pdev, priv->dev = &pdev->dev;/* Get MMIO regions */ -if (pci_request_regions (pdev,"pata-macio" )) { +if (pcim_request_all_regions (pdev,"pata-macio" )) {dev_err (&pdev->dev,"Cannot obtain PCI resources\n" );return -EBUSY ;
Signature · 2 lines
Sathyanarayanan Kuppuswamy Linux Kernel Developer
Quoted 11 lines · Philipp Stanner
pci_request_regions()became a managed devres functions if the PCI device was enabled withpcim_enable_device(), which is the case forpata_macio.The PCI subsystem recently removed this hybrid feature from
pci_request_region(). When doing so,pata_maciowas forgotten to be ported to usepcim_request_all_regions(). If that function is not used,pata_maciowill fail on driver-reload because the PCI regions will remain blocked.[...]
Applied to libata/linux.git (for-6.16-fixes), thanks!
[1/1] ata: pata_macio: Fix PCI region leak
https://git.kernel.org/libata/linux/c/3e537877
Kind regards,
Niklas