Skip to contentSkip to conversation

bus: mhi: host: pci_generic: Remove assign resource usage

PATCH Applied Subramanian Ananthanarayanan 3 participants 3 messages Apr 16, 2025 – Apr 24, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bus: mhi: host: pci_generic: Remove assign resource usage

Avoid redundant usage of pci_assign_resource for BAR allocation. This is already taken care by PCIe framework. Invocation of this API leads to unnecessary relocation of BAR space to a new memory address.

---
 drivers/bus/mhi/host/pci_generic.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/bus/mhi/host/pci_generic.c +0 -4
index 03aa88795209..7501abc835c7 100644
@@ -996,10 +996,6 @@ static int mhi_pci_claim(struct mhi_controller *mhi_cntrl,
 	struct pci_dev *pdev = to_pci_dev(mhi_cntrl->cntrl_dev);
 	int err;
 
-	err = pci_assign_resource(pdev, bar_num);
-	if (err)
-		return err;
-
 	err = pcim_enable_device(pdev);
 	if (err) {
 		dev_err(&pdev->dev, "failed to enable pci device: %d\n", err);

---
base-commit: 5b37f7bfff3b1582c34be8fb23968b226db71ebd
change-id: 20250416-remove_assin_resource-aa0db88d02eb

Best regards,

Signature · 1 line
Subramanian Ananthanarayanan <[email protected]>
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Subramanian Ananthanarayanan

Avoid redundant usage of pci_assign_resource for BAR allocation. This is already taken care by PCIe framework. Invocation of this API leads to unnecessary relocation of BAR space to a new memory address.

Quoted 25 lines
---
  drivers/bus/mhi/host/pci_generic.c | 4 ----
  1 file changed, 4 deletions(-)
drivers/bus/mhi/host/pci_generic.c +0 -5
index 03aa88795209..7501abc835c7 100644
@@ -996,10 +996,6 @@ static int mhi_pci_claim(struct mhi_controller *mhi_cntrl,
  	struct pci_dev *pdev = to_pci_dev(mhi_cntrl->cntrl_dev);
  	int err;
 
-	err = pci_assign_resource(pdev, bar_num);
-	if (err)
-		return err;
-
  	err = pcim_enable_device(pdev);
  	if (err) {
  		dev_err(&pdev->dev, "failed to enable pci device: %d\n", err);
 
---

base-commit: 5b37f7bfff3b1582c34be8fb23968b226db71ebd
change-id: 20250416-remove_assin_resource-aa0db88d02eb

Best regards,

#2 lore raw
In reply to Subramanian Ananthanarayanan
Quoted 6 lines · Subramanian Ananthanarayanan

Avoid redundant usage of pci_assign_resource for BAR allocation. This is already taken care by PCIe framework. Invocation of this API leads to unnecessary relocation of BAR space to a new memory address.

Applied to mhi-next!

- Mani

Quoted 28 lines
---
 drivers/bus/mhi/host/pci_generic.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/bus/mhi/host/pci_generic.c +0 -5
index 03aa88795209..7501abc835c7 100644
@@ -996,10 +996,6 @@ static int mhi_pci_claim(struct mhi_controller *mhi_cntrl,
 	struct pci_dev *pdev = to_pci_dev(mhi_cntrl->cntrl_dev);
 	int err;
 
-	err = pci_assign_resource(pdev, bar_num);
-	if (err)
-		return err;
-
 	err = pcim_enable_device(pdev);
 	if (err) {
 		dev_err(&pdev->dev, "failed to enable pci device: %d\n", err);
 
---

base-commit: 5b37f7bfff3b1582c34be8fb23968b226db71ebd
change-id: 20250416-remove_assin_resource-aa0db88d02eb

Best regards,

Signature · 1 line
Subramanian Ananthanarayanan <[email protected]>
Signature · 1 line
மணிவண்ணன் சதாசிவம்