Score:3

Custom workaround udev script for hibernate/suspend error doesn't work

cn flag

So I have an old ASUS K46CM laptop running Xubuntu 20.04, with a functioning speaker but defunct audio jack. I've disabled the audio from BIOS now to deal with it.

This presents a new problem: I can no longer hibernate nor suspend this laptop. It generated an error that said:

0000:01:00.1: can't change power state from D3cold to D0 (config space inaccessible)

I googled around and found someone with a seemingly similar problem and a working solution: disable the device on boot with a custom udev rule, from this link below:

https://forums.developer.nvidia.com/t/kernel-5-6-system-freeze-when-resuming-from-suspend-or-hibernate/121630/21

The udev rule in question:

cat /etc/udev/rules.d/10-remove-nvidia-audio.rules
ACTION==“add”, KERNEL==“0000:01:00.1”, SUBSYSTEM==“pci”, RUN+="/bin/sh -c ‘echo 1 > /sys/bus/pci/devices/0000:01:00.1/remove’"

Except that it didn't work for me.

The problematic device:

01:00.1 Audio device: NVIDIA Corporation GF108 High Definition Audio Controller (rev ff)

... is still listed in my lspci output after I put that workaround:

00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
00:04.0 Signal processing controller: Intel Corporation 3rd Gen Core Processor Thermal Subsystem (rev 09)
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)
00:16.0 Communication controller: Intel Corporation 7 Series/C216 Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 7 Series/C216 Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1c.0 PCI bridge: Intel Corporation 7 Series/C216 Chipset Family PCI Express Root Port 1 (rev c4)
00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4)
00:1c.3 PCI bridge: Intel Corporation 7 Series/C216 Chipset Family PCI Express Root Port 4 (rev c4)
00:1d.0 USB controller: Intel Corporation 7 Series/C216 Chipset Family USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 7 Series/C216 Chipset Family SMBus Controller (rev 04)
00:1f.6 Signal processing controller: Intel Corporation 7 Series/C210 Series Chipset Family Thermal Management Controller (rev 04)
01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 635M] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GF108 High Definition Audio Controller (rev ff)
03:00.0 Network controller: Qualcomm Atheros AR9485 Wireless Network Adapter (rev 01)
04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTL8411 PCI Express Card Reader (rev 01)
04:00.2 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0a)

Perhaps I've missed something? To be honest this is my first time dealing with a problem involving udev rules.

Thank you in advance.

kanehekili avatar
zw flag
You probably have to change that rule, since the person who wrote that rule has a different sys layout than you. So what happens if you type in a terminal: `cat /sys/bus/pci/devices/0000:01:00.1/remove`, it probably won't exist. So you need to search for the right slot.
tezman avatar
cn flag
@kanehekili It's there, but restricted. sudo cat /sys/bus/pci/devices/0000:01:00.1/remove cat: '/sys/bus/pci/devices/0000:01:00.1/remove': Permission denied Also the permission table: --w--w---- 1 root root 4096 Nov 4 10:42 remove
tezman avatar
cn flag
But it works when I go straight to su and perform the echo command there. After that, lspci no longer list the problematic device. But I need to do this on boot for the change to persists, and I don't know how yet
user.dz avatar
ng flag
Check with `udevadm info -a /sys/bus/pci/devices/0000:01:00.1` if you want to test targeting it by other attributes than address. Some rules to be effective on boot need to update ramfs after changes in rules using: `sudo update-initramfs -u`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.