Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1707090

Re: [PATCH v2 4/5] PCI: mediatek: Add new generation controller support

From Honghui Zhang <honghui.zhang@mediatek.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 4/5] PCI: mediatek: Add new generation controller support
Date 2017-08-09 09:00 +0200
Message-ID <uct8d-3uL-3@gated-at.bofh.it> (permalink)
References (1 earlier) <u7HbP-o2-1@gated-at.bofh.it> <uax6h-6yX-5@gated-at.bofh.it> <uaGjg-4D2-21@gated-at.bofh.it> <uaKGe-7th-3@gated-at.bofh.it> <ucj8S-5ef-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 2017-08-08 at 15:19 -0500, Bjorn Helgaas wrote:
> On Fri, Aug 04, 2017 at 08:18:09AM -0500, Bjorn Helgaas wrote:
> > On Fri, Aug 04, 2017 at 04:39:36PM +0800, Honghui Zhang wrote:
> > > On Thu, 2017-08-03 at 17:42 -0500, Bjorn Helgaas wrote:
> 
> > > > > +	port->irq_domain = irq_domain_add_linear(pcie_intc_node, INTX_NUM,
> > > > > +						 &intx_domain_ops, port);
> > > > 
> > > > I think there's an issue here with a 4-element IRQ domain and the
> > > > hwirq numbers 1-4 from the of_irq_parse_and_map_pci() path, so INTD
> > > > may not work correctly.
> > > > 
> > > > See
> > > > http://lkml.kernel.org/r/20170801212931.GA26498@bhelgaas-glaptop.roam.corp.google.com
> > > > and related discussion.
> > > 
> > > Sorry, I did not get this,
> > > I do some test with an intel E350T4 PCIe NICs, it's a x1 lane
> > > multi-function device.
> > > What I got from the log is below:
> > > ->of_irq_parse_and_map_pci
> > > 	->of_irq_parse_pci
> > > 		->irq_create_of_mapping
> > > 			->irq_create_fwspec_mapping
> > > 				->irq_domain_translate
> > > 				which will go through
> > > 				d->ops->translate #the hwirq really start from 0
> > > 
> > > And I tested every NIC port of the Intel E350T4 with tftp transfer data,
> > > seems all are OK with this code.
> > 
> > OK.  I don't know what d->ops->translate is involved here, but if it
> > works, I guess this is OK for now.  We're trying to clean this up and
> > make it consistent across all the drivers.  Many of them allocate a
> > 5-element IRQ domain, some make a 4-element domain, and on some of
> > them INTD doesn't work.  It's a mess.
> 
> Paul Burton is cleaning this up.  Can you point out the d->ops->translate
> function that's involved here?

Hi, Bjorn,

Sorry for my last reply, I was tracking the wrong logs. The real trick
is here:

->of_irq_parse_and_map_pci
  ->of_irq_parse_pci	#out_irq->args[0] start from 1(1 == INTA)
     ->of_irq_parse_raw

After of_irq_parse_raw finished it's work, the out_irq->args[0] will be
remapped as "interrupt-map" property defines[1], which in my case, it's
start from 0, and then fwspec->param[0] is start from 0 (0 == INTA).

My "interrupt-map" property is defined as below:
interrupt-map = <0 0 0 1 &pcie_intc0 0>,
		<0 0 0 2 &pcie_intc0 1>,
		<0 0 0 3 &pcie_intc0 2>,
		<0 0 0 4 &pcie_intc0 3>;

I do some test with the changes of property defined as below:
interrupt-map = <0 0 0 1 &pcie_intc0 1>,
		<0 0 0 2 &pcie_intc0 2>,
		<0 0 0 3 &pcie_intc0 3>,
		<0 0 0 4 &pcie_intc0 4>;
Then I got the same running complain as Paul have got[2]

So I guess it's the "interrupt-map" property defined in dtsi node play
the key role in this.

[1]http://elixir.free-electrons.com/linux/v4.13-rc4/source/drivers/of/irq.c#L265
[2]https://patchwork.kernel.org/patch/9794355

thanks.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2 4/5] PCI: mediatek: Add new generation controller  support Bjorn Helgaas <helgaas@kernel.org> - 2017-08-04 00:50 +0200
  Re: [PATCH v2 4/5] PCI: mediatek: Add new generation controller  support Honghui Zhang <honghui.zhang@mediatek.com> - 2017-08-04 10:40 +0200
    Re: [PATCH v2 4/5] PCI: mediatek: Add new generation controller  support Bjorn Helgaas <helgaas@kernel.org> - 2017-08-04 15:20 +0200
      Re: [PATCH v2 4/5] PCI: mediatek: Add new generation controller  support Ryder Lee <ryder.lee@mediatek.com> - 2017-08-05 07:00 +0200
        Re: [PATCH v2 4/5] PCI: mediatek: Add new generation controller  support Ryder Lee <ryder.lee@mediatek.com> - 2017-08-05 08:20 +0200
          Re: [PATCH v2 4/5] PCI: mediatek: Add new generation controller  support Honghui Zhang <honghui.zhang@mediatek.com> - 2017-08-07 05:50 +0200
        Re: [PATCH v2 4/5] PCI: mediatek: Add new generation controller  support Bjorn Helgaas <helgaas@kernel.org> - 2017-08-08 22:20 +0200
      Re: [PATCH v2 4/5] PCI: mediatek: Add new generation controller  support Bjorn Helgaas <helgaas@kernel.org> - 2017-08-08 22:20 +0200
        Re: [PATCH v2 4/5] PCI: mediatek: Add new generation controller  support Honghui Zhang <honghui.zhang@mediatek.com> - 2017-08-09 09:00 +0200
          Re: [PATCH v2 4/5] PCI: mediatek: Add new generation controller support Paul Burton <paul.burton@imgtec.com> - 2017-08-09 18:50 +0200

csiph-web