All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Bruno Prémont" <bonbons@linux-vserver.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Matthew Garrett <matthew.garrett@nebula.com>,
	Linux PCI <linux-pci@vger.kernel.org>,
	DRI mailing list <dri-devel@lists.freedesktop.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Andreas Noever <andreas.noever@gmail.com>
Subject: Re: [PATCH 0/2] x86, ia64: Move EFI_FB vga_default_device() initialization to pci_vga_fixup()
Date: Mon, 25 Aug 2014 14:16:02 +0200	[thread overview]
Message-ID: <20140825121602.GB15520@phenom.ffwll.local> (raw)
In-Reply-To: <20140822082324.12cb6e93@pluto>

On Fri, Aug 22, 2014 at 08:23:24AM +0200, Bruno Prémont wrote:
> On Thu, 21 Aug 2014 23:39:31 -0500 Bjorn Helgaas wrote:
> > On Thu, Aug 21, 2014 at 4:34 PM, Bruno Prémont wrote:
> > 
> > > A second step would then be to tune vgaarb's initial selection.
> > > Bjorn, is it possible to verify which I/O ports are decoded by a PCI
> > > device at the time of adding it to vgaarb? If so, how? I would like to
> > > check for legacy VGA I/O range (0x03B0-0x03DF) and only let vgaarb set
> > > a device as default if that I/O range is decoded by the device.
> > 
> > I don't know of a way.  I'm pretty sure VGA devices are allowed to
> > respond to those legacy addresses even if there's no BAR for them, but
> > I haven't found a spec reference for this.  There is the VGA Enable
> > bit in bridges, of course (PCI Bridge spec, sec 12.1.1.  If the VGA
> > device is behind a bridge that doesn't have the VGA Enable bit set, it
> > probably isn't the default device.
> 
> Those VGA devices behind bridges are the easy ones that vgaarb selects
> properly.
> It's the ones not behind a bridge (integrated graphics) like the intel
> one that cause problems.
> 
> For Andreas's system the discrete nvidia GPU has no I/O enabled
> according to PCI_COMMAND flags while the integrated intel one does have
> them (that's why the Intel GPU is chosen).
> 
> Unfortunately I don't know what makes his system choke at boot time as
> he did not provide logs for the failing case.

Very often when something goes wrong with a kms driver we hang while doing
the initial modeset. Which is all done while holding the console_lock
(because fbdev+vt locking is just insane). You can try to get a closer
look with I915_FBDEV=n which will avoid the console_lock, but which also
won't register the legacy/compat i915 fbdev emulation any more, so greatly
changes boot behaviour.

If that doesn't lead to clues the next approach is to "carefully"
drop&reacquire console_lock at a few "interesting" places to get a few
printks out over netconsole or similar. Or just hack up entire netconsole
loggin infrastructure which bypasses printk and so all the console_lock
insanity.

It's not pretty, I know :(

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

WARNING: multiple messages have this Message-ID (diff)
From: Daniel Vetter <daniel@ffwll.ch>
To: "Bruno Prémont" <bonbons@linux-vserver.org>
Cc: Matthew Garrett <matthew.garrett@nebula.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	DRI mailing list <dri-devel@lists.freedesktop.org>,
	Andreas Noever <andreas.noever@gmail.com>,
	Linux PCI <linux-pci@vger.kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: [PATCH 0/2] x86, ia64: Move EFI_FB vga_default_device() initialization to pci_vga_fixup()
Date: Mon, 25 Aug 2014 14:16:02 +0200	[thread overview]
Message-ID: <20140825121602.GB15520@phenom.ffwll.local> (raw)
In-Reply-To: <20140822082324.12cb6e93@pluto>

On Fri, Aug 22, 2014 at 08:23:24AM +0200, Bruno Prémont wrote:
> On Thu, 21 Aug 2014 23:39:31 -0500 Bjorn Helgaas wrote:
> > On Thu, Aug 21, 2014 at 4:34 PM, Bruno Prémont wrote:
> > 
> > > A second step would then be to tune vgaarb's initial selection.
> > > Bjorn, is it possible to verify which I/O ports are decoded by a PCI
> > > device at the time of adding it to vgaarb? If so, how? I would like to
> > > check for legacy VGA I/O range (0x03B0-0x03DF) and only let vgaarb set
> > > a device as default if that I/O range is decoded by the device.
> > 
> > I don't know of a way.  I'm pretty sure VGA devices are allowed to
> > respond to those legacy addresses even if there's no BAR for them, but
> > I haven't found a spec reference for this.  There is the VGA Enable
> > bit in bridges, of course (PCI Bridge spec, sec 12.1.1.  If the VGA
> > device is behind a bridge that doesn't have the VGA Enable bit set, it
> > probably isn't the default device.
> 
> Those VGA devices behind bridges are the easy ones that vgaarb selects
> properly.
> It's the ones not behind a bridge (integrated graphics) like the intel
> one that cause problems.
> 
> For Andreas's system the discrete nvidia GPU has no I/O enabled
> according to PCI_COMMAND flags while the integrated intel one does have
> them (that's why the Intel GPU is chosen).
> 
> Unfortunately I don't know what makes his system choke at boot time as
> he did not provide logs for the failing case.

Very often when something goes wrong with a kms driver we hang while doing
the initial modeset. Which is all done while holding the console_lock
(because fbdev+vt locking is just insane). You can try to get a closer
look with I915_FBDEV=n which will avoid the console_lock, but which also
won't register the legacy/compat i915 fbdev emulation any more, so greatly
changes boot behaviour.

If that doesn't lead to clues the next approach is to "carefully"
drop&reacquire console_lock at a few "interesting" places to get a few
printks out over netconsole or similar. Or just hack up entire netconsole
loggin infrastructure which bypasses printk and so all the console_lock
insanity.

It's not pretty, I know :(

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  parent reply	other threads:[~2014-08-25 12:15 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-14 20:43 [Patch] x86, ia64, efifb: Move boot_vga fixup from pci to vgaarb Bruno Prémont
2014-05-14 20:43 ` Bruno Prémont
2014-05-27 23:42 ` Bjorn Helgaas
2014-05-27 23:42   ` Bjorn Helgaas
2014-06-02 18:16   ` Bruno Prémont
2014-06-02 18:16     ` Bruno Prémont
2014-06-02 18:19     ` [PATCH 2/2] x86, ia64: Merge common vga fixup code Bruno Prémont
2014-06-02 18:19       ` Bruno Prémont
2014-06-02 18:19     ` [PATCH 1/2] x86, ia64: Move EFI_FB vga_default_device() initialization to pci_vga_fixup() Bruno Prémont
2014-06-02 18:19       ` Bruno Prémont
2014-06-17 22:35       ` Bjorn Helgaas
2014-06-17 22:35         ` Bjorn Helgaas
2014-06-18  6:09         ` Bruno Prémont
2014-06-18  6:09           ` Bruno Prémont
2014-06-24 20:41       ` Bruno Prémont
2014-06-24 20:41         ` Bruno Prémont
2014-06-24 22:55       ` [PATCH 1/2 v2] " Bruno Prémont
2014-06-24 22:55         ` Bruno Prémont
2014-06-24 22:58         ` [PATCH 2/2 v2] x86, ia64: Merge common vga fixup code Bruno Prémont
2014-06-24 22:58           ` Bruno Prémont
2014-06-24 23:02         ` [PATCH 1/2 v2] x86, ia64: Move EFI_FB vga_default_device() initialization to pci_vga_fixup() Matthew Garrett
2014-06-24 23:02           ` Matthew Garrett
2014-07-05 17:15         ` Bjorn Helgaas
2014-08-10  0:21           ` Andreas Noever
2014-08-10  0:36             ` Andreas Noever
2014-08-10  9:26               ` Bruno Prémont
2014-08-10  9:26                 ` Bruno Prémont
2014-08-10  9:56                 ` Andreas Noever
2014-08-10 16:34                   ` Bruno Prémont
2014-08-10 16:34                     ` Bruno Prémont
2014-08-14  0:40                     ` Andreas Noever
2014-08-16 17:21                       ` [PATCH 0/2] " Bruno Prémont
2014-08-16 17:21                         ` Bruno Prémont
2014-08-16 17:25                         ` [PATCH 1/2] vgaarb: Drop obsolete #ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE Bruno Prémont
2014-08-16 17:25                           ` Bruno Prémont
2014-08-16 17:30                         ` [PATCH 2/2] x86, ia64: Don't default to first video device Bruno Prémont
2014-08-16 17:30                           ` Bruno Prémont
2014-08-19 15:45                         ` [PATCH 0/2] x86, ia64: Move EFI_FB vga_default_device() initialization to pci_vga_fixup() Andreas Noever
2014-08-20  5:55                           ` Bruno Prémont
2014-08-20  7:11                             ` Bruno Prémont
2014-08-21 15:55                               ` Andreas Noever
2014-08-21 21:34                                 ` Bruno Prémont
2014-08-21 21:34                                   ` Bruno Prémont
2014-08-22  4:39                                   ` Bjorn Helgaas
2014-08-22  6:23                                     ` Bruno Prémont
2014-08-22 20:30                                       ` Andreas Noever
2014-08-23 11:06                                         ` Bruno Prémont
2014-08-24 21:09                                           ` [PATCH 1/2 v2] vgaarb: Don't default exclusively to first video device with mem+io Bruno Prémont
2014-08-24 21:09                                             ` Bruno Prémont
2014-08-26 15:32                                             ` Andreas Noever
2014-08-28 20:47                                               ` Bruno Prémont
2014-08-28 20:47                                                 ` Bruno Prémont
2014-09-12 11:19                                                 ` Bruno Prémont
2014-09-12 14:28                                                   ` Bjorn Helgaas
2014-09-12 14:28                                                     ` Bjorn Helgaas
2014-09-18 23:26                                                     ` Dave Airlie
2014-09-19  5:18                                                       ` Bjorn Helgaas
2014-09-19  5:18                                                         ` Bjorn Helgaas
2014-08-24 21:13                                           ` [PATCH 2/2 v2] vgaarb: Drop obsolete #ifndef Bruno Prémont
2014-08-25 12:16                                       ` Daniel Vetter [this message]
2014-08-25 12:16                                         ` [PATCH 0/2] x86, ia64: Move EFI_FB vga_default_device() initialization to pci_vga_fixup() Daniel Vetter
2014-08-25 12:39                                         ` Bruno Prémont

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=20140825121602.GB15520@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=andreas.noever@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=bonbons@linux-vserver.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=matthew.garrett@nebula.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.