Re: Legacy IO spaces (was Re: [RFC] Reliable video POSTing on resume)

From: Jon Smirl
Date: Fri Feb 04 2005 - 19:54:30 EST


> > /sys/class/pci_bus I show three buses. You wouldn't want the
> > legacy_io/mem attributes on each of these three buses since that
> > implies three independent address spaces.
> >
> > [jonsmirl@jonsmirl pci_bus]$ ls /sys/class/pci_bus
> > 0000:00 0000:01 0000:02
>
> In that case they'll all point to the same memory and I/O space. On the
> machines I coded it on, each bus has its own space.

If they all point to the same space, I can't tell whether I have three
legacy spaces or one. I need to know how many legacy spaces there are
in order to know how many VGA cards can simultaneously be enabled.

> We might have to add more arch code in that case, but I thought it might be
> easiest for apps if they could just open the space for the bus they're
> interested in and it would be routed correctly. I think that'll be ok so
> long as two apps aren't trying to do stuff on the bus at the same time.
>
> > In order to know how many VGA many simultaneous VGA devices you can
> > have there needs to be some way to count the number of legacy address
> > spaces. Maybe there should be a /sys/class/legacy to describe the
> > legacy spaces. Is it possible to have the same legacy space aliased at
> > two different addresses depending on which root bus is used to get to
> > it?

What I meant by the questions is how can my video reset program ask
these questions, it needs to know the answers in order to properly
reset the VGA hardware. There needs to be some way to figure out the
answers from sysfs info.

1) how many legacy spaces are there
no way to tell
2) how many VGA devices are in each space
no way to tell, you need to know which legacy space each card is in
3) how do I do VGA bus routing to access the VGA device
I've posted code that starts doing this
4) how do I address each of the devices.
The routing code I posted needs to be update to handle multiple spaces.

For example I might have a machine with 3 spaces, 2 vga in #1, 1 in #2
and zero in #3. In that case I can have two active VGA's. My home
machine has one space and 2 vga's so I can have one active. There
needs to be enough info available to figure this out.

Or maybe the answer is simpler, if the legacy_io/mem attributes exist,
then you can assume each bus has it's own legacy space. If they don't
exist then there is a single legacy space. Is this a safe assumption?

--
Jon Smirl
jonsmirl@xxxxxxxxx
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/