Re: New PCI code for Alpha

Martin Mares (mj@ucw.cz)
Mon, 24 Aug 1998 01:01:31 +0200


Hello,

> As I read the code it doesn't have to do with preemption so much as
> machine-check control. So, no, I don't think I'll be changing it.

I didn't study the implementation of global cli() on Alpha, but on Intel
it just deadlocks when you try to call it from an interrupt. Several drivers
need to read configuration registers from interrupt.

> That has little or nothing to do with why hose_scan_bridges exists.
> The problem is that multiple busses have entirely separate I/O regions,
> and we need to be able to determine which bus the device in question is
> on, so that we can read or write from the appropriate region.
>
> The problem is that the kernel always uses pcibios_*_config_*, which
> throws away all of the information I need to know how to perform the
> operation. So what I have to do is set up a mapping from bus number
> to pci controler so that I can figure out what's going on. And I have
> to do this _before_ pci_scan_bus runs, since it needs that info to
> even consider doing its job.

I think you could do it this way:

last_bus = 0;
for each bus controller {
map busses last_bus to 0xff to current controller
last_bus = pci_scan_bus(...) + 1
}

> The cleanest thing would be for the kernel itself to never ever use
> pcibios_*_config_*, but instead always use pci_*_config_*. With the
> later, I still have the full device structure, and I can walk back up
> to dev->bus->sysdata and find out what I need to know. But I figured
> it was way too close to 2.2 for such a change to be considered.

It's hard to use pci_*_config_* in pci_scan_bus() since you need to touch
the device before you build a pci_dev structure for it.

> I have several ideas now for 2.3 how to rearrange things to make
> multi-bus machines happier.

I've been thinking about this as well, but it seems we can't do much if we
don't want to end up with rewriting lots of drivers. Anyway, I plan to
reorganize the bus scanning routines in 2.3 and also move bus layout
routines to generic code (needed for hotplug suppot).

Have a nice fortnight

-- 
Martin `MJ' Mares   <mj@ucw.cz>   http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
"If you are feeling good, don't worry. You'll get over it."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html