From: Bjorn Helgaas <helgaas@kernel.org> To: Marc Zyngier <marc.zyngier@arm.com> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>, Bjorn Helgaas <bhelgaas@google.com>, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring <robh+dt@kernel.org>, Ian Campbell <ijc+devicetree@hellion.org.uk>, Pawel Moll <pawel.moll@arm.com>, Mark Rutland <mark.rutland@arm.com>, Kumar Gala <galak@codeaurora.org>, Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>, Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>, Gregory Clement <gregory.clement@free-electrons.com>, linux-arm-kernel@lists.infradead.org, Nadav Haklai <nadavh@marvell.com>, Shadi Ammouri <shadi@marvell.com>, Marcin Wojtas <mw@semihalf.com>, Victor Gu <xigu@marvell.com> Subject: Re: [PATCH 1/3] pci: pci-aardvark: move to MSI handling using generic MSI support Date: Tue, 13 Sep 2016 11:07:06 -0500 [thread overview] Message-ID: <20160913160706.GC4138@localhost> (raw) In-Reply-To: <57C93B7F.8050909@arm.com> On Fri, Sep 02, 2016 at 09:42:39AM +0100, Marc Zyngier wrote: > Hi Thomas, > > I haven't checked things is details (mostly because the resulting diff > is impossible to read), but one thing caught my eye: I agree, it's too bad the diff is so hard to read. > On 01/09/16 16:38, Thomas Petazzoni wrote: > > The MSI support introduced with the initial Aardvark driver was based > > on the msi_controller structure and the of_pci_msi_chip_add() / > > of_pci_find_msi_chip_by_node() API, which are being deprecated in > > favor of the generic MSI support. > > > > Therefore, this commit updates the Aardvark driver to use the generic > > MSI support. > > > > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> > > --- > > drivers/pci/host/pci-aardvark.c | 172 ++++++++++++++++------------------------ > > 1 file changed, 67 insertions(+), 105 deletions(-) > > > > diff --git a/drivers/pci/host/pci-aardvark.c b/drivers/pci/host/pci-aardvark.c > > index ef9893f..0675cfa 100644 > > --- a/drivers/pci/host/pci-aardvark.c > > +++ b/drivers/pci/host/pci-aardvark.c > > [...] > > > -static int advk_pcie_setup_msi_irq(struct msi_controller *chip, > > - struct pci_dev *pdev, > > - struct msi_desc *desc) > > +static int advk_msi_irq_domain_alloc(struct irq_domain *domain, > > + unsigned int virq, > > + unsigned int nr_irqs, void *args) > > { > > - struct advk_pcie *pcie = pdev->bus->sysdata; > > - struct msi_msg msg; > > - int virq, hwirq; > > - phys_addr_t msi_msg_phys; > > - > > - /* We support MSI, but not MSI-X */ > > - if (desc->msi_attrib.is_msix) > > - return -EINVAL; > > You used not to support MSIX... > > [...] > > > @@ -677,30 +650,25 @@ static int advk_pcie_init_msi_irq_domain(struct advk_pcie *pcie) > > { > > struct device *dev = &pcie->pdev->dev; > > struct device_node *node = dev->of_node; > > - struct irq_chip *msi_irq_chip; > > - struct msi_controller *msi; > > + struct irq_chip *bottom_ic, *msi_ic; > > + struct msi_domain_info *msi_di; > > phys_addr_t msi_msg_phys; > > - int ret; > > - > > - msi_irq_chip = &pcie->msi_irq_chip; > > > > - msi_irq_chip->name = devm_kasprintf(dev, GFP_KERNEL, "%s-msi", > > - dev_name(dev)); > > - if (!msi_irq_chip->name) > > - return -ENOMEM; > > + mutex_init(&pcie->msi_used_lock); > > > > - msi_irq_chip->irq_enable = pci_msi_unmask_irq; > > - msi_irq_chip->irq_disable = pci_msi_mask_irq; > > - msi_irq_chip->irq_mask = pci_msi_mask_irq; > > - msi_irq_chip->irq_unmask = pci_msi_unmask_irq; > > + bottom_ic = &pcie->msi_bottom_irq_chip; > > > > - msi = &pcie->msi; > > + bottom_ic->name = "MSI"; > > + bottom_ic->irq_compose_msi_msg = advk_msi_irq_compose_msi_msg; > > + bottom_ic->irq_set_affinity = advk_msi_set_affinity; > > > > - msi->setup_irq = advk_pcie_setup_msi_irq; > > - msi->teardown_irq = advk_pcie_teardown_msi_irq; > > - msi->of_node = node; > > + msi_ic = &pcie->msi_irq_chip; > > + msi_ic->name = "advk-MSI"; > > > > - mutex_init(&pcie->msi_used_lock); > > + msi_di = &pcie->msi_domain_info; > > + msi_di->flags = MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS | > > + MSI_FLAG_PCI_MSIX; > > And yet you now advertize MSIX support. Was this an oversight in the > original code? If this is a fix, it'd be nice to have two patches: 1) make the fix 2) convert to new API
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: pci-aardvark: move to MSI handling using generic MSI support Date: Tue, 13 Sep 2016 11:07:06 -0500 [thread overview] Message-ID: <20160913160706.GC4138@localhost> (raw) In-Reply-To: <57C93B7F.8050909@arm.com> On Fri, Sep 02, 2016 at 09:42:39AM +0100, Marc Zyngier wrote: > Hi Thomas, > > I haven't checked things is details (mostly because the resulting diff > is impossible to read), but one thing caught my eye: I agree, it's too bad the diff is so hard to read. > On 01/09/16 16:38, Thomas Petazzoni wrote: > > The MSI support introduced with the initial Aardvark driver was based > > on the msi_controller structure and the of_pci_msi_chip_add() / > > of_pci_find_msi_chip_by_node() API, which are being deprecated in > > favor of the generic MSI support. > > > > Therefore, this commit updates the Aardvark driver to use the generic > > MSI support. > > > > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> > > --- > > drivers/pci/host/pci-aardvark.c | 172 ++++++++++++++++------------------------ > > 1 file changed, 67 insertions(+), 105 deletions(-) > > > > diff --git a/drivers/pci/host/pci-aardvark.c b/drivers/pci/host/pci-aardvark.c > > index ef9893f..0675cfa 100644 > > --- a/drivers/pci/host/pci-aardvark.c > > +++ b/drivers/pci/host/pci-aardvark.c > > [...] > > > -static int advk_pcie_setup_msi_irq(struct msi_controller *chip, > > - struct pci_dev *pdev, > > - struct msi_desc *desc) > > +static int advk_msi_irq_domain_alloc(struct irq_domain *domain, > > + unsigned int virq, > > + unsigned int nr_irqs, void *args) > > { > > - struct advk_pcie *pcie = pdev->bus->sysdata; > > - struct msi_msg msg; > > - int virq, hwirq; > > - phys_addr_t msi_msg_phys; > > - > > - /* We support MSI, but not MSI-X */ > > - if (desc->msi_attrib.is_msix) > > - return -EINVAL; > > You used not to support MSIX... > > [...] > > > @@ -677,30 +650,25 @@ static int advk_pcie_init_msi_irq_domain(struct advk_pcie *pcie) > > { > > struct device *dev = &pcie->pdev->dev; > > struct device_node *node = dev->of_node; > > - struct irq_chip *msi_irq_chip; > > - struct msi_controller *msi; > > + struct irq_chip *bottom_ic, *msi_ic; > > + struct msi_domain_info *msi_di; > > phys_addr_t msi_msg_phys; > > - int ret; > > - > > - msi_irq_chip = &pcie->msi_irq_chip; > > > > - msi_irq_chip->name = devm_kasprintf(dev, GFP_KERNEL, "%s-msi", > > - dev_name(dev)); > > - if (!msi_irq_chip->name) > > - return -ENOMEM; > > + mutex_init(&pcie->msi_used_lock); > > > > - msi_irq_chip->irq_enable = pci_msi_unmask_irq; > > - msi_irq_chip->irq_disable = pci_msi_mask_irq; > > - msi_irq_chip->irq_mask = pci_msi_mask_irq; > > - msi_irq_chip->irq_unmask = pci_msi_unmask_irq; > > + bottom_ic = &pcie->msi_bottom_irq_chip; > > > > - msi = &pcie->msi; > > + bottom_ic->name = "MSI"; > > + bottom_ic->irq_compose_msi_msg = advk_msi_irq_compose_msi_msg; > > + bottom_ic->irq_set_affinity = advk_msi_set_affinity; > > > > - msi->setup_irq = advk_pcie_setup_msi_irq; > > - msi->teardown_irq = advk_pcie_teardown_msi_irq; > > - msi->of_node = node; > > + msi_ic = &pcie->msi_irq_chip; > > + msi_ic->name = "advk-MSI"; > > > > - mutex_init(&pcie->msi_used_lock); > > + msi_di = &pcie->msi_domain_info; > > + msi_di->flags = MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS | > > + MSI_FLAG_PCI_MSIX; > > And yet you now advertize MSIX support. Was this an oversight in the > original code? If this is a fix, it'd be nice to have two patches: 1) make the fix 2) convert to new API
next prev parent reply other threads:[~2016-09-13 16:07 UTC|newest] Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-09-01 15:38 [PATCH 0/3] pci: remove msi_controller registration API Thomas Petazzoni 2016-09-01 15:38 ` Thomas Petazzoni 2016-09-01 15:38 ` Thomas Petazzoni [not found] ` <1472744284-18305-1-git-send-email-thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> 2016-09-01 15:38 ` [PATCH 1/3] pci: pci-aardvark: move to MSI handling using generic MSI support Thomas Petazzoni 2016-09-01 15:38 ` Thomas Petazzoni 2016-09-01 15:38 ` Thomas Petazzoni [not found] ` <1472744284-18305-2-git-send-email-thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> 2016-09-02 8:42 ` Marc Zyngier 2016-09-02 8:42 ` Marc Zyngier 2016-09-02 8:42 ` Marc Zyngier 2016-09-13 16:07 ` Bjorn Helgaas [this message] 2016-09-13 16:07 ` Bjorn Helgaas 2016-09-01 15:38 ` [PATCH 2/3] pci: pci-mvebu: remove useless MSI enabling code Thomas Petazzoni 2016-09-01 15:38 ` Thomas Petazzoni 2016-09-01 15:38 ` Thomas Petazzoni 2016-09-01 15:38 ` [PATCH 3/3] of: pci: remove unused MSI controller helpers Thomas Petazzoni 2016-09-01 15:38 ` Thomas Petazzoni 2016-09-01 15:38 ` Thomas Petazzoni 2016-09-02 13:34 ` Marc Zyngier 2016-09-02 13:34 ` Marc Zyngier 2016-09-02 13:34 ` Marc Zyngier [not found] ` <1472744284-18305-4-git-send-email-thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> 2016-09-08 13:45 ` Rob Herring 2016-09-08 13:45 ` Rob Herring 2016-09-08 13:45 ` Rob Herring
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=20160913160706.GC4138@localhost \ --to=helgaas@kernel.org \ --cc=andrew@lunn.ch \ --cc=bhelgaas@google.com \ --cc=devicetree@vger.kernel.org \ --cc=galak@codeaurora.org \ --cc=gregory.clement@free-electrons.com \ --cc=ijc+devicetree@hellion.org.uk \ --cc=jason@lakedaemon.net \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-pci@vger.kernel.org \ --cc=marc.zyngier@arm.com \ --cc=mark.rutland@arm.com \ --cc=mw@semihalf.com \ --cc=nadavh@marvell.com \ --cc=pawel.moll@arm.com \ --cc=robh+dt@kernel.org \ --cc=sebastian.hesselbarth@gmail.com \ --cc=shadi@marvell.com \ --cc=thomas.petazzoni@free-electrons.com \ --cc=xigu@marvell.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.