* Re: /proc/bus/pci and domains
[not found] <mj+md-20080213.154522.9237.albireo@ucw.cz>
@ 2008-02-14 4:43 ` Greg KH
2008-02-14 9:40 ` Martin Mares
0 siblings, 1 reply; 9+ messages in thread
From: Greg KH @ 2008-02-14 4:43 UTC (permalink / raw)
To: Martin Mares, paulus, anton; +Cc: linuxppc-dev, Linux-PCI Mailing List
On Wed, Feb 13, 2008 at 04:53:55PM +0100, Martin Mares wrote:
> Hi Greg et al.,
>
> I have noticed that lspci with the proc back-end does not work properly
> on ppc64. The problem turned out to be a strange hack in drivers/pci/proc.c
> causing the following behavior on machines with multiple PCI domains:
> The directory names under /proc/bus/pci/ have a domain number added (which
> is not backward compatible, but at least consistent), but on the other hand
> /proc/bus/pci/devices contains bus numbers without the domains, happily
> making multiple entries with the same bus and device number.
>
> Is there any serious reason for this behavior?
I have no idea, it sounds like a PPC specific thing, not anything the
PCI core does, right? So I'll add the ppc list to the cc: and ask if
anyone there has any ideas?
Rest of the original email follows...
>
> The original /proc/bus/pci/ (as I have designed it years ago) does not
> have any means of carrying the domain numbers, so it cannot be solved
> in a backward-compatible way, but the inconsistency between the list of
> devices and the actual directories leaves me puzzled.
>
> Wouldn't it be better to make the same backward-incompatible change
> in /proc/bus/pci/devices, so that at least new programs can use the
> thing?
>
> Of course, all this is of minor importance as all new programs know
> how to use the sysfs anyway (I have found the problem only because
> I forgot to mount sysfs to a chroot), but if we want to keep /proc/bus/pci/,
> we should fix it.
>
> Have a nice fortnight
> --
> Martin `MJ' Mares <mj@ucw.cz> http://mj.ucw.cz/
> Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
> Entropy isn't what it used to be.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: /proc/bus/pci and domains
2008-02-14 4:43 ` /proc/bus/pci and domains Greg KH
@ 2008-02-14 9:40 ` Martin Mares
2008-02-14 18:39 ` Jesse Barnes
2008-02-14 21:43 ` David Miller
0 siblings, 2 replies; 9+ messages in thread
From: Martin Mares @ 2008-02-14 9:40 UTC (permalink / raw)
To: Greg KH; +Cc: linuxppc-dev, Linux-PCI Mailing List, paulus, anton
Hi Greg!
> I have no idea, it sounds like a PPC specific thing, not anything the
> PCI core does, right? So I'll add the ppc list to the cc: and ask if
> anyone there has any ideas?
Unfortunately, this is not PPC specific at all -- proc_attach_device()
calls pci_proc_domain(bus), which is an arch-specific hook turning on
the weird behavior I described. This hook can return non-zero even on
x86 if there are buses outside domain 0.
I think that the hook itself is correct, it only should trigger more
consistent behavior of the generic code :)
Would it be acceptable for the PPC folks to modify the code to add
domain numbers to the device numbers in /proc/bus/pci/devices in the
same format as the bus directories already have?
If so, I will cook up a patch.
Have a nice fortnight
--
Martin `MJ' Mares <mj@ucw.cz> http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
"Dijkstra probably hates me." -- /usr/src/linux/kernel/sched.c
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: /proc/bus/pci and domains
2008-02-14 9:40 ` Martin Mares
@ 2008-02-14 18:39 ` Jesse Barnes
2008-02-14 21:43 ` David Miller
1 sibling, 0 replies; 9+ messages in thread
From: Jesse Barnes @ 2008-02-14 18:39 UTC (permalink / raw)
To: linux-pci; +Cc: Greg KH, paulus, anton, Martin Mares, linuxppc-dev
On Thursday, February 14, 2008 1:40 am Martin Mares wrote:
> Hi Greg!
>
> > I have no idea, it sounds like a PPC specific thing, not anything the
> > PCI core does, right? So I'll add the ppc list to the cc: and ask if
> > anyone there has any ideas?
>
> Unfortunately, this is not PPC specific at all -- proc_attach_device()
> calls pci_proc_domain(bus), which is an arch-specific hook turning on
> the weird behavior I described. This hook can return non-zero even on
> x86 if there are buses outside domain 0.
>
> I think that the hook itself is correct, it only should trigger more
> consistent behavior of the generic code :)
>
> Would it be acceptable for the PPC folks to modify the code to add
> domain numbers to the device numbers in /proc/bus/pci/devices in the
> same format as the bus directories already have?
>
> If so, I will cook up a patch.
I've run into this too, on machines with many domains. It's unfortunate that
there's no way to preserve compatibility, but I agree that the brokenness may
as well be consistent.
Jesse
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: /proc/bus/pci and domains
2008-02-14 9:40 ` Martin Mares
2008-02-14 18:39 ` Jesse Barnes
@ 2008-02-14 21:43 ` David Miller
2008-02-14 21:45 ` Matthew Wilcox
2008-02-14 21:45 ` Martin Mares
1 sibling, 2 replies; 9+ messages in thread
From: David Miller @ 2008-02-14 21:43 UTC (permalink / raw)
To: mj; +Cc: greg, linux-pci, paulus, anton, linuxppc-dev
From: Martin Mares <mj@ucw.cz>
Date: Thu, 14 Feb 2008 10:40:22 +0100
> Would it be acceptable for the PPC folks to modify the code to add
> domain numbers to the device numbers in /proc/bus/pci/devices in the
> same format as the bus directories already have?
Be careful, things like the X server parse that file, and X's
parser does not expect domain numbers there so you will break
things :-(
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: /proc/bus/pci and domains
2008-02-14 21:43 ` David Miller
@ 2008-02-14 21:45 ` Matthew Wilcox
2008-02-14 21:46 ` Martin Mares
2008-02-14 21:45 ` Martin Mares
1 sibling, 1 reply; 9+ messages in thread
From: Matthew Wilcox @ 2008-02-14 21:45 UTC (permalink / raw)
To: David Miller; +Cc: greg, mj, linuxppc-dev, paulus, anton, linux-pci
On Thu, Feb 14, 2008 at 01:43:05PM -0800, David Miller wrote:
> From: Martin Mares <mj@ucw.cz>
> Date: Thu, 14 Feb 2008 10:40:22 +0100
>
> > Would it be acceptable for the PPC folks to modify the code to add
> > domain numbers to the device numbers in /proc/bus/pci/devices in the
> > same format as the bus directories already have?
>
> Be careful, things like the X server parse that file, and X's
> parser does not expect domain numbers there so you will break
> things :-(
It might be best if we only place domain 0 in that file.
--
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: /proc/bus/pci and domains
2008-02-14 21:43 ` David Miller
2008-02-14 21:45 ` Matthew Wilcox
@ 2008-02-14 21:45 ` Martin Mares
2008-02-14 22:17 ` David Miller
1 sibling, 1 reply; 9+ messages in thread
From: Martin Mares @ 2008-02-14 21:45 UTC (permalink / raw)
To: David Miller; +Cc: greg, linux-pci, paulus, anton, linuxppc-dev
Hi!
> > Would it be acceptable for the PPC folks to modify the code to add
> > domain numbers to the device numbers in /proc/bus/pci/devices in the
> > same format as the bus directories already have?
>
> Be careful, things like the X server parse that file, and X's
> parser does not expect domain numbers there so you will break
> things :-(
Yes, but neither does it expect domain numbers in the directory names,
I guess :-)
But thanks for the tip, I will check X before I post the patch.
Have a nice fortnight
--
Martin `MJ' Mares <mj@ucw.cz> http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
A student who changes the course of history is probably taking an exam.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: /proc/bus/pci and domains
2008-02-14 21:45 ` Matthew Wilcox
@ 2008-02-14 21:46 ` Martin Mares
0 siblings, 0 replies; 9+ messages in thread
From: Martin Mares @ 2008-02-14 21:46 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: greg, linuxppc-dev, paulus, anton, linux-pci, David Miller
Hi!
> > Be careful, things like the X server parse that file, and X's
> > parser does not expect domain numbers there so you will break
> > things :-(
>
> It might be best if we only place domain 0 in that file.
Yes, that's another possilibity. However, in such cases we should probably
create the subdirectories only for domain 0 as well.
Have a nice fortnight
--
Martin `MJ' Mares <mj@ucw.cz> http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
"Beware of bugs in the above code; I have only proved it correct, not tried it." -- D.E.K.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: /proc/bus/pci and domains
2008-02-14 21:45 ` Martin Mares
@ 2008-02-14 22:17 ` David Miller
2008-02-14 22:21 ` Martin Mares
0 siblings, 1 reply; 9+ messages in thread
From: David Miller @ 2008-02-14 22:17 UTC (permalink / raw)
To: mj; +Cc: greg, linux-pci, paulus, anton, linuxppc-dev
From: Martin Mares <mj@ucw.cz>
Date: Thu, 14 Feb 2008 22:45:14 +0100
> But thanks for the tip, I will check X before I post the patch.
X now uses sysfs when available, therefore I think it's
best not to try and muck with this deprecated interface
if possible.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: /proc/bus/pci and domains
2008-02-14 22:17 ` David Miller
@ 2008-02-14 22:21 ` Martin Mares
0 siblings, 0 replies; 9+ messages in thread
From: Martin Mares @ 2008-02-14 22:21 UTC (permalink / raw)
To: David Miller; +Cc: greg, linux-pci, paulus, anton, linuxppc-dev
> X now uses sysfs when available, therefore I think it's
> best not to try and muck with this deprecated interface
> if possible.
However, the interface is fatally broken on machines with domains
and the breakage is visible (e.g., run lspci when /sys is not mounted).
I originally intended to just disable the proc backend on the affected
architectures, but it turned out than even x86 can be affected.
Have a nice fortnight
--
Martin `MJ' Mares <mj@ucw.cz> http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
"God doesn't play dice." -- Albert Einstein
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2008-02-14 22:21 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mj+md-20080213.154522.9237.albireo@ucw.cz>
2008-02-14 4:43 ` /proc/bus/pci and domains Greg KH
2008-02-14 9:40 ` Martin Mares
2008-02-14 18:39 ` Jesse Barnes
2008-02-14 21:43 ` David Miller
2008-02-14 21:45 ` Matthew Wilcox
2008-02-14 21:46 ` Martin Mares
2008-02-14 21:45 ` Martin Mares
2008-02-14 22:17 ` David Miller
2008-02-14 22:21 ` Martin Mares
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).