Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ryder Lee <ryder.lee@mediatek.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
	arm-soc <arm@kernel.org>,
	"moderated list:ARM/Mediatek SoC support"
	<linux-mediatek@lists.infradead.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	honghui.zhang@mediatek.com
Subject: Re: [GIT PULL] Mediatek: 32-bit DT update for v4.15
Date: Tue, 9 Jan 2018 17:12:27 +0800	[thread overview]
Message-ID: <1515489147.11551.39.camel@mtkswgap22> (raw)
In-Reply-To: <1509846112.26038.22.camel@mtkswgap22>


On Fri, 2017-11-03 at 16:21 +0100, Arnd Bergmann wrote:
> On Fri, Nov 3, 2017 at 12:52 PM, Ryder Lee <ryder.lee@mediatek.com> wrote:
> > On Fri, 2017-11-03 at 10:40 +0100, Arnd Bergmann wrote:
> >> On Fri, Nov 3, 2017 at 2:37 AM, Ryder Lee <ryder.lee@mediatek.com> wrote:
> 
> >> This should have the exact same effect as what you have in your tree,
> >> but if that works,
> >> we can merge that version and try to figure out why the kernel thinks
> >> they are different.
> >
> > I've tried this approach by using the 4-ports network card and got the
> > result:
> > pcieport 0000:00:01.0: assign IRQ: got 220
> > pcieport 0000:00:01.0: assigning IRQ 220
> > pcieport 0000:00:01.0: enabling device (0140 -> 0142)
> > pcieport 0000:00:01.0: enabling bus mastering
> > pcieport 0000:00:01.0: Signaling PME with IRQ 220
> > ....
> > igb 0000:01:00.0: assign IRQ: got 221
> > igb 0000:01:00.0: assigning IRQ 221
> > igb 0000:01:00.1: assign IRQ: got 221
> > igb 0000:01:00.1: assigning IRQ 221
> > igb 0000:01:00.2: assign IRQ: got 221
> > igb 0000:01:00.2: assigning IRQ 221
> > igb 0000:01:00.3: assign IRQ: got 221
> > igb 0000:01:00.3: assigning IRQ 221
> >
> > I think slot 1 should share its IRQ (220) with every device in the
> > hierarchy below this root port.
> 
> Agreed, that is what I expected, too. I've looked at the of_pci_irq.c
> in more detail but couldn't come up with what happened. Can you
> try running with this patch or something like that to figure out where
> it takes the wrong turn?
> 
> https://pastebin.com/MrMzwcmw
> 

Hi Arnd,

I guess the problem is the first device attached to downstream side of a
link must be device 0 - it means that the 'slot' portion of pdev->devfn
should be 0 when PCIe enumeration. That's why we always mismatch to
interrupt-map = <0x0000 0 0 ... GIC_SPI 193 ...>

However, if we want to list all four interrupts for each slot, that
could work if fallback to device tree parsing:

https://elixir.free-electrons.com/linux/v4.15-rc7/source/drivers/of/of_pci_irq.c#L89

Then replace 'pdev->devfn' with 'of_pci_get_devfn(out_irq->np)'

But I still not sure the proper way to solve it.

Ryder.

      reply	other threads:[~2018-01-09  9:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-22 22:06 [GIT PULL] Mediatek: 32-bit DT update for v4.15 Matthias Brugger
     [not found] ` <c7145c00-b2b9-780c-0bfd-15f7d8a08dd6-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-10-30 12:42   ` Arnd Bergmann
     [not found]     ` <CAK8P3a3NWwoe0mX45WrFONyiHt9eWTTMziEc+rjqSfr5QZv8xQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-31  4:19       ` Ryder Lee
2017-11-02 11:47         ` Matthias Brugger
     [not found]           ` <e8fdd9a9-ce13-8804-aea0-46becc6f9730-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-11-02 16:05             ` Arnd Bergmann
     [not found]               ` <CAK8P3a0+9fChSbObS9boR8okHtO8u8_hr2Te+RjfRD0T54QYWQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-02 18:47                 ` Matthias Brugger
     [not found]                   ` <0c3f8521-e0a6-a0d2-45b9-62d7c824818d-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-11-02 21:55                     ` Arnd Bergmann
2017-11-03  1:37                 ` Ryder Lee
2017-11-03  9:40                   ` Arnd Bergmann
     [not found]                     ` <CAK8P3a1doHCH4ucC1AUR5HiH5qvMXeoqsav-9dsvhM2KPh3FNw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-03 11:52                       ` Ryder Lee
2017-11-03 15:21                         ` Arnd Bergmann
     [not found]                           ` <CAK8P3a1oP98K3mzK3MfFvJ27y5fgYsTnOdPpjukQGXOLAQYhyA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-05  1:41                             ` Ryder Lee
2018-01-09  9:12                               ` Ryder Lee [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=1515489147.11551.39.camel@mtkswgap22 \
    --to=ryder.lee@mediatek.com \
    --cc=arm@kernel.org \
    --cc=arnd@arndb.de \
    --cc=honghui.zhang@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.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