Skip to contentSkip to conversation

lspci: Reorder Express Root Complex registers to Cap, Ctl, Sta

PATCH Applied Bjorn Helgaas 2 participants 2 messages May 17, 2019 – Jan 21, 2020 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lspci: Reorder Express Root Complex registers to Cap, Ctl, Sta

From: Bjorn Helgaas <[email protected]>

Registers in the PCI Express Capability come in sets of three (Capability, Control, Status), and we typically print them in that order. The Root Complex-related registers were an exception: we printed them in the (Control, Capability, Status) order.

Decode the RootCap, RootCtl, and RootSta registers in the usual order.

---
 ls-caps.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
ls-caps.c +7 -5
index a739f46..f1f325d 100644
@@ -897,7 +897,13 @@ static void cap_express_slot(struct device *d, int where)
 
 static void cap_express_root(struct device *d, int where)
 {
-  u32 w = get_conf_word(d, where + PCI_EXP_RTCTL);
+  u32 w;
+
+  w = get_conf_word(d, where + PCI_EXP_RTCAP);
+  printf("\t\tRootCap: CRSVisible%c\n",
+	FLAG(w, PCI_EXP_RTCAP_CRSVIS));
+
+  w = get_conf_word(d, where + PCI_EXP_RTCTL);
   printf("\t\tRootCtl: ErrCorrectable%c ErrNon-Fatal%c ErrFatal%c PMEIntEna%c CRSVisible%c\n",
 	FLAG(w, PCI_EXP_RTCTL_SECEE),
 	FLAG(w, PCI_EXP_RTCTL_SENFEE),
@@ -905,10 +911,6 @@ static void cap_express_root(struct device *d, int where)
 	FLAG(w, PCI_EXP_RTCTL_PMEIE),
 	FLAG(w, PCI_EXP_RTCTL_CRSVIS));
 
-  w = get_conf_word(d, where + PCI_EXP_RTCAP);
-  printf("\t\tRootCap: CRSVisible%c\n",
-	FLAG(w, PCI_EXP_RTCAP_CRSVIS));
-
   w = get_conf_long(d, where + PCI_EXP_RTSTA);
   printf("\t\tRootSta: PME ReqID %04x, PMEStatus%c PMEPending%c\n",
 	w & PCI_EXP_RTSTA_PME_REQID,
Signature · 1 line
2.21.0.1020.gf2820cf01a-goog
#1 lore raw

Hello!

Quoted 8 lines

From: Bjorn Helgaas <[email protected]>

Registers in the PCI Express Capability come in sets of three (Capability, Control, Status), and we typically print them in that order. The Root Complex-related registers were an exception: we printed them in the (Control, Capability, Status) order.

Decode the RootCap, RootCtl, and RootSta registers in the usual order.

Applied.

It seems that my bear nature took over and I spent a couple of months by hibernating :-)

I am going to process all patches for pciutils queued in last few months, make a release and hopefully return to regular maintenance again.

Thanks for the patience.

Signature · 3 lines
Martin `MJ' Mareš                        <[email protected]>   http://mj.ucw.cz/
United Computer Wizards, Prague, Czech Republic, Europe, Earth, Universe
The computer is mightier than the pen, the sword, and usually, the programmer.