Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1675443 > unrolled thread
| Started by | Ryder Lee <ryder.lee@mediatek.com> |
|---|---|
| First post | 2017-06-27 11:30 +0200 |
| Last post | 2017-06-28 03:30 +0200 |
| Articles | 4 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH] PCI: mediatek: change to use the new host bridge interface Ryder Lee <ryder.lee@mediatek.com> - 2017-06-27 11:30 +0200
Re: [PATCH] PCI: mediatek: change to use the new host bridge interface Bjorn Helgaas <helgaas@kernel.org> - 2017-06-28 00:40 +0200
Re: [PATCH] PCI: mediatek: change to use the new host bridge interface Bjorn Helgaas <helgaas@kernel.org> - 2017-06-28 01:30 +0200
Re: [PATCH] PCI: mediatek: change to use the new host bridge interface Ryder Lee <ryder.lee@mediatek.com> - 2017-06-28 03:30 +0200
| From | Ryder Lee <ryder.lee@mediatek.com> |
|---|---|
| Date | 2017-06-27 11:30 +0200 |
| Subject | [PATCH] PCI: mediatek: change to use the new host bridge interface |
| Message-ID | <tWUYN-6V2-11@gated-at.bofh.it> |
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. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> --- drivers/pci/host/pcie-mediatek.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pci/host/pcie-mediatek.c b/drivers/pci/host/pcie-mediatek.c index 3baafa8..514ef34 100644 --- a/drivers/pci/host/pcie-mediatek.c +++ b/drivers/pci/host/pcie-mediatek.c @@ -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; -- 1.9.1
[toc] | [next] | [standalone]
| From | Bjorn Helgaas <helgaas@kernel.org> |
|---|---|
| Date | 2017-06-28 00:40 +0200 |
| Subject | Re: [PATCH] PCI: mediatek: change to use the new host bridge interface |
| Message-ID | <tX7jl-6UY-31@gated-at.bofh.it> |
| In reply to | #1675443 |
On Tue, Jun 27, 2017 at 05:24:11PM +0800, Ryder Lee wrote: > 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. > > Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> 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. > --- > drivers/pci/host/pcie-mediatek.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/pci/host/pcie-mediatek.c b/drivers/pci/host/pcie-mediatek.c > index 3baafa8..514ef34 100644 > --- a/drivers/pci/host/pcie-mediatek.c > +++ b/drivers/pci/host/pcie-mediatek.c > @@ -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; > > -- > 1.9.1 >
[toc] | [prev] | [next] | [standalone]
| From | Bjorn Helgaas <helgaas@kernel.org> |
|---|---|
| Date | 2017-06-28 01:30 +0200 |
| Subject | Re: [PATCH] PCI: mediatek: change to use the new host bridge interface |
| Message-ID | <tX85H-7qz-3@gated-at.bofh.it> |
| In reply to | #1676225 |
On Tue, Jun 27, 2017 at 05:30:40PM -0500, Bjorn Helgaas wrote: > On Tue, Jun 27, 2017 at 05:24:11PM +0800, Ryder Lee wrote: > > 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. > > > > Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> > > 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? Sorry, that's wrong; I see your controller powerup stuff in patchwork, and that's *not* included yet.
[toc] | [prev] | [next] | [standalone]
| From | Ryder Lee <ryder.lee@mediatek.com> |
|---|---|
| Date | 2017-06-28 03:30 +0200 |
| Subject | Re: [PATCH] PCI: mediatek: change to use the new host bridge interface |
| Message-ID | <tX9XP-bC-9@gated-at.bofh.it> |
| In reply to | #1676259 |
On Tue, 2017-06-27 at 18:20 -0500, Bjorn Helgaas wrote: > On Tue, Jun 27, 2017 at 05:30:40PM -0500, Bjorn Helgaas wrote: > > On Tue, Jun 27, 2017 at 05:24:11PM +0800, Ryder Lee wrote: > > > 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. > > > > > > Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> > > > > 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? > > 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
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web