New_buntu_89
February 14th, 2021, 10:40 PM
I'm having an issue with my Ethernet card that resolves itself by just turning the computer off and on again. I haven't checked what happens with a reboot. There's more detail in this thread (https://ubuntuforums.org/showthread.php?t=2457411). Essentially, a lot of times the Ethernet interface won't be recognized at all as even being present. I tried changing the Ethernet driver to 3 different versions, but that didn't help.
When Ethernet is working well, lshw shows this:
*-pci:0
description: PCI bridge
product: 6 Series/C200 Series Chipset Family PCI Express Root Port 1
vendor: Intel Corporation
physical id: 1c
bus info: pci@0000:00:1c.0
version: b4
width: 32 bits
clock: 33MHz
capabilities: pci normal_decode bus_master cap_list
configuration: driver=pcieport
resources: irq:24 ioport:e000(size=4096) ioport:f0000000(size=1048576)
*-network
description: Ethernet interface
product: RTL810xE PCI Express Fast Ethernet controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:01:00.0
logical name: enp1s0
version: 05
serial: b8:70:f4:69:5b:4c
size: 100Mbit/s
capacity: 100Mbit/s
width: 64 bits
clock: 33MHz
capabilities: bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 duplex=full firmware=rtl_nic/rtl8105e-1.fw ip=192.168.0.53 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
resources: irq:16 ioport:e000(size=256) memory:f0004000-f0004fff memory:f0000000-f0003fff
When it's not working, it will show the same thing for -pci:0, but without the Ethernet section.
What I'd like to try is to do a full power cycle of that PCI bridge when the computer is already booted up, so I can just put it in a script and not have to reboot the whole computer. It wouldn't be a solution, but it's a potential workaround.
I saw this issue (https://unix.stackexchange.com/questions/73908/how-to-reset-cycle-power-to-a-pcie-device), but my pci folder doesn't have anything to trigger under power (it's another directory, not a sysfs file), and I tried remove , reset, and rescan to no effect (with the Ethernet card not working, obviously). I only did it for pci@0000:00:1c.0 in particular though, I didn't attempt to find a higher level that would remove pci@0000:00:00.0, which I don't actually know if it's possible... It seems that none of those will actually power off the PCI bridge, though.
Apparently, it's possible to use setpci for this, but I am afraid it'll take me 10+ years to figure out how to do this on my own. Here's the datasheet for the PCI bridge, as far as I can tell:
https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/6-chipset-c200-chipset-datasheet.pdf
There's a newer version, but this laptop was purchased in August 2011, so I think specification changes won't match:
https://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/6-and-c200-chipset-specification-update.pdf
I believe what I'm looking for is either a bad configuration with the Power Management policies (which I think will take forever to find), or to write a configuration to it that will send it to an S5 (Soft OFF) state first, and then trigger a wake event.
From what I've read so far, it looks like you can trigger the wake event manually using the PME_B0_EN bit in the GPE0_EN register, but I haven't found how to turn it off first. Alternatively, it may be possible to do the whole reset with the Secondary Bus Reset bit in the Bridge Control Register. Another alternative seems to be in the PCI Power Management Control and Status Register.
Has anyone here done similar stuff before, or worked with Intel PCI Express specifically? What should I be looking out for before I start testing stuff? Which status registers should I be reading before I try to send any writes? Better yet, has anyone been able to power cycle this type of PCI bridge from setpci?
I need a bit of guidance to be able to get this done in a reasonable time.
When Ethernet is working well, lshw shows this:
*-pci:0
description: PCI bridge
product: 6 Series/C200 Series Chipset Family PCI Express Root Port 1
vendor: Intel Corporation
physical id: 1c
bus info: pci@0000:00:1c.0
version: b4
width: 32 bits
clock: 33MHz
capabilities: pci normal_decode bus_master cap_list
configuration: driver=pcieport
resources: irq:24 ioport:e000(size=4096) ioport:f0000000(size=1048576)
*-network
description: Ethernet interface
product: RTL810xE PCI Express Fast Ethernet controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:01:00.0
logical name: enp1s0
version: 05
serial: b8:70:f4:69:5b:4c
size: 100Mbit/s
capacity: 100Mbit/s
width: 64 bits
clock: 33MHz
capabilities: bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 duplex=full firmware=rtl_nic/rtl8105e-1.fw ip=192.168.0.53 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
resources: irq:16 ioport:e000(size=256) memory:f0004000-f0004fff memory:f0000000-f0003fff
When it's not working, it will show the same thing for -pci:0, but without the Ethernet section.
What I'd like to try is to do a full power cycle of that PCI bridge when the computer is already booted up, so I can just put it in a script and not have to reboot the whole computer. It wouldn't be a solution, but it's a potential workaround.
I saw this issue (https://unix.stackexchange.com/questions/73908/how-to-reset-cycle-power-to-a-pcie-device), but my pci folder doesn't have anything to trigger under power (it's another directory, not a sysfs file), and I tried remove , reset, and rescan to no effect (with the Ethernet card not working, obviously). I only did it for pci@0000:00:1c.0 in particular though, I didn't attempt to find a higher level that would remove pci@0000:00:00.0, which I don't actually know if it's possible... It seems that none of those will actually power off the PCI bridge, though.
Apparently, it's possible to use setpci for this, but I am afraid it'll take me 10+ years to figure out how to do this on my own. Here's the datasheet for the PCI bridge, as far as I can tell:
https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/6-chipset-c200-chipset-datasheet.pdf
There's a newer version, but this laptop was purchased in August 2011, so I think specification changes won't match:
https://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/6-and-c200-chipset-specification-update.pdf
I believe what I'm looking for is either a bad configuration with the Power Management policies (which I think will take forever to find), or to write a configuration to it that will send it to an S5 (Soft OFF) state first, and then trigger a wake event.
From what I've read so far, it looks like you can trigger the wake event manually using the PME_B0_EN bit in the GPE0_EN register, but I haven't found how to turn it off first. Alternatively, it may be possible to do the whole reset with the Secondary Bus Reset bit in the Bridge Control Register. Another alternative seems to be in the PCI Power Management Control and Status Register.
Has anyone here done similar stuff before, or worked with Intel PCI Express specifically? What should I be looking out for before I start testing stuff? Which status registers should I be reading before I try to send any writes? Better yet, has anyone been able to power cycle this type of PCI bridge from setpci?
I need a bit of guidance to be able to get this done in a reasonable time.