lkml.org 
[lkml]   [1999]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: New resources - pls, explain :-(
Hello,

> > On all sane machines, all regions are automatically enabled by the BIOS.
>
> Not necessarily true at all.
>
> There are actually a number of BIOSes that have an option to enable
> _nothing_ but the actual devices needed for booting.

This switch is not about enabling, it's about not assigning the
region addresses at all and as I've already said, I'd like to avoid
assigning of addresses to PCI devices unless unavoidable (hotplug
environment, buggy devices) since it requires understanding semantics
of many obscure host bridges.

> Now, I admit to not having tried that option, because it definitely
> doesn't work with the current state of Linux drivers.

If it were just not enabling the regions, current PCI fixup code
would just spit some acrimonious messages and enable them :-)

> I'm not saying the driver should do the dirty work.
>
> I'm saying the _helper_ function should do the dirty work, and I'm saying
> that the bootup sequence should _not_ necessarily do it.

I still don't see any advantages in such an approach -- in my opinion
it just adds extra complexity to both the drivers and the generic code,
bringing nothing useful.

And as Petr Vandrovec has already mentioned, it can lead to driver
collisions (recall the case of a driver with both MMIO and I/O ports
and one driver knowing about MMIO and another one using the ports).
I think the only correct way is to arbitrate access to hardware
functionality, not to specific regions since we need to avoid
hardware access collisions, not resource access ones. The approach
I've suggested meets these requirements very well -- for usual
PCI devices hardware functionality exactly correspond to all regions
of a single PCI function, for the few unusual cases you still can
control resource allocation yourself.

> Note that on non-PC machines this tends to make more sense.

Not for me -- unless you want to make all drivers support readdressing
of their regions on the fly, you have to prepare all resource mappings
beforehand, so that you can set up PCI bridges and once you have done
all of this, it makes perfect sense to leave all the regions enabled.

> It also makes a whole lot more sense if you start thinking about hot-plug
> etc. You should let the driver do a simple "pci_enable_mem()", and that's the
> thing that enables the memory mapping.

No, even in PCI hot-plug environment there is no need to explicitly
enable regions in the driver -- the generic code can do it better _before_
it gives access to the device drivers. [Just recall the case we were discussing
where there are two resource regions corresponding to different functionalities
and we have a driver for all of them -- once we've initialized the first
driver, we cannot touch the address of its region at all, but we might
need it when allocating the second region.]

If we agree on these things, will you accept my PCI patch? I'd really
like to have it merged as soon as possible as I leave tomorrow and I'd
like port maintainers to have enough time to catch up with my changes.
Also, the feature freeze time is to come soon and I'd really like to have
some more time of the tiny bits of my PCI work which remain on my TODO
list.

Regarding the name list: I'll write a simple script generating the
devlist.h entries from my pci.ids file, so that we will be able to keep
it up to date very simply.

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
"Beware of programmers who carry screwdrivers..."

-
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.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.094 / U:1.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site