All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: Chen Wang <unicorn_wang@outlook.com>,
	Chen Wang <unicornxw@gmail.com>,
	kw@linux.com, u.kleine-koenig@baylibre.com,
	aou@eecs.berkeley.edu, arnd@arndb.de, bhelgaas@google.com,
	conor+dt@kernel.org, guoren@kernel.org, inochiama@outlook.com,
	krzk+dt@kernel.org, lee@kernel.org, lpieralisi@kernel.org,
	palmer@dabbelt.com, paul.walmsley@sifive.com,
	pbrobinson@gmail.com, robh@kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org,
	chao.wei@sophgo.com, xiaoguang.xing@sophgo.com,
	fengchun.li@sophgo.com, helgaas@kernel.org
Subject: Re: [PATCH v3 2/5] PCI: sg2042: Add Sophgo SG2042 PCIe driver
Date: Thu, 23 Jan 2025 12:12:03 +0000	[thread overview]
Message-ID: <86msfhviek.wl-maz@kernel.org> (raw)
In-Reply-To: <20250122173451.5c7pdchnyee7iy6t@thinkpad>

On Wed, 22 Jan 2025 17:34:51 +0000,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> wrote:
> 
> + Marc (for the IRQCHIP implementation review)
> 
> On Wed, Jan 22, 2025 at 09:28:12PM +0800, Chen Wang wrote:
> > 
> > > > +static int sg2042_pcie_setup_msi(struct sg2042_pcie *pcie,
> > > > +				 struct device_node *msi_node)
> > > > +{
> > > > +	struct device *dev = pcie->cdns_pcie->dev;
> > > > +	struct fwnode_handle *fwnode = of_node_to_fwnode(dev->of_node);
> > > > +	struct irq_domain *parent_domain;
> > > > +	int ret = 0;
> > > > +
> > > > +	if (!of_property_read_bool(msi_node, "msi-controller"))
> > > > +		return -ENODEV;
> > > > +
> > > > +	ret = of_irq_get_byname(msi_node, "msi");
> > > > +	if (ret <= 0) {
> > > > +		dev_err(dev, "%pOF: failed to get MSI irq\n", msi_node);
> > > > +		return ret;
> > > > +	}
> > > > +	pcie->msi_irq = ret;
> > > > +
> > > > +	irq_set_chained_handler_and_data(pcie->msi_irq,
> > > > +					 sg2042_pcie_msi_chained_isr, pcie);
> > > > +
> > > > +	parent_domain = irq_domain_create_linear(fwnode, MSI_DEF_NUM_VECTORS,
> > > > +						 &sg2042_pcie_msi_domain_ops, pcie);
> > > > +	if (!parent_domain) {
> > > > +		dev_err(dev, "%pfw: Failed to create IRQ domain\n", fwnode);
> > > > +		return -ENOMEM;
> > > > +	}
> > > > +	irq_domain_update_bus_token(parent_domain, DOMAIN_BUS_NEXUS);
> > > > +
> > > The MSI controller is wired to PLIC isn't it? If so, why can't you use
> > > hierarchial MSI domain implementation as like other controller drivers?
> > 
> > The method used here is somewhat similar to dw_pcie_allocate_domains() in
> > drivers/pci/controller/dwc/pcie-designware-host.c. This MSI controller is
> > about Method A, the PCIe controller implements an MSI interrupt controller
> > inside, and connect to PLIC upward through only ONE interrupt line. Because
> > MSI to PLIC is multiple to one, I use linear mode here and use chained ISR
> > to handle the interrupts.
> > 
> 
> Hmm, ok. I'm not an IRQCHIP expert, but I'll defer to Marc to review the IRQCHIP
> implementation part.

I don't offer this service anymore, I'm afraid.

As for the "I create my own non-hierarchical IRQ domain", this is
something that happens for all completely mis-designed interrupt
controllers, MSI or not, that multiplex interrupts.

These implementations are stuck in the previous century, and seeing
this on modern designs, for a "server SoC", is really pathetic.

maybe you now understand why I don't offer this sort of reviewing
service anymore.

	M.

-- 
Without deviation from the norm, progress is not possible.

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: Chen Wang <unicorn_wang@outlook.com>,
	Chen Wang <unicornxw@gmail.com>,
	kw@linux.com, u.kleine-koenig@baylibre.com,
	aou@eecs.berkeley.edu, arnd@arndb.de, bhelgaas@google.com,
	conor+dt@kernel.org, guoren@kernel.org, inochiama@outlook.com,
	krzk+dt@kernel.org, lee@kernel.org, lpieralisi@kernel.org,
	palmer@dabbelt.com, paul.walmsley@sifive.com,
	pbrobinson@gmail.com, robh@kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org,
	chao.wei@sophgo.com, xiaoguang.xing@sophgo.com,
	fengchun.li@sophgo.com, helgaas@kernel.org
Subject: Re: [PATCH v3 2/5] PCI: sg2042: Add Sophgo SG2042 PCIe driver
Date: Thu, 23 Jan 2025 12:12:03 +0000	[thread overview]
Message-ID: <86msfhviek.wl-maz@kernel.org> (raw)
In-Reply-To: <20250122173451.5c7pdchnyee7iy6t@thinkpad>

On Wed, 22 Jan 2025 17:34:51 +0000,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> wrote:
> 
> + Marc (for the IRQCHIP implementation review)
> 
> On Wed, Jan 22, 2025 at 09:28:12PM +0800, Chen Wang wrote:
> > 
> > > > +static int sg2042_pcie_setup_msi(struct sg2042_pcie *pcie,
> > > > +				 struct device_node *msi_node)
> > > > +{
> > > > +	struct device *dev = pcie->cdns_pcie->dev;
> > > > +	struct fwnode_handle *fwnode = of_node_to_fwnode(dev->of_node);
> > > > +	struct irq_domain *parent_domain;
> > > > +	int ret = 0;
> > > > +
> > > > +	if (!of_property_read_bool(msi_node, "msi-controller"))
> > > > +		return -ENODEV;
> > > > +
> > > > +	ret = of_irq_get_byname(msi_node, "msi");
> > > > +	if (ret <= 0) {
> > > > +		dev_err(dev, "%pOF: failed to get MSI irq\n", msi_node);
> > > > +		return ret;
> > > > +	}
> > > > +	pcie->msi_irq = ret;
> > > > +
> > > > +	irq_set_chained_handler_and_data(pcie->msi_irq,
> > > > +					 sg2042_pcie_msi_chained_isr, pcie);
> > > > +
> > > > +	parent_domain = irq_domain_create_linear(fwnode, MSI_DEF_NUM_VECTORS,
> > > > +						 &sg2042_pcie_msi_domain_ops, pcie);
> > > > +	if (!parent_domain) {
> > > > +		dev_err(dev, "%pfw: Failed to create IRQ domain\n", fwnode);
> > > > +		return -ENOMEM;
> > > > +	}
> > > > +	irq_domain_update_bus_token(parent_domain, DOMAIN_BUS_NEXUS);
> > > > +
> > > The MSI controller is wired to PLIC isn't it? If so, why can't you use
> > > hierarchial MSI domain implementation as like other controller drivers?
> > 
> > The method used here is somewhat similar to dw_pcie_allocate_domains() in
> > drivers/pci/controller/dwc/pcie-designware-host.c. This MSI controller is
> > about Method A, the PCIe controller implements an MSI interrupt controller
> > inside, and connect to PLIC upward through only ONE interrupt line. Because
> > MSI to PLIC is multiple to one, I use linear mode here and use chained ISR
> > to handle the interrupts.
> > 
> 
> Hmm, ok. I'm not an IRQCHIP expert, but I'll defer to Marc to review the IRQCHIP
> implementation part.

I don't offer this service anymore, I'm afraid.

As for the "I create my own non-hierarchical IRQ domain", this is
something that happens for all completely mis-designed interrupt
controllers, MSI or not, that multiplex interrupts.

These implementations are stuck in the previous century, and seeing
this on modern designs, for a "server SoC", is really pathetic.

maybe you now understand why I don't offer this sort of reviewing
service anymore.

	M.

-- 
Without deviation from the norm, progress is not possible.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2025-01-23 12:12 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-15  7:05 [PATCH v3 0/5] Add PCIe support to Sophgo SG2042 SoC Chen Wang
2025-01-15  7:05 ` Chen Wang
2025-01-15  7:06 ` [PATCH v3 1/5] dt-bindings: pci: Add Sophgo SG2042 PCIe host Chen Wang
2025-01-15  7:06   ` Chen Wang
2025-01-19 11:44   ` Manivannan Sadhasivam
2025-01-19 11:44     ` Manivannan Sadhasivam
2025-01-22 12:52     ` Chen Wang
2025-01-22 12:52       ` Chen Wang
2025-01-22 17:21       ` Manivannan Sadhasivam
2025-01-22 17:21         ` Manivannan Sadhasivam
2025-01-26  0:29         ` Chen Wang
2025-01-26  0:29           ` Chen Wang
2025-01-22 22:21   ` Bjorn Helgaas
2025-01-22 22:21     ` Bjorn Helgaas
2025-01-26  2:27     ` Chen Wang
2025-01-26  2:27       ` Chen Wang
2025-02-03  2:35       ` Chen Wang
2025-02-03  2:35         ` Chen Wang
2025-02-11 23:34       ` Bjorn Helgaas
2025-02-11 23:34         ` Bjorn Helgaas
2025-02-12  1:50         ` Chen Wang
2025-02-12  1:50           ` Chen Wang
2025-02-12  4:25           ` Bjorn Helgaas
2025-02-12  4:25             ` Bjorn Helgaas
2025-02-12  5:54             ` Chen Wang
2025-02-12  5:54               ` Chen Wang
2025-02-17  8:40               ` Chen Wang
2025-02-17  8:40                 ` Chen Wang
2025-02-19 18:22               ` Bjorn Helgaas
2025-02-19 18:22                 ` Bjorn Helgaas
2025-02-21  3:29                 ` Chen Wang
2025-02-21  3:29                   ` Chen Wang
2025-02-21 22:13                   ` Bjorn Helgaas
2025-02-21 22:13                     ` Bjorn Helgaas
2025-02-24  6:27                     ` Manivannan Sadhasivam
2025-02-24  6:27                       ` Manivannan Sadhasivam
2025-01-15  7:06 ` [PATCH v3 2/5] PCI: sg2042: Add Sophgo SG2042 PCIe driver Chen Wang
2025-01-15  7:06   ` Chen Wang
2025-01-19 12:23   ` Manivannan Sadhasivam
2025-01-19 12:23     ` Manivannan Sadhasivam
2025-01-22 13:28     ` Chen Wang
2025-01-22 13:28       ` Chen Wang
2025-01-22 17:34       ` Manivannan Sadhasivam
2025-01-22 17:34         ` Manivannan Sadhasivam
2025-01-23 12:12         ` Marc Zyngier [this message]
2025-01-23 12:12           ` Marc Zyngier
2025-02-07 17:49           ` Manivannan Sadhasivam
2025-02-07 17:49             ` Manivannan Sadhasivam
2025-02-17  8:22         ` Chen Wang
2025-02-17  8:22           ` Chen Wang
2025-02-19 17:57           ` Manivannan Sadhasivam
2025-02-19 17:57             ` Manivannan Sadhasivam
2025-01-22 21:33   ` Bjorn Helgaas
2025-01-22 21:33     ` Bjorn Helgaas
2025-02-17  8:36     ` Chen Wang
2025-02-17  8:36       ` Chen Wang
2025-01-15  7:07 ` [PATCH v3 3/5] dt-bindings: mfd: syscon: Add sg2042 pcie ctrl compatible Chen Wang
2025-01-15  7:07   ` Chen Wang
2025-02-11 14:33   ` (subset) " Lee Jones
2025-02-11 14:33     ` Lee Jones
2025-02-12  0:48     ` Chen Wang
2025-02-12  0:48       ` Chen Wang
2025-02-20 16:00       ` Lee Jones
2025-02-20 16:00         ` Lee Jones
2025-01-15  7:07 ` [PATCH v3 4/5] riscv: sophgo: dts: add pcie controllers for SG2042 Chen Wang
2025-01-15  7:07   ` Chen Wang
2025-01-15  7:07 ` [PATCH v3 5/5] riscv: sophgo: dts: enable pcie for PioneerBox Chen Wang
2025-01-15  7:07   ` Chen Wang

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=86msfhviek.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=chao.wei@sophgo.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=fengchun.li@sophgo.com \
    --cc=guoren@kernel.org \
    --cc=helgaas@kernel.org \
    --cc=inochiama@outlook.com \
    --cc=krzk+dt@kernel.org \
    --cc=kw@linux.com \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=pbrobinson@gmail.com \
    --cc=robh@kernel.org \
    --cc=u.kleine-koenig@baylibre.com \
    --cc=unicorn_wang@outlook.com \
    --cc=unicornxw@gmail.com \
    --cc=xiaoguang.xing@sophgo.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 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.