From: Honghui Zhang <honghui.zhang@mediatek.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: youlin.pei@mediatek.com, devicetree <devicetree@vger.kernel.org>,
hongkun.cao@mediatek.com,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Marc Zyngier <marc.zyngier@arm.com>,
linux-pci@vger.kernel.org, sean.wang@mediatek.com,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
YT Shen <yt.shen@mediatek.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
ryder.lee@mediatek.com,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@lists.infradead.org>,
yong.wu@mediatek.com, Bjorn Helgaas <bhelgaas@google.com>,
yingjoe.chen@mediatek.com, Eddie Huang <eddie.huang@mediatek.com>,
linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 4/4] PCI: mediatek: Add loadable kernel module support
Date: Thu, 28 Jun 2018 09:17:32 +0800 [thread overview]
Message-ID: <1530148652.28284.4.camel@mhfsdcap03> (raw)
In-Reply-To: <CAHp75VdsSZifb5xZ2Q8cmJV=PgAaoN=iOhMfyVX4uE4vNpo=Mg@mail.gmail.com>
On Wed, 2018-06-27 at 19:39 +0300, Andy Shevchenko wrote:
> On Wed, Jun 27, 2018 at 12:21 PM, <honghui.zhang@mediatek.com> wrote:
> > From: Honghui Zhang <honghui.zhang@mediatek.com>
> >
> > Implement remove callback function for Mediatek PCIe driver to add
> > loadable kernel module support.
>
> > +static void mtk_pcie_irq_teardown(struct mtk_pcie *pcie)
> > +{
> > + struct mtk_pcie_port *port, *tmp;
> > +
>
> > + if (list_empty(&pcie->ports))
> > + return;
>
> This is redundant.
Yeah, you are right, I will remove it.
>
> > +
> > + list_for_each_entry_safe(port, tmp, &pcie->ports, list) {
> > + irq_set_chained_handler_and_data(port->irq, NULL, NULL);
> > +
> > + if (port->irq_domain)
> > + irq_domain_remove(port->irq_domain);
> > +
> > + if (IS_ENABLED(CONFIG_PCI_MSI)) {
> > + if (port->msi_domain)
> > + irq_domain_remove(port->msi_domain);
> > + if (port->inner_domain)
> > + irq_domain_remove(port->inner_domain);
> > + }
> > +
> > + irq_dispose_mapping(port->irq);
> > + }
> > +}
>
> > +static void mtk_pcie_free_resources(struct mtk_pcie *pcie)
> > +{
> > + struct pci_host_bridge *host = pci_host_bridge_from_priv(pcie);
> > + struct list_head *windows = &host->windows;
> > +
> > + pci_unmap_iospace(&pcie->pio);
> > + pci_free_resource_list(windows);
> > +}
> > +
> > +static int mtk_pcie_remove(struct platform_device *pdev)
> > +{
> > + struct mtk_pcie *pcie = platform_get_drvdata(pdev);
> > + struct pci_host_bridge *host = pci_host_bridge_from_priv(pcie);
> > +
> > + pci_stop_root_bus(host->bus);
> > + pci_remove_root_bus(host->bus);
> > + mtk_pcie_free_resources(pcie);
> > +
> > + mtk_pcie_irq_teardown(pcie);
> > +
>
> > + if (!list_empty(&pcie->ports))
>
> I think this is also not needed. Do you put runtime PM by the way?
Yes, it's could be removed.
the pm was putted in mtk_pcie_put_resources which will call
mtk_pcie_subsys_powerdown, and the pm was putted in that function.
thanks.
>
> > + mtk_pcie_put_resources(pcie);
> > +
> > + return 0;
> > +}
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2018-06-28 1:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-27 9:21 [PATCH 0/4] PCI: mediatek: fixup find_port, enable_msi and add pm, module support honghui.zhang
2018-06-27 9:21 ` [PATCH 1/4] PCI: mediatek: fixup mtk_pcie_find_port logical honghui.zhang
2018-06-27 16:35 ` Andy Shevchenko
2018-06-28 1:12 ` Honghui Zhang
2018-06-28 13:07 ` Bjorn Helgaas
2018-06-29 7:51 ` Honghui Zhang
2018-06-27 9:21 ` [PATCH 2/4] PCI: mediatek: enable msi after clock enabled honghui.zhang
2018-06-27 9:21 ` [PATCH 3/4] PCI: mediatek: Add system pm support for MT2712 and MT7622 honghui.zhang
2018-06-27 16:45 ` Andy Shevchenko
2018-06-28 1:44 ` Honghui Zhang
2018-06-27 9:21 ` [PATCH 4/4] PCI: mediatek: Add loadable kernel module support honghui.zhang
2018-06-27 16:39 ` Andy Shevchenko
2018-06-28 1:17 ` Honghui Zhang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1530148652.28284.4.camel@mhfsdcap03 \
--to=honghui.zhang@mediatek.com \
--cc=andy.shevchenko@gmail.com \
--cc=bhelgaas@google.com \
--cc=devicetree@vger.kernel.org \
--cc=eddie.huang@mediatek.com \
--cc=hongkun.cao@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=marc.zyngier@arm.com \
--cc=matthias.bgg@gmail.com \
--cc=ryder.lee@mediatek.com \
--cc=sean.wang@mediatek.com \
--cc=yingjoe.chen@mediatek.com \
--cc=yong.wu@mediatek.com \
--cc=youlin.pei@mediatek.com \
--cc=yt.shen@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).