Skip to contentSkip to conversation

Cannot switch off Radeon HD 4330/4350/4550 with vgaswitcheroo

Bug 205291 [email protected] 1 participant 14 messages Apr 20, 2020 – May 7, 2020 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]/

#1 lore raw

https://bugzilla.kernel.org/show_bug.cgi?id=205291

Zhang Rui ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------

                 CC|                            |[email protected]
          Component|Other                       |Video(DRI - non Intel)
           Assignee|[email protected]           |drivers_video-dri@kernel-bu
                   |                            |gs.osdl.org
            Product|Power Management            |Drivers
Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=205291

Alex Deucher ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #1 from Alex Deucher ([email protected]) --- Can you bisect?

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=205291

--- Comment #2 from Alex Deucher ([email protected]) --- Please attach your dmesg output in both the working and non-working cases.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=205291

--- Comment #3 from K J Petrie ([email protected]) --- Created attachment 288637
--> https://bugzilla.kernel.org/attachment.cgi?id=288637&action=edit
dmesg for 4.16.17

I no longer had the kernels installed so I have used the nearest distribution kernels I could find in the interest of simplicity and speed, as that doesn't seem to make a difference and compiling kernels takes a while on this machine. I hope that's OK. If not it might take a while to get round to compiling the kernels again.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=205291

--- Comment #4 from K J Petrie ([email protected]) --- Created attachment 288639
--> https://bugzilla.kernel.org/attachment.cgi?id=288639&action=edit
dmesg for 4.17.2

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=205291

--- Comment #5 from K J Petrie ([email protected]) --- (In reply to Alex Deucher from comment #1)

Quoted 1 line

Can you bisect?

Probably not. I can just about compile a kernel, but finding my way around anything other than a standard source download is likely to be beyond me.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#7 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=205291

K J Petrie ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
Hardware|IA-64 |x86-64

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#8 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=205291

--- Comment #6 from K J Petrie ([email protected]) --- Comment on attachment 288639
--> https://bugzilla.kernel.org/attachment.cgi?id=288639
dmesg for 4.17.2

Scrub this. It has radeon.runpm=0 on it's command line. I'll upload a corrected version.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#9 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=205291

K J Petrie ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------

 Attachment #288639|0                           |1

is obsolete| |

--- Comment #7 from K J Petrie ([email protected]) --- Created attachment 288641
--> https://bugzilla.kernel.org/attachment.cgi?id=288641&action=edit
Corrected dmesg for 4.17.2

This one doesn't have radeon.runpm=0 in its command line!

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#10 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=205291

Lukas Wunner ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #8 from Lukas Wunner ([email protected]) ---
Starting with v4.17, the power management of HDA controllers on discrete GPUs was changed such that the HDA keeps the GPU awake as long as it's in use:
https://lists.freedesktop.org/archives/nouveau/2018-February/029851.html

This exposed an issue with some ATI cards which was fixed in June 2018:
https://git.kernel.org/linus/57cb54e53bdd

So if you still experience GPU insomnia with v5.3 (which contains that fix), then it's a different problem.

In one case, a user reported GPU insomnia with an Nvidia card and it turned out that it was caused by a user space tool called "tlp" which disabled runtime power management of the HDA via sysfs. Naturally, this caused the GPU to stay awake. The solution in this case was to change the configuration of "tlp". But it was also possible to manually override disablement of runtime PM on the HDA by echoing "on" to the "power/control" file in the HDA PCI device's sysfs directory:
https://bugs.freedesktop.org/show_bug.cgi?id=75985#c116

So you first may want to check whether runtime PM is disabled in sysfs, try to manually enable it and see if the GPU runtime suspends, and if that works, find out which user space tool disabled runtime PM on the HDA.

It's also possible that you've got a user space tool running which has opened the HDA and thereby keeps the GPU awake. Some audio mixers do that.

If none of that fixes the problem, then we may indeed be dealing with a kernel bug. The other bugs related to runtime PM of the HDA contain all the steps and several debug patches to understand what's keeping the HDA awake, so we need you to follow those instructions and report the results back. Here are the relevant bugzillas:
https://bugs.freedesktop.org/show_bug.cgi?id=106597#c4
https://bugs.freedesktop.org/show_bug.cgi?id=106957#c1

One oddity I notice in your dmesg output is that there's only a single HDA controller detected in your machine and that's the one on the discrete GPU. Normally there are two HDAs, one is part of the Intel chipset and is responsible for headphones, loudspeakers, mic and so on, and the other one is on the discrete GPU and is only responsible for HDMI audio. On your machine, there's no Intel chipset HDA and the one on the discrete GPU has a Line Out for loudspeakers, headphone out, digital out and two microphone inputs. So that's a little odd and may contribute to this issue.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#11 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=205291

--- Comment #9 from K J Petrie ([email protected]) --- Well, it'll take time to patch and recompile the kernel, but in the meantime here is all the contents of the power directories:

AMD Radeon GPU
cat /sys/bus/pci/devices/0000\:01\:00.0/power/runtime_status active
cat /sys/bus/pci/devices/0000\:01\:00.0/power/control auto
cat /sys/bus/pci/devices/0000\:01\:00.0/power/autosuspend_delay_ms 5000
cat /sys/bus/pci/devices/0000\:01\:00.0/power/runtime_active_time 1744516
cat /sys/bus/pci/devices/0000\:01\:00.0/power/runtime_suspended_time 184197

AMD HDA
cat /sys/bus/pci/devices/0000\:01\:00.1/power/runtime_status active
cat /sys/bus/pci/devices/0000\:01\:00.1/power/control auto
cat /sys/bus/pci/devices/0000\:01\:00.1/power/autosuspend_delay_ms
cat: '/sys/bus/pci/devices/0000:01:00.1/power/autosuspend_delay_ms':
Input/output error
cat /sys/bus/pci/devices/0000\:01\:00.1/power/runtime_active_time 2415454
cat /sys/bus/pci/devices/0000\:01\:00.1/power/runtime_suspended_time 214644

I double-checked that IO error, in case it was just a fluke, but it's consistent.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#12 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=205291

--- Comment #10 from K J Petrie ([email protected]) --- Looks like I need to recompile with CONFIG_PM_ADVANCED_DEBUG, I suspect.

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#13 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=205291

K J Petrie ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |CODE_FIX

--- Comment #11 from K J Petrie ([email protected]) --- I decided to compile 5.6.6 with CONFIG_PM_ADVANCED_DEBUG.

To my amazement, this gave me:

# uname -r
5.6.6
# cat /sys/kernel/debug/vgaswitcheroo/switch 
0:IGD:+:Pwr:0000:00:02.0
1:DIS: :DynOff:0000:01:00.0
2:DIS-Audio: :DynOff:0000:01:00.1    (!!!!!!)

(GPU)

# cat /sys/bus/pci/devices/0000\:01\:00.0/power/control 
auto
# cat /sys/bus/pci/devices/0000\:01\:00.0/power/runtime_status 
suspended
cat /sys/bus/pci/devices/0000\:01\:00.0/power/runtime_usage 
0
# cat /sys/bus/pci/devices/0000\:01\:00.0/power/runtime_active_kids
0

(HDA)

# cat /sys/bus/pci/devices/0000\:01\:00.1/power/control 
auto
# cat /sys/bus/pci/devices/0000\:01\:00.1/power/runtime_status 
suspended
# cat /sys/bus/pci/devices/0000\:01\:00.1/power/runtime_usage 
0
# cat /sys/bus/pci/devices/0000\:01\:00.1/power/runtime_active_kids 
0

So, either enabling CONFIG_PM_ADVANCED_DEBUG affects this or it's fixed in the latest kernels.

As a quick check I installed the distribution's latest kernel:

# uname -r
5.5.19-pclos1
[root@master2 ken]# cat /sys/kernel/debug/vgaswitcheroo/switch 
0:IGD:+:Pwr:0000:00:02.0
1:DIS: :DynOff:0000:01:00.0
2:DIS-Audio: :DynOff:0000:01:00.1

So it looks as if it was fixed in the 5.5 kernels.

However, both the 5.5 (distro) and 5.6 (mainline) kernels emit a terrible clattering sound during services start up. I'm unsure whether that's coming from the speakers, HDD or optical drive. If the former, it's just a nuisance, if one of the latter it's not good news. I hope that's not related to the fix!

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#14 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=205291

K J Petrie ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|RESOLVED                    |REOPENED
         Resolution|CODE_FIX                    |---

--- Comment #12 from K J Petrie ([email protected]) --- Reopening as the problem has returned with 5.6.11, although the rattling sound from the speaker (bug 207437) has now gone!

Signature · 6 lines
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel