From: "David S. Miller" <davem@redhat.com>
To: groudier@club-internet.fr
Cc: mj@suse.cz, lk@tantalophile.demon.co.uk, davej@suse.de,
linux-kernel@vger.kernel.org
Subject: Re: pdev_enable_device no longer used ?
Date: Mon, 11 Dec 2000 15:03:24 -0800 [thread overview]
Message-ID: <200012112303.PAA01350@pizda.ninka.net> (raw)
In-Reply-To: <Pine.LNX.4.10.10012112250330.2255-100000@linux.local> (message from Gérard Roudier on Mon, 11 Dec 2000 23:07:01 +0100 (CET))
In-Reply-To: <Pine.LNX.4.10.10012112250330.2255-100000@linux.local>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2976 bytes --]
Date: Mon, 11 Dec 2000 23:07:01 +0100 (CET)
From: Gérard Roudier <groudier@club-internet.fr>
So, if you want to fix this insane PCI interface:
1) Provide the _actual_ BARs values in the pci dev structure, otherwise
drivers that need them will have to deal with ugly hackery or access
explicitely the PCI configuration space.
Tell me one valid use of this information first :-)
a) If you want to use it to arrive at addresses MEM I/O operations
you need to go through something akin to ioremap() first anyways.
b) If you wish to interpret the BAR values and use them from a BUS
perspective somehow, you still need to go through some interface
because you cannot assume what even the hw BAR values mean.
This is precisely the kind of interface I am suggesting.
Consider even just that top few bits of BAR values on some system
have some special meaning, and must be masked out before used from
PCI device side transactions. Perhaps these bits are interpreted
somehow at the host bridge when CPU accesses to device MEM or I/O
space are made. I argue not that this is compliant behavior, I
argue only that it is something idiots designing hardware will in
fact do. We have seen worse things occur. Now, subsequently, if
we start using raw BARs in drivers these systems (however important
or not important) will become difficult to impossible to support.
Here the blacklists will end up in your driver, which is where I
think both of us will agree they should not be :-)
2) Provide an interface that accepts the PCI dev and the BAR offset as
input and that return somes cookie for read*/write* interface.
GiveMeSomeCookieForMmIo(pcidev, bar_offset).
I do not understand why ioremap() is such a bletcherous interface
for you :-) You take resource in PDEV, add desired offset, and pass
it to ioremap(). What about this sequence requires you to take pain
killers? :-) It seems quite straightforward to me.
We do not want to expose physical BARs because you as a driver have
no way to portably interpret this information. On the other hand
if you tell us "Given PDEV resource X, plus offset Y, give me this
address in BUS space" we can do that and that is the interface that
makes sense and is implementable on all architectures. This is what
I am proposing for adding asm/pci.h
Having people read and intepret BARs is not implementable on all
architecures (see discussion in (b) above).
I guess there is some fundamental reason you do not like the kernel
trying to discourage access to physical BARs. This makes things so
much easier and cleaner, at least to me.
I bet we end up in standstill here and ifdef hacks remain in symbios
drivers :-))) We will see...
Later,
David S. Miller
davem@redhat.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2000-12-11 23:50 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-12-09 11:30 davej
2000-12-09 11:38 ` Russell King
2000-12-09 12:15 ` Ivan Kokshaysky
2000-12-09 12:36 ` davej
2000-12-09 12:53 ` Alan Cox
2000-12-09 13:08 ` davej
2000-12-09 13:44 ` Ivan Kokshaysky
2000-12-09 14:26 ` Gérard Roudier
2000-12-09 17:48 ` Russell King
2000-12-09 20:57 ` Alan Cox
2000-12-09 15:04 ` Martin Mares
2000-12-09 18:11 ` davej
2000-12-10 23:28 ` Jamie Lokier
2000-12-11 0:34 ` davej
2000-12-11 19:40 ` Gérard Roudier
2000-12-12 2:43 ` Jes Sorensen
2000-12-11 19:20 ` Gérard Roudier
2000-12-11 20:55 ` Martin Mares
2000-12-11 20:49 ` Gérard Roudier
2000-12-11 21:48 ` David S. Miller
2000-12-11 21:30 ` Gérard Roudier
2000-12-11 22:21 ` David S. Miller
2000-12-11 22:07 ` Gérard Roudier
2000-12-11 23:03 ` David S. Miller [this message]
2000-12-12 19:17 ` Gérard Roudier
2000-12-12 20:14 ` David S. Miller
2000-12-12 20:28 ` Gérard Roudier
2000-12-12 22:39 ` David S. Miller
2000-12-11 23:16 ` Martin Mares
2000-12-12 18:56 ` Gérard Roudier
2000-12-12 12:21 ` Adrian Cox
2000-12-12 2:39 ` Jes Sorensen
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=200012112303.PAA01350@pizda.ninka.net \
--to=davem@redhat.com \
--cc=davej@suse.de \
--cc=groudier@club-internet.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=lk@tantalophile.demon.co.uk \
--cc=mj@suse.cz \
/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®