From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "David S. Miller" <davem@redhat.com>
Cc: <linux-kernel@vger.kernel.org>, <linuxppc-dev@lists.linuxppc.org>
Subject: Re: The IO problem on multiple PCI busses
Date: Thu, 1 Mar 2001 20:49:41 +0100 [thread overview]
Message-ID: <19350124132125.27547@smtp.wanadoo.fr> (raw)
In-Reply-To: <15006.40524.929644.25622@pizda.ninka.net>
In-Reply-To: <15006.40524.929644.25622@pizda.ninka.net>
> > I'm, of course open to any comments about this (in fact, I'd really like
> > some feedback). One thing is that we also need to find a way to pass
> > those infos to userland. Currently, we implement an arch-specific syscall
> > that allow to retreive the IO physical base of a given PCI bus. That may
> > be enough, but we may also want something that match more closely what we
> > do in the kernel.
>
>Same problem on sparc64. Using a special PCI syscall is fine, _if_ we
>all end up using the same one. However, I would prefer another
>mechanism...
Right, I remember we discussed this some monthes ago. Currently, we have
a syscall that is slightly different from the sparc/alpha ones but very
similar.
>I think a cleaner scheme is to allow mmap() on
>/proc/bus/pci/${BUS}/${DEVICE} nodes, that is much cleaner and solves
>transparently any "different word size between userland and kernel"
>issues (specifically 32-bit userlands executing on 64-bit kernels).
>
>I played around with something akin to this, and some of the necessary
>Xfree86-4.0.x hackery needed, some time ago. But I never finished
>this.
I do agree with you on this. I didn't have time to really work on it so
far, I remember you posted a test patch but I was busy at that time with
other PCI issues we had with multiple bus systems.
Note that this is only the userland side of the story. For now, I'm more
concerned about finding a good solution to the kernel side.
Also, the problem of finding where the legacy ISA IOs of a given PCI bus
are is a bit different that simply mmap'ing a BAR. Some video cards
require some access to their VGA IOs without having a BAR covering them,
in some case it's necessary to switch the chip from VGA to MMIO mode.
I've looked at the parisc code (thanks Alan for pointing that out), and
it seem they implement all inb/outb as quite big functions that decypher
the address, retreive the bus, and do the proper IO call. Unfortunately,
that's a bit bloated, and I don't think I'll ever get other PPC
maintainers to agree with such a mecanism (everybody seem to be quite
concerned with IO speed, I admit including me).
Also, that wouldn't really help the case of legacy drivers or video
drivers using legacy addresses for VGA. In all cases, whatever solution
we end up having, those will have to be adapted. What I'd like is a
smooth path that allow unchanged drivers to still work with the default
bus, while adapted driver can be done so with minimum changes (mostly
ending up storing an io base and creating a virtual "ISA bus number").
That way, an ISA-like (legacy IO bus) can be mapped to either a PCI bus,
or whatever. Maybe "ISA" is not a proper word for it, it could be
"basic_io_bus" maybe.
Alan also pointed out that there may be similar issues with MMIOs. In
fact, as long as we are working with PCI devices, we can easily get
things fixed up by munging the resource structures at fixup time. The
_is_ however a similar issue with legacy ISA memory, especially since
some platform can simply not let you access it.
Looking at those in more details (other archs), it appears that the
problem happens on most non-x86 archs and is handled differently for each
of them, when it's handled at all.
So what would be a preferred way ? Create that fake ISA bus number and
provide functions for looking them up, getting their IO and mem bases,
and eventually mapping PCI busses to ISA busses ? Or does someone have a
better idea ? The goal is to try not to change the semantics of inb/outb
and friends so that most legacy drivers can still work using the
"default" IO bus if they are not upgraded to the new scheme.
Thanks for your feedback,
Regards,
Ben.
next prev parent reply other threads:[~2001-03-01 19:50 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-01 15:33 Benjamin Herrenschmidt
2001-03-01 15:41 ` Benjamin Herrenschmidt
2001-03-01 18:30 ` Alan Cox
2001-03-01 19:09 ` David S. Miller
2001-03-01 19:33 ` Dan Malek
2001-03-01 19:41 ` David S. Miller
2001-03-01 19:59 ` Dan Malek
2001-03-01 20:09 ` Benjamin Herrenschmidt
2001-03-01 20:22 ` David S. Miller
2001-03-01 20:27 ` David S. Miller
2001-03-02 11:25 ` Benjamin Herrenschmidt
2001-03-03 1:08 ` David S. Miller
2001-03-01 19:49 ` Benjamin Herrenschmidt [this message]
2001-03-01 20:21 ` David S. Miller
2001-03-01 22:26 ` Alan Cox
2001-03-02 11:20 ` Benjamin Herrenschmidt
2001-03-03 1:06 ` David S. Miller
2001-03-03 2:25 ` Benjamin Herrenschmidt
2001-03-03 11:01 ` Jeff Garzik
2001-03-03 17:28 ` Benjamin Herrenschmidt
2001-03-05 16:20 ` David Woodhouse
2001-03-06 23:01 ` Oliver Xymoron
2001-03-07 2:07 ` Tony Mantler
2001-03-05 23:21 ` Chris Wedgwood
2001-03-02 1:22 Grant Grundler
2001-03-02 2:19 ` David S. Miller
2001-03-02 17:46 ` Grant Grundler
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=19350124132125.27547@smtp.wanadoo.fr \
--to=benh@kernel.crashing.org \
--cc=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.linuxppc.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
all inboxes | Powered by JetHome®