Skip to contentSkip to conversation

critical patch to fix pci-tree build bot failure

PATCH RESEND In review Ryder Lee 4 participants 10 messages Jun 27, 2017 – Jun 28, 2017 PCI

lore
Share & tools
lore

Ryder Lee

author
#0 lore raw

PATCH RESEND 1/1 critical patch to fix pci-tree build bot failure

Hi Stephen and Andrew,

Could you help to apply this patch? Seems Bjorn didn't response it these days.

This patch(based on pci-next tree) will fix the following build bot failure:

Quoted 10 lines
Quoted 10 lines · Build bot for Mark Brown

This build failure is still present in -next:

Quoted 4 lines

arm-allmodconfig
../drivers/pci/host/pcie-mediatek.c:485:8: error: implicit declaration of function 'pci_register_host_bridge' [-Werror=implicit-function-declaration]

and we're at -rc7 now.

This is because pci/host-mediatek is a seperate branch in pci-tree, but merge together without proper modifications(eg. some API changes).

Hi Bjorn,
I rewrote commit message. Please ignore my previous one, sorry for inconvenience.

Thanks a lot!

Ryder Lee (1):
PCI: mediatek: change to use the new host bridge interface

 drivers/pci/host/pcie-mediatek.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/1 PCI: mediatek: change to use the new host bridge interface

With the introduction of pci_scan_root_bus_bridge() there is no need to export pci_register_host_bridge() to other kernel subsystems other than the PCI compilation unit that needs it.

Make pci_register_host_bridge() static to its compilation unit and convert the existing drivers usage over to pci_scan_root_bus_bridge().

Also, when probing the PCI host controller driver, if an error occurs, the probe function code does not free memory allocated for the struct pci_host_bridge resulting in memory leakage.

This patch fixes them by using the methods that introduces by Lorenzo.

---
 drivers/pci/host/pcie-mediatek.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/pci/host/pcie-mediatek.c +2 -4
index 3baafa8..514ef34 100644
@@ -482,12 +482,10 @@ static int mtk_pcie_register_host(struct pci_host_bridge *host)
 	host->dev.parent = pcie->dev;
 	host->ops = &mtk_pcie_ops;
 
-	err = pci_register_host_bridge(host);
+	err = pci_scan_root_bus_bridge(host);
 	if (err < 0)
 		return err;
 
-	pci_scan_child_bus(host->bus);
-
 	pci_fixup_irqs(pci_common_swizzle, of_irq_parse_and_map_pci);
 	pci_bus_size_bridges(host->bus);
 	pci_bus_assign_resources(host->bus);
@@ -506,7 +504,7 @@ static int mtk_pcie_probe(struct platform_device *pdev)
 	struct pci_host_bridge *host;
 	int err;
 
-	host = pci_alloc_host_bridge(sizeof(*pcie));
+	host = devm_pci_alloc_host_bridge(&pdev->dev, sizeof(*pcie));
 	if (!host)
 		return -ENOMEM;
 
Signature · 1 line
1.9.1
#5 lore raw
In reply to Ryder Lee
Quoted 3 lines · Ryder Lee

Hi Stephen and Andrew,

Could you help to apply this patch? Seems Bjorn didn't response it these days.

I'm not dead, but I was on vacation most of last week. I'll resolve this today.

Quoted 28 lines

This patch(based on pci-next tree) will fix the following build bot failure:

Quoted 10 lines
Quoted 10 lines · Build bot for Mark Brown

This build failure is still present in -next:

Quoted 4 lines

arm-allmodconfig
../drivers/pci/host/pcie-mediatek.c:485:8: error: implicit declaration of function 'pci_register_host_bridge' [-Werror=implicit-function-declaration]

and we're at -rc7 now.

This is because pci/host-mediatek is a seperate branch in pci-tree, but merge together without proper modifications(eg. some API changes).

Hi Bjorn,
I rewrote commit message. Please ignore my previous one, sorry for inconvenience.

Thanks a lot!

Ryder Lee (1):
PCI: mediatek: change to use the new host bridge interface

 drivers/pci/host/pcie-mediatek.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

--
1.9.1

#6 lore raw

Hi Bjorn,

Quoted 7 lines · On Tue, 27 Jun 2017 08:20:44 -0500 Bjorn Helgaas <[email protected]>…
Quoted 3 lines · Ryder Lee

Hi Stephen and Andrew,

Could you help to apply this patch? Seems Bjorn didn't response it these days.

I'm not dead, but I was on vacation most of last week. I'll resolve this today.

Should I just add this patch to linux-next today (if you don't get around to it in the next hour or so)?

Signature · 2 lines
Cheers,
Stephen Rothwell
#7 lore raw
Quoted 5 lines · Stephen Rothwell

Hi Bjorn,

Quoted 2 lines · On Tue, 27 Jun 2017 08:20:44 -0500 Bjorn Helgaas <[email protected]>…

On Tue, Jun 27, 2017 at 4:24 AM, Ryder Lee <[email protected]> wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Hi Stephen and Andrew,

Could you help to apply this patch? Seems Bjorn didn't response it these days.

I'm not dead, but I was on vacation most of last week. I'll resolve this today.

Should I just add this patch to linux-next today (if you don't get around to it in the next hour or so)?

Sure, I think that would be OK. Thanks!

#2 lore raw

Re: [PATCH] PCI: mediatek: change to use the new host bridge interface

In reply to Ryder Lee
Quoted 7 lines · Ryder Lee

With the introduction of pci_scan_root_bus_bridge() there is no need to export pci_register_host_bridge() to other kernel subsystems other than the PCI compilation unit that needs it.

Make pci_register_host_bridge() static to its compilation unit and convert the existing drivers usage over to pci_scan_root_bus_bridge().

Quoted 7 lines

Also, when probing the PCI host controller driver, if an error occurs, the probe function code does not free memory allocated for the struct pci_host_bridge resulting in memory leakage.

This patch fixes them by using the methods that introduces by Lorenzo.

I rebased my pci/host-mediatek branch on top of pci/enumeration (which contains the series from Lorenzo), and folded this into the initial MediaTek driver commit.

This branch:

https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?h=pci/host-mediatek&id=b6ca15d18881b784dc9efc5d81989be26ecd9fc8

should have all the MediaTek bits I know about. Can you double-check it, please?

If all goes well, I'll incorporate this into -next tomorrow.

Quoted 34 lines
---
 drivers/pci/host/pcie-mediatek.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/pci/host/pcie-mediatek.c +2 -4
index 3baafa8..514ef34 100644
@@ -482,12 +482,10 @@ static int mtk_pcie_register_host(struct pci_host_bridge *host)
 	host->dev.parent = pcie->dev;
 	host->ops = &mtk_pcie_ops;
 
-	err = pci_register_host_bridge(host);
+	err = pci_scan_root_bus_bridge(host);
 	if (err < 0)
 		return err;
 
-	pci_scan_child_bus(host->bus);
-
 	pci_fixup_irqs(pci_common_swizzle, of_irq_parse_and_map_pci);
 	pci_bus_size_bridges(host->bus);
 	pci_bus_assign_resources(host->bus);
@@ -506,7 +504,7 @@ static int mtk_pcie_probe(struct platform_device *pdev)
 	struct pci_host_bridge *host;
 	int err;
 
-	host = pci_alloc_host_bridge(sizeof(*pcie));
+	host = devm_pci_alloc_host_bridge(&pdev->dev, sizeof(*pcie));
 	if (!host)
 		return -ENOMEM;
 
Signature · 1 line
1.9.1
#3 lore raw

Re: [PATCH] PCI: mediatek: change to use the new host bridge interface

Quoted 20 lines · Bjorn Helgaas
Quoted 7 lines · Ryder Lee

With the introduction of pci_scan_root_bus_bridge() there is no need to export pci_register_host_bridge() to other kernel subsystems other than the PCI compilation unit that needs it.

Make pci_register_host_bridge() static to its compilation unit and convert the existing drivers usage over to pci_scan_root_bus_bridge().

Quoted 7 lines

Also, when probing the PCI host controller driver, if an error occurs, the probe function code does not free memory allocated for the struct pci_host_bridge resulting in memory leakage.

This patch fixes them by using the methods that introduces by Lorenzo.

I rebased my pci/host-mediatek branch on top of pci/enumeration (which contains the series from Lorenzo), and folded this into the initial MediaTek driver commit.

Quoted 6 lines

This branch:

https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?h=pci/host-mediatek&id=b6ca15d18881b784dc9efc5d81989be26ecd9fc8

should have all the MediaTek bits I know about. Can you double-check it, please?

Sorry, that's wrong; I see your controller powerup stuff in patchwork, and that's *not* included yet.

author
#4 lore raw

Re: [PATCH] PCI: mediatek: change to use the new host bridge interface

Quoted 23 lines · Bjorn Helgaas
Quoted 22 lines · Bjorn Helgaas
Quoted 7 lines · Ryder Lee

With the introduction of pci_scan_root_bus_bridge() there is no need to export pci_register_host_bridge() to other kernel subsystems other than the PCI compilation unit that needs it.

Make pci_register_host_bridge() static to its compilation unit and convert the existing drivers usage over to pci_scan_root_bus_bridge().

Quoted 7 lines

Also, when probing the PCI host controller driver, if an error occurs, the probe function code does not free memory allocated for the struct pci_host_bridge resulting in memory leakage.

This patch fixes them by using the methods that introduces by Lorenzo.

I rebased my pci/host-mediatek branch on top of pci/enumeration (which contains the series from Lorenzo), and folded this into the initial MediaTek driver commit.

This branch:

Quoted 7 lines
Quoted 4 lines

https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?h=pci/host-mediatek&id=b6ca15d18881b784dc9efc5d81989be26ecd9fc8

should have all the MediaTek bits I know about. Can you double-check it, please?

Sorry, that's wrong; I see your controller powerup stuff in patchwork, and that's *not* included yet.

Yes, that should be folded into the initial commit if possible. Thanks for your help!

Ryder

#8 lore raw
In reply to Stephen Rothwell
Quoted 5 lines · Stephen Rothwell

Hi Bjorn,

Quoted 2 lines · On Tue, 27 Jun 2017 08:20:44 -0500 Bjorn Helgaas <[email protected]>…

On Tue, Jun 27, 2017 at 4:24 AM, Ryder Lee <[email protected]> wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Hi Stephen and Andrew,

Could you help to apply this patch? Seems Bjorn didn't response it these days.

I'm not dead, but I was on vacation most of last week. I'll resolve this today.

Should I just add this patch to linux-next today (if you don't get around to it in the next hour or so)?

Just FYI, this should be fixed in my -next branch now, so you shouldn't need to add the patch yourself, Stephen.

#9 lore raw

Hi Bjorn,

Quoted 11 lines · On Wed, 28 Jun 2017 15:43:17 -0500 Bjorn Helgaas <[email protected]> wrote:
Quoted 9 lines · Stephen Rothwell

Hi Bjorn,

Quoted 6 lines · On Tue, 27 Jun 2017 08:20:44 -0500 Bjorn Helgaas <[email protected]>…
Quoted 3 lines · Ryder Lee

Hi Stephen and Andrew,

Could you help to apply this patch? Seems Bjorn didn't response it these days.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

I'm not dead, but I was on vacation most of last week. I'll resolve this today.

Should I just add this patch to linux-next today (if you don't get around to it in the next hour or so)?

Just FYI, this should be fixed in my -next branch now, so you shouldn't need to add the patch yourself, Stephen.

Excellent, thanks.

Signature · 2 lines
Cheers,
Stephen Rothwell