* [PATCH] lspci: Decode PCIe Link registers only for devices with links
@ 2013-08-28 19:08 Bjorn Helgaas
2013-11-10 11:30 ` Martin Mares
0 siblings, 1 reply; 2+ messages in thread
From: Bjorn Helgaas @ 2013-08-28 19:08 UTC (permalink / raw)
To: Martin Mares; +Cc: Ben Hutchings, linux-pci
Root Complex Integrated Endpoints and Root Complex Event Collectors do not
have links and are not permitted to implement Link or Link 2 registers,
per PCIe spec r3.0, sec 1.3.2.3. Decoding them is useless and misleading.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
ls-caps.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/ls-caps.c b/ls-caps.c
index 752a771..be19d38 100644
--- a/ls-caps.c
+++ b/ls-caps.c
@@ -1074,6 +1074,7 @@ cap_express(struct device *d, int where, int cap)
int type = (cap & PCI_EXP_FLAGS_TYPE) >> 4;
int size;
int slot = 0;
+ int link = 1;
printf("Express ");
if (verbose >= 2)
@@ -1104,9 +1105,11 @@ cap_express(struct device *d, int where, int cap)
printf("PCI/PCI-X to PCI-Express Bridge");
break;
case PCI_EXP_TYPE_ROOT_INT_EP:
+ link = 0;
printf("Root Complex Integrated Endpoint");
break;
case PCI_EXP_TYPE_ROOT_EC:
+ link = 0;
printf("Root Complex Event Collector");
break;
default:
@@ -1125,7 +1128,8 @@ cap_express(struct device *d, int where, int cap)
return;
cap_express_dev(d, where, type);
- cap_express_link(d, where, type);
+ if (link)
+ cap_express_link(d, where, type);
if (slot)
cap_express_slot(d, where);
if (type == PCI_EXP_TYPE_ROOT_PORT)
@@ -1141,7 +1145,8 @@ cap_express(struct device *d, int where, int cap)
return;
cap_express_dev2(d, where, type);
- cap_express_link2(d, where, type);
+ if (link)
+ cap_express_link2(d, where, type);
if (slot)
cap_express_slot2(d, where);
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] lspci: Decode PCIe Link registers only for devices with links
2013-08-28 19:08 [PATCH] lspci: Decode PCIe Link registers only for devices with links Bjorn Helgaas
@ 2013-11-10 11:30 ` Martin Mares
0 siblings, 0 replies; 2+ messages in thread
From: Martin Mares @ 2013-11-10 11:30 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: Ben Hutchings, linux-pci
Hi!
> Root Complex Integrated Endpoints and Root Complex Event Collectors do not
> have links and are not permitted to implement Link or Link 2 registers,
> per PCIe spec r3.0, sec 1.3.2.3. Decoding them is useless and misleading.
Applied, thanks. And sorry for the delay.
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
Q: What color is a chameleon on a mirror? A: The same.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-11-10 11:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-28 19:08 [PATCH] lspci: Decode PCIe Link registers only for devices with links Bjorn Helgaas
2013-11-10 11:30 ` Martin Mares
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox