public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jon Smirl <jonsmirl@gmail.com>
To: Adam Belay <abelay@novell.com>
Cc: greg@kroah.com, linux-kernel@vger.kernel.org,
	Jesse Barnes <jbarnes@sgi.com>
Subject: Re: [RFC] PCI bridge driver rewrite
Date: Thu, 24 Feb 2005 01:45:24 -0500	[thread overview]
Message-ID: <9e473391050223224532239c9d@mail.gmail.com> (raw)
In-Reply-To: <1109226122.28403.44.camel@localhost.localdomain>

On Thu, 24 Feb 2005 01:22:01 -0500, Adam Belay <abelay@novell.com> wrote:
> For the past couple weeks I have been reorganizing the PCI subsystem to
> better utilize the driver model.  Specifically, the bus detection code
> is now using a standard PCI driver.  It turns out to be a major

What about VGA routing? Most PCI buses do it with the normal VGA bit
but big hardware supports multiple legacy IO spaces via the bridge
chips.

Are you going to make sysfs entries for the bridges? If so I'd like a
VGA attribute that directly reads the VGA bit from the hardware and
display it instead of using the shadow copy.

/* sysfs show for VGA routing bridge */
static ssize_t vga_bridge_show(struct device *dev, char *buf)
{
	struct pci_dev *pdev = to_pci_dev(dev);
	u16 l;

	/* don't trust the shadow PCI_BRIDGE_CTL_VGA in pdev */
	/* user space (X) may change hardware without telling the kernel */
	pci_read_config_word(pdev, PCI_BRIDGE_CONTROL, &l);
	return sprintf(buf, "%d\n", (l & PCI_BRIDGE_CTL_VGA) != 0);
}

I also use these functions to control VGA routing, maybe they should
be part of bridge support.

static void bridge_yes(struct pci_dev *pdev)
{
	struct pci_dev *bridge;
	struct pci_bus *bus;
	
	/* Make sure the bridges route to us */
	bus = pdev->bus;
	while (bus) {
		bridge = bus->self;
		if (bridge) {
			bus->bridge_ctl |= PCI_BRIDGE_CTL_VGA;
			pci_write_config_word(bridge, PCI_BRIDGE_CONTROL, bus->bridge_ctl);
		}
		bus = bus->parent;
	}
}

static void bridge_no(struct pci_dev *pdev)
{
	struct pci_dev *bridge;
	struct pci_bus *bus;
	
	/* Make sure the bridges don't route to us */
	bus = pdev->bus;
	while (bus) {
		bridge = bus->self;
		if (bridge) {
			bus->bridge_ctl &= ~PCI_BRIDGE_CTL_VGA;
			pci_write_config_word(bridge, PCI_BRIDGE_CONTROL, bus->bridge_ctl);
		}
		bus = bus->parent;
	}
}

Jesse can comment on the specific support needed for multiple legacy IO spaces.

-- 
Jon Smirl
jonsmirl@gmail.com

  reply	other threads:[~2005-02-24  6:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-24  6:22 [RFC] PCI bridge driver rewrite Adam Belay
2005-02-24  6:45 ` Jon Smirl [this message]
2005-02-24  7:03   ` Adam Belay
2005-02-24  7:25     ` Jon Smirl
2005-02-28 23:39       ` Adam Belay
2005-02-24 23:02     ` Jesse Barnes
2005-02-28 23:27       ` Adam Belay
2005-02-28 23:38         ` Jesse Barnes
2005-03-01  0:13           ` Adam Belay
2005-03-01  0:34             ` Jesse Barnes
2005-02-24 10:03 ` Russell King
2005-02-28 23:50   ` Adam Belay
2005-02-25 23:38 ` Greg KH
2005-02-28 23:58   ` Adam Belay
  -- strict thread matches above, loose matches on Subject: below --
2005-04-04 16:33 Nguyen, Tom L

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=9e473391050223224532239c9d@mail.gmail.com \
    --to=jonsmirl@gmail.com \
    --cc=abelay@novell.com \
    --cc=greg@kroah.com \
    --cc=jbarnes@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    /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