linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Jingoo Han <jingoohan1@gmail.com>,
	Gustavo Pimentel <gustavo.pimentel@synopsys.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	linux-pci@vger.kernel.org, Tim Harvey <tharvey@gateworks.com>,
	kernel@pengutronix.de, patchwork-lst@pengutronix.de,
	Marc Zyngier <marc.zyngier@arm.com>
Subject: Re: [PATCH] PCI: dwc: skip MSI init if MSIs have been explicitly disabled
Date: Mon, 04 Mar 2019 20:39:45 +0100	[thread overview]
Message-ID: <1551728385.9298.18.camel@pengutronix.de> (raw)
In-Reply-To: <20190304192548.GB26569@google.com>

Hi Bjorn,

Am Montag, den 04.03.2019, 13:25 -0600 schrieb Bjorn Helgaas:
> [+cc Marc, in case you have any suggestions]
> 
> Hi Lucas,
> 
> Nit: this has already been merged, but next time please make the
> subject line match the convention wrt capitalization.  This is not a
> PCI-specific idea; all it takes is "git log --oneline <file>", and
> that should be common practice anywhere in the kernel.

Sorry about that. I didn't really notice the capitalization, but
focused on the prefix.

> On Wed, Feb 27, 2019 at 05:52:19PM +0100, Lucas Stach wrote:
> > Since 7c5925afbc58 (PCI: dwc: Move MSI IRQs allocation to IRQ domains
> > hierarchical API) the MSI init claims one of the controller IRQs as a
> > chained IRQ line for the MSI controller. On some designs, like the i.MX6,
> > this line is shared with a PCIe legacy IRQ. When the line is claimed for
> > the MSI domain, any device trying to use this legacy IRQs will fail to
> > request this IRQ line.
> > 
> > As MSI and legacy IRQs are already mutually exclusive on the DWC core,
> > as the core won't forward any legacy IRQs once any MSI has been enabled,
> > users wishing to use legacy IRQs already need to explictly disable MSI
> > support (usually via the pci=nomsi kernel commandline option). To avoid
> > any issues with MSI conflicting with legacy IRQs, just skip all of the
> > DWC MSI initalization, including the IRQ line claim, when MSI is disabled.
> 
> Does this mean that if we have a device that uses legacy IRQs, the
> user has to figure out to boot with "pci=nomsi"?

As long as there is only a single device connected and there are no
port services things will work. If port services are active, those will
start to use MSIs, breaking legacy IRQs in the process.

I've asked Synopsys if there is a workaround for this, but it seems
that the core is working "as designed" with no workaround for this icky
behavior.

> I don't like kernel command line parameters.  If we need that
> parameter to make devices with legacy IRQs work, what happens without
> the parameter?  How obvious is it that the fix is to use "pci=nomsi"?

Totally non-obvious currently. Maybe this warrants a warning in the
kernel log.

> Is it impossible for Linux to figure this out and make it work
> automatically?
> 
> If we can't do it automatically, fine, maybe we have to live with the
> parameter.  But if there's any way we can avoid it, we should.

I don't think there is a practical way to make this work
automatically. 

At PCIe enumeration time we can only know if all devices in the
hierarchy are able to use MSIs, but this doesn't mean the device driver
will use MSIs. This is something we only get to know at driver probe
time, at which point it may already be too late, as another device
might already use some MSIs, so we can't revert to legacy IRQs only
mode.

Regards,
Lucas

  reply	other threads:[~2019-03-04 19:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-27 16:52 [PATCH] PCI: dwc: skip MSI init if MSIs have been explicitly disabled Lucas Stach
2019-02-27 17:25 ` Fabio Estevam
2019-02-27 17:43   ` Tim Harvey
2019-02-28 13:29 ` Lorenzo Pieralisi
2019-03-01 10:10   ` Gustavo Pimentel
2019-03-01 12:29 ` Lorenzo Pieralisi
2019-03-04 19:25 ` Bjorn Helgaas
2019-03-04 19:39   ` Lucas Stach [this message]
2019-03-04 20:18     ` Marc Zyngier
2019-03-06  9:53       ` Gustavo Pimentel
2019-03-06 11:39         ` Lucas Stach
2019-03-06 15:59       ` Tim Harvey
2019-04-15 14:34       ` Gustavo Pimentel

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=1551728385.9298.18.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=gustavo.pimentel@synopsys.com \
    --cc=helgaas@kernel.org \
    --cc=jingoohan1@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=marc.zyngier@arm.com \
    --cc=patchwork-lst@pengutronix.de \
    --cc=tharvey@gateworks.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;
as well as URLs for NNTP newsgroup(s).