From: Bjorn Helgaas <helgaas@kernel.org> To: Lucas Stach <l.stach@pengutronix.de> Cc: Gabriele Paoloni <gabriele.paoloni@huawei.com>, linux-pci@vger.kernel.org, Binghui Wang <wangbinghui@hisilicon.com>, Roy Zang <tie-fei.zang@freescale.com>, Kishon Vijay Abraham I <kishon@ti.com>, Jesper Nilsson <jesper.nilsson@axis.com>, Joao Pinto <Joao.Pinto@synopsys.com>, Pratyush Anand <pratyush.anand@gmail.com>, Krzysztof Kozlowski <krzk@kernel.org>, patchwork-lst@pengutronix.de, Kukjin Kim <kgene@kernel.org>, Niklas Cassel <niklas.cassel@axis.com>, Richard Zhu <hongxing.zhu@nxp.com>, Tim Harvey <tharvey@gateworks.com>, Xiaowei Song <songxiaowei@hisilicon.com>, Murali Karicheri <m-karicheri2@ti.com>, Bjorn Helgaas <bhelgaas@google.com>, Mingkai Hu <mingkai.hu@freescale.com>, linux-arm-kernel@lists.infradead.org, Thomas Petazzoni <thomas.petazzoni@free-electrons.com>, Jingoo Han <jingoohan1@gmail.com>, Stanimir Varbanov <svarbanov@mm-sol.com>, Minghuan Lian <minghuan.Lian@freescale.com>, Zhou Wang <wangzhou1@hisilicon.com>, kernel@pengutronix.de, Shawn Guo <shawnguo@kernel.org> Subject: Re: [PATCH 1/3] PCI: designware: only register MSI controller when MSI irq line is valid Date: Thu, 31 Aug 2017 11:58:17 -0500 [thread overview] Message-ID: <20170831165817.GD18250@bhelgaas-glaptop.roam.corp.google.com> (raw) In-Reply-To: <20170828142307.30061-2-l.stach@pengutronix.de> [+cc Kishon, Thomas, Niklas, Jesper, Zhou, Gabriele, Xiaowei, Binghui, Stanimir, Pratyush, Kukjin, Krzysztof, Richard, Murali, Minghuan, Mingkai, Roy] Sorry about the unwieldy cc list. It seems like this affects every DesignWare-based driver. On Mon, Aug 28, 2017 at 04:23:05PM +0200, Lucas Stach wrote: > The MSI part of the controller isn't essential, so the host controller can > be registered without the MSI controller being present. This allows the > host to work in PCIe legancy interrupt only mode, if the IRQ line for the s/legancy/legacy/ > MSI controller is missing. > > Signed-off-by: Lucas Stach <l.stach@pengutronix.de> > --- > drivers/pci/dwc/pcie-designware-host.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/dwc/pcie-designware-host.c b/drivers/pci/dwc/pcie-designware-host.c > index d29c020da082..8494089f088d 100644 > --- a/drivers/pci/dwc/pcie-designware-host.c > +++ b/drivers/pci/dwc/pcie-designware-host.c > @@ -381,7 +381,7 @@ int dw_pcie_host_init(struct pcie_port *pp) > if (ret) > pci->num_viewport = 2; > > - if (IS_ENABLED(CONFIG_PCI_MSI)) { > + if (IS_ENABLED(CONFIG_PCI_MSI) && pp->msi_irq > 0) { > if (!pp->ops->msi_host_init) { > pp->irq_domain = irq_domain_add_linear(dev->of_node, > MAX_MSI_IRQS, &msi_domain_ops, > @@ -412,7 +412,7 @@ int dw_pcie_host_init(struct pcie_port *pp) > bridge->ops = &dw_pcie_ops; > bridge->map_irq = of_irq_parse_and_map_pci; > bridge->swizzle_irq = pci_common_swizzle; > - if (IS_ENABLED(CONFIG_PCI_MSI)) { > + if (IS_ENABLED(CONFIG_PCI_MSI) && pp->msi_irq > 0) { > bridge->msi = &dw_pcie_msi_chip; > dw_pcie_msi_chip.dev = dev; > } Here are the callers of dw_pcie_host_init(): armada8k_add_pcie_port artpec6_add_pcie_port # sets pp->msi_irq dra7xx_add_pcie_port dw_plat_add_pcie_port # sets pp->msi_irq exynos_add_pcie_port # sets pp->msi_irq hisi_add_pcie_port imx6_add_pcie_port # sets pp->msi_irq kirin_add_pcie_port ks_dw_pcie_host_init # sets pp->ops->msi_host_init ls_add_pcie_port # sets pp->ops->msi_host_init qcom_pcie_probe # sets pp->msi_irq spear13xx_add_pcie_port For the drivers that set pp->msi_irq (artpec6, dw_plat, exynos, imx6, qcom), it seems like you'd want a similar follow-up change for all of them to make the MSI IRQ optional, but you only changed imx6. What about the others? For the drivers that don't set pp->msi_irq and don't set pp->ops->msi_host_init (armada8k, dra7xx, hisi, kirin, spear13xx), this patch means they no longer set up pp->irq_domain. Do you intend that? Incidental observations not strictly related to this series: - It looks like exynos_add_pcie_port() incorrectly assumes platform_get_irq() returns zero on failure (twice). - It'd be nice if qcom_pcie_probe() followed the same add_pcie_port() structure as the other drivers. Bjorn _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: helgaas@kernel.org (Bjorn Helgaas) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/3] PCI: designware: only register MSI controller when MSI irq line is valid Date: Thu, 31 Aug 2017 11:58:17 -0500 [thread overview] Message-ID: <20170831165817.GD18250@bhelgaas-glaptop.roam.corp.google.com> (raw) In-Reply-To: <20170828142307.30061-2-l.stach@pengutronix.de> [+cc Kishon, Thomas, Niklas, Jesper, Zhou, Gabriele, Xiaowei, Binghui, Stanimir, Pratyush, Kukjin, Krzysztof, Richard, Murali, Minghuan, Mingkai, Roy] Sorry about the unwieldy cc list. It seems like this affects every DesignWare-based driver. On Mon, Aug 28, 2017 at 04:23:05PM +0200, Lucas Stach wrote: > The MSI part of the controller isn't essential, so the host controller can > be registered without the MSI controller being present. This allows the > host to work in PCIe legancy interrupt only mode, if the IRQ line for the s/legancy/legacy/ > MSI controller is missing. > > Signed-off-by: Lucas Stach <l.stach@pengutronix.de> > --- > drivers/pci/dwc/pcie-designware-host.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/dwc/pcie-designware-host.c b/drivers/pci/dwc/pcie-designware-host.c > index d29c020da082..8494089f088d 100644 > --- a/drivers/pci/dwc/pcie-designware-host.c > +++ b/drivers/pci/dwc/pcie-designware-host.c > @@ -381,7 +381,7 @@ int dw_pcie_host_init(struct pcie_port *pp) > if (ret) > pci->num_viewport = 2; > > - if (IS_ENABLED(CONFIG_PCI_MSI)) { > + if (IS_ENABLED(CONFIG_PCI_MSI) && pp->msi_irq > 0) { > if (!pp->ops->msi_host_init) { > pp->irq_domain = irq_domain_add_linear(dev->of_node, > MAX_MSI_IRQS, &msi_domain_ops, > @@ -412,7 +412,7 @@ int dw_pcie_host_init(struct pcie_port *pp) > bridge->ops = &dw_pcie_ops; > bridge->map_irq = of_irq_parse_and_map_pci; > bridge->swizzle_irq = pci_common_swizzle; > - if (IS_ENABLED(CONFIG_PCI_MSI)) { > + if (IS_ENABLED(CONFIG_PCI_MSI) && pp->msi_irq > 0) { > bridge->msi = &dw_pcie_msi_chip; > dw_pcie_msi_chip.dev = dev; > } Here are the callers of dw_pcie_host_init(): armada8k_add_pcie_port artpec6_add_pcie_port # sets pp->msi_irq dra7xx_add_pcie_port dw_plat_add_pcie_port # sets pp->msi_irq exynos_add_pcie_port # sets pp->msi_irq hisi_add_pcie_port imx6_add_pcie_port # sets pp->msi_irq kirin_add_pcie_port ks_dw_pcie_host_init # sets pp->ops->msi_host_init ls_add_pcie_port # sets pp->ops->msi_host_init qcom_pcie_probe # sets pp->msi_irq spear13xx_add_pcie_port For the drivers that set pp->msi_irq (artpec6, dw_plat, exynos, imx6, qcom), it seems like you'd want a similar follow-up change for all of them to make the MSI IRQ optional, but you only changed imx6. What about the others? For the drivers that don't set pp->msi_irq and don't set pp->ops->msi_host_init (armada8k, dra7xx, hisi, kirin, spear13xx), this patch means they no longer set up pp->irq_domain. Do you intend that? Incidental observations not strictly related to this series: - It looks like exynos_add_pcie_port() incorrectly assumes platform_get_irq() returns zero on failure (twice). - It'd be nice if qcom_pcie_probe() followed the same add_pcie_port() structure as the other drivers. Bjorn
next prev parent reply other threads:[~2017-08-31 16:58 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-08-28 14:23 [PATCH 0/3] DWC host without MSI controller Lucas Stach 2017-08-28 14:23 ` Lucas Stach 2017-08-28 14:23 ` [PATCH 1/3] PCI: designware: only register MSI controller when MSI irq line is valid Lucas Stach 2017-08-28 14:23 ` Lucas Stach 2017-08-31 16:58 ` Bjorn Helgaas [this message] 2017-08-31 16:58 ` Bjorn Helgaas 2017-08-31 17:32 ` Fabio Estevam 2017-08-31 17:32 ` Fabio Estevam 2017-09-25 23:54 ` Bjorn Helgaas 2017-09-25 23:54 ` Bjorn Helgaas 2017-08-28 14:23 ` [PATCH 2/3] PCI: imx6: allow MSI irq to be absent Lucas Stach 2017-08-28 14:23 ` Lucas Stach 2017-08-28 14:23 ` [PATCH 3/3] ARM: dts: imx6qdl: remove MSI irq line Lucas Stach 2017-08-28 14:23 ` Lucas Stach 2017-08-28 16:59 ` [PATCH 0/3] DWC host without MSI controller Tim Harvey 2017-08-28 16:59 ` Tim Harvey 2017-10-09 12:14 ` Fabio Estevam 2017-10-09 12:14 ` Fabio Estevam 2017-10-09 12:22 ` Lucas Stach 2017-10-09 12:22 ` Lucas Stach
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=20170831165817.GD18250@bhelgaas-glaptop.roam.corp.google.com \ --to=helgaas@kernel.org \ --cc=Joao.Pinto@synopsys.com \ --cc=bhelgaas@google.com \ --cc=gabriele.paoloni@huawei.com \ --cc=hongxing.zhu@nxp.com \ --cc=jesper.nilsson@axis.com \ --cc=jingoohan1@gmail.com \ --cc=kernel@pengutronix.de \ --cc=kgene@kernel.org \ --cc=kishon@ti.com \ --cc=krzk@kernel.org \ --cc=l.stach@pengutronix.de \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-pci@vger.kernel.org \ --cc=m-karicheri2@ti.com \ --cc=minghuan.Lian@freescale.com \ --cc=mingkai.hu@freescale.com \ --cc=niklas.cassel@axis.com \ --cc=patchwork-lst@pengutronix.de \ --cc=pratyush.anand@gmail.com \ --cc=shawnguo@kernel.org \ --cc=songxiaowei@hisilicon.com \ --cc=svarbanov@mm-sol.com \ --cc=tharvey@gateworks.com \ --cc=thomas.petazzoni@free-electrons.com \ --cc=tie-fei.zang@freescale.com \ --cc=wangbinghui@hisilicon.com \ --cc=wangzhou1@hisilicon.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.