mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Dely Sy <dely.l.sy@intel.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	Rajat Jain <rajatxjain@gmail.com>,
	Guenter Roeck <groeck@juniper.net>,
	Kristen Carlson Accardi <kristen.c.accardi@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Special handling of display/VGA devices in hotplug drivers
Date: Thu, 11 Dec 2014 11:32:43 -0800	[thread overview]
Message-ID: <20141211113243.3f21551e@jbarnes-t420> (raw)
In-Reply-To: <20141211181136.GA11367@kroah.com>

On Thu, 11 Dec 2014 13:11:36 -0500
Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> On Thu, Dec 11, 2014 at 10:34:30AM -0700, Bjorn Helgaas wrote:
> > It looks like you added the initial pciehp driver [1], which
> > includes the following code in pciehp_disable_slot():
> > 
> > + if (class_code == PCI_BASE_CLASS_DISPLAY) {
> > + /* Display/Video adapter (not supported) */
> > + rc = REMOVE_NOT_SUPPORTED;
> > 
> > + /* If it's a bridge, check the VGA Enable bit */
> > + if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) {
> > + rc = pci_bus_read_config_byte (pci_bus, devfn,
> > PCI_BRIDGE_CONTROL, &BCR);
> > + if (rc)
> > + return rc;
> > +
> > + /* If the VGA Enable bit is set, remove isn't supported */
> > + if (BCR & PCI_BRIDGE_CTL_VGA) {
> > + rc = REMOVE_NOT_SUPPORTED;
> > 
> > I'm trying to figure out why VGA devices are handled specially.  I
> > can't find anything in the PCI specs that mentions this.  Most of
> > the other PCI hotplug drivers have similar code.  Do you remember
> > anything about this?
> 
> The PCI spec said that you were not allowed to hotplug VGA drivers.
> The big issue is that POST usually needs to run on those things, and
> there is no way to POST a PCI hotplugged device.
> 
> Does the spec not say that anymore?  I haven't looked in years at
> it...
> 
> Do you want to hot-add a VGA device?  Are these lines causing a
> problem with something?

Yeah, the legacy I/O regions get routed through the bridge with the VGA
bit set, and most legacy code probably can't handle that (whether POST,
VBIOS, or VGA drivers).

There is some code for moving the VGA routing around, so that might be
an option if you wanted to remove such a bridge.  You'd have to find a
VGA device under another bridge, and enable routing to that first, then
you could do the remove.

Jesse

  reply	other threads:[~2014-12-11 19:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-11 17:34 Bjorn Helgaas
2014-12-11 18:11 ` Greg Kroah-Hartman
2014-12-11 19:32   ` Jesse Barnes [this message]
2014-12-11 19:56     ` Guenter Roeck
2014-12-11 22:07     ` Bjorn Helgaas
2014-12-11 22:57       ` One Thousand Gnomes

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=20141211113243.3f21551e@jbarnes-t420 \
    --to=jbarnes@virtuousgeek.org \
    --cc=bhelgaas@google.com \
    --cc=dely.l.sy@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=groeck@juniper.net \
    --cc=kristen.c.accardi@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rajatxjain@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

all inboxes | Powered by JetHome®