Error when fetching device name #3

Closed
opened 2025-06-01 08:57:02 +02:00 by nilsher · 3 comments
nilsher commented 2025-06-01 08:57:02 +02:00 (Migrated from github.com)

Error when running script

Traceback (most recent call last):
File "/root/./aspm.py", line 97, in
main()
File "/root/./aspm.py", line 92, in main
patch_device(root_complex)
File "/root/./aspm.py", line 68, in patch_device
print(get_device_name(addr))
^^^^^^^^^^^^^^^^^^^^^
File "/root/./aspm.py", line 21, in get_device_name
return p.communicate()[0].splitlines()[0].decode()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^

When running bellow command I get no return value, could that be the issue here?
Found out that inout to function is addr 00:1c.4
"lspci -s 00:1c.4"

Error when running script Traceback (most recent call last): File "/root/./aspm.py", line 97, in <module> main() File "/root/./aspm.py", line 92, in main patch_device(root_complex) File "/root/./aspm.py", line 68, in patch_device print(get_device_name(addr)) ^^^^^^^^^^^^^^^^^^^^^ File "/root/./aspm.py", line 21, in get_device_name return p.communicate()[0].splitlines()[0].decode() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^ When running bellow command I get no return value, could that be the issue here? Found out that inout to function is addr 00:1c.4 "lspci -s 00:1c.4"
0x666690 commented 2025-06-01 09:01:51 +02:00 (Migrated from github.com)

Is 00:1c.4 also the correct address for the device you're trying to apply it to? The values at the top of the script are just placeholders and need to be adjusted for every system.

Is 00:1c.4 also the correct address for the device you're trying to apply it to? The values at the top of the script are just placeholders and need to be adjusted for every system.
nilsher commented 2025-06-03 12:37:35 +02:00 (Migrated from github.com)

Ah I see, didn't notice hardcoded values. How do you figure out the root complex adress?(Don't really know much about pcie).

Have a motherboard which don't have any ASPM settings in bios at all, but I belive all hardware support L1.

lspci output:
00:00.0 Host bridge: Intel Corporation 12th Gen Core Processor Host Bridge (rev 05)
00:01.0 PCI bridge: Intel Corporation 12th Gen Core Processor PCI Express x16 Controller #1 (rev 05)
00:01.1 PCI bridge: Intel Corporation Device 462d (rev 05)
00:02.0 VGA compatible controller: Intel Corporation Alder Lake-S GT1 [UHD Graphics 770] (rev 0c)
00:04.0 Signal processing controller: Intel Corporation Alder Lake Innovation Platform Framework Processor Participant (rev 05)
00:06.0 PCI bridge: Intel Corporation 12th Gen Core Processor PCI Express x4 Controller #0 (rev 05)
00:08.0 System peripheral: Intel Corporation 12th Gen Core Processor Gaussian & Neural Accelerator (rev 05)
00:0a.0 Signal processing controller: Intel Corporation Platform Monitoring Technology (rev 01)
00:14.0 USB controller: Intel Corporation Alder Lake-S PCH USB 3.2 Gen 2x2 XHCI Controller (rev 11)
00:14.2 RAM memory: Intel Corporation Alder Lake-S PCH Shared SRAM (rev 11)
00:15.0 Serial bus controller: Intel Corporation Alder Lake-S PCH Serial IO I2C Controller #0 (rev 11)
00:16.0 Communication controller: Intel Corporation Alder Lake-S PCH HECI Controller #1 (rev 11)
00:17.0 SATA controller: Intel Corporation Alder Lake-S PCH SATA Controller [AHCI Mode] (rev 11)
00:1a.0 PCI bridge: Intel Corporation Alder Lake-S PCH PCI Express Root Port #25 (rev 11)
00:1b.0 PCI bridge: Intel Corporation Alder Lake-S PCH PCI Express Root Port (rev 11)
00:1c.0 PCI bridge: Intel Corporation Device 7abe (rev 11)
00:1f.0 ISA bridge: Intel Corporation Device 7a88 (rev 11)
00:1f.4 SMBus: Intel Corporation Alder Lake-S PCH SMBus Controller (rev 11)
00:1f.5 Serial bus controller: Intel Corporation Alder Lake-S PCH SPI Controller (rev 11)
01:00.0 SATA controller: ASMedia Technology Inc. ASM1166 Serial ATA Controller (rev 02)
02:00.0 Ethernet controller: Intel Corporation Ethernet Controller X710 for 10GbE SFP+ (rev 01)
02:00.1 Ethernet controller: Intel Corporation Ethernet Controller X710 for 10GbE SFP+ (rev 01)
03:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller 980
04:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller 980
05:00.0 Non-Volatile memory controller: Kingston Technology Company, Inc. KC3000/FURY Renegade NVMe SSD [E18] (rev 01)
06:00.0 PCI bridge: ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge (rev 06)
07:00.0 VGA compatible controller: ASPEED Technology, Inc. ASPEED Graphics Family (rev 52)

Ah I see, didn't notice hardcoded values. How do you figure out the root complex adress?(Don't really know much about pcie). Have a motherboard which don't have any ASPM settings in bios at all, but I belive all hardware support L1. lspci output: 00:00.0 Host bridge: Intel Corporation 12th Gen Core Processor Host Bridge (rev 05) 00:01.0 PCI bridge: Intel Corporation 12th Gen Core Processor PCI Express x16 Controller #1 (rev 05) 00:01.1 PCI bridge: Intel Corporation Device 462d (rev 05) 00:02.0 VGA compatible controller: Intel Corporation Alder Lake-S GT1 [UHD Graphics 770] (rev 0c) 00:04.0 Signal processing controller: Intel Corporation Alder Lake Innovation Platform Framework Processor Participant (rev 05) 00:06.0 PCI bridge: Intel Corporation 12th Gen Core Processor PCI Express x4 Controller #0 (rev 05) 00:08.0 System peripheral: Intel Corporation 12th Gen Core Processor Gaussian & Neural Accelerator (rev 05) 00:0a.0 Signal processing controller: Intel Corporation Platform Monitoring Technology (rev 01) 00:14.0 USB controller: Intel Corporation Alder Lake-S PCH USB 3.2 Gen 2x2 XHCI Controller (rev 11) 00:14.2 RAM memory: Intel Corporation Alder Lake-S PCH Shared SRAM (rev 11) 00:15.0 Serial bus controller: Intel Corporation Alder Lake-S PCH Serial IO I2C Controller #0 (rev 11) 00:16.0 Communication controller: Intel Corporation Alder Lake-S PCH HECI Controller #1 (rev 11) 00:17.0 SATA controller: Intel Corporation Alder Lake-S PCH SATA Controller [AHCI Mode] (rev 11) 00:1a.0 PCI bridge: Intel Corporation Alder Lake-S PCH PCI Express Root Port #25 (rev 11) 00:1b.0 PCI bridge: Intel Corporation Alder Lake-S PCH PCI Express Root Port (rev 11) 00:1c.0 PCI bridge: Intel Corporation Device 7abe (rev 11) 00:1f.0 ISA bridge: Intel Corporation Device 7a88 (rev 11) 00:1f.4 SMBus: Intel Corporation Alder Lake-S PCH SMBus Controller (rev 11) 00:1f.5 Serial bus controller: Intel Corporation Alder Lake-S PCH SPI Controller (rev 11) 01:00.0 SATA controller: ASMedia Technology Inc. ASM1166 Serial ATA Controller (rev 02) 02:00.0 Ethernet controller: Intel Corporation Ethernet Controller X710 for 10GbE SFP+ (rev 01) 02:00.1 Ethernet controller: Intel Corporation Ethernet Controller X710 for 10GbE SFP+ (rev 01) 03:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller 980 04:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller 980 05:00.0 Non-Volatile memory controller: Kingston Technology Company, Inc. KC3000/FURY Renegade NVMe SSD [E18] (rev 01) 06:00.0 PCI bridge: ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge (rev 06) 07:00.0 VGA compatible controller: ASPEED Technology, Inc. ASPEED Graphics Family (rev 52)
0x666690 commented 2025-06-04 14:19:54 +02:00 (Migrated from github.com)

The main idea is basically that you look at the tree view of all the PCIe devices on your computer (lspci -t) and then determine which bridge the device you want to patch is connected to, that way you can patch them in the correct order. In my case, 00:1c.4 is "PCI bridge: Intel Corporation Tiger Lake-H PCI Express Root Port #5 (rev 11)" and 05:00.0 is the device I want to patch. Which particular root port your device is connected to is impossible to say just from a list of devices.

The main idea is basically that you look at the tree view of all the PCIe devices on your computer (lspci -t) and then determine which bridge the device you want to patch is connected to, that way you can patch them in the correct order. In my case, 00:1c.4 is "PCI bridge: Intel Corporation Tiger Lake-H PCI Express Root Port #5 (rev 11)" and 05:00.0 is the device I want to patch. Which particular root port your device is connected to is impossible to say just from a list of devices.
Sign in to join this conversation.