diff mbox

[Bug,194721] New: Reading /sys/bus/pci/devices/0000:01:00.0/config wakes up Radeon dGPU

Message ID bug-194721-2300@https.bugzilla.kernel.org/ (mailing list archive)
State New, archived
Headers show

Commit Message

bugzilla-daemon@bugzilla.kernel.org Feb. 27, 2017, 9:04 a.m. UTC
https://bugzilla.kernel.org/show_bug.cgi?id=194721

            Bug ID: 194721
           Summary: Reading /sys/bus/pci/devices/0000:01:00.0/config wakes
                    up Radeon dGPU
           Product: Drivers
           Version: 2.5
    Kernel Version: 4.8 and newer
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Video(DRI - non Intel)
          Assignee: drivers_video-dri@kernel-bugs.osdl.org
          Reporter: eugene.shalygin@gmail.com
        Regression: No

Created attachment 254957
  --> https://bugzilla.kernel.org/attachment.cgi?id=254957&action=edit
dmesg

In ArchLinux with kernel 4.8 and newer accessing file
/sys/bus/pci/devices/0000:01:00.0/config wakes up dGPU (like DRI_PRIME=1
glxinfo would do). Since many program read that file at startup, this is highly
annoying. 

$ lspci 
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor
DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor
PCI Express x16 Controller (rev 06)
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor
Integrated Graphics Controller (rev 06)
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor
HD Audio Controller (rev 06)
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family
USB xHCI (rev 05)
00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series
Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family
USB EHCI #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High
Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI
Express Root Port #1 (rev d5)
00:1c.1 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI
Express Root Port #2 (rev d5)
00:1c.2 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI
Express Root Port #3 (rev d5)
00:1c.3 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI
Express Root Port #4 (rev d5)
00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family
USB EHCI #1 (rev 05)
00:1f.0 ISA bridge: Intel Corporation HM87 Express LPC Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family
6-port SATA Controller 1 [AHCI mode] (rev 05)
00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus
Controller (rev 05)
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI]
Neptune XT [Radeon HD 8970M]
03:00.0 PCI bridge: Texas Instruments XIO2213A/B/XIO2221 PCI Express to PCI
Bridge [Cheetah Express] (rev 01)
04:00.0 FireWire (IEEE 1394): Texas Instruments XIO2213A/B/XIO2221 IEEE-1394b
OHCI Controller [Cheetah Express] (rev 01)
05:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTL8411 PCI
Express Card Reader (rev 01)
05:00.2 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411
PCI Express Gigabit Ethernet Controller (rev 0a)
06:00.0 Network controller: Intel Corporation Wireless 7260 (rev bb)

At the same time on the almost identical machine running Gentoo:
$ diff -U 1 lspci.txt lspci.txt.gentoo 
+01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI]
Neptune XT [Radeon HD 8970M] (rev ff)
 03:00.0 PCI bridge: Texas Instruments XIO2213A/B/XIO2221 PCI Express to PCI
Bridge [Cheetah Express] (rev 01)
@@ -21,2 +21,2 @@
 05:00.2 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411
PCI Express Gigabit Ethernet Controller (rev 0a)
-06:00.0 Network controller: Intel Corporation Wireless 7260 (rev bb)
+06:00.0 Network controller: Intel Corporation Wireless 7260 (rev 73)

this does not happen. Rebuilding kernel with copied from the Gentoo machine
config changed nothing. The attached dmesg output contains several such events
at the end of the file.

When the dGPU is disabled using acpi_call and its example turn_off_gpu.sh
script, accessing the /sys/bus/pci/devices/0000:01:00.0/config hangs a process
(it does not react to SIGKILL).

Comments

bugzilla-daemon@bugzilla.kernel.org Feb. 27, 2017, 9:05 a.m. UTC | #1
https://bugzilla.kernel.org/show_bug.cgi?id=194721

Eugene Shalygin (eugene.shalygin@gmail.com) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Regression|No                          |Yes
bugzilla-daemon@bugzilla.kernel.org Feb. 27, 2017, 9:05 a.m. UTC | #2
https://bugzilla.kernel.org/show_bug.cgi?id=194721

Eugene Shalygin (eugene.shalygin@gmail.com) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|All                         |x86-64
bugzilla-daemon@bugzilla.kernel.org Feb. 28, 2017, 1:15 a.m. UTC | #3
https://bugzilla.kernel.org/show_bug.cgi?id=194721

--- Comment #1 from Michel Dänzer (michel@daenzer.net) ---
This is https://bugs.freedesktop.org/show_bug.cgi?id=98502 .

I suspect reading the config file always powered up the GPU, but Mesa only
recently started reading the file.
bugzilla-daemon@bugzilla.kernel.org Feb. 28, 2017, 1:39 a.m. UTC | #4
https://bugzilla.kernel.org/show_bug.cgi?id=194721

--- Comment #2 from Eugene Shalygin (eugene.shalygin@gmail.com) ---
Excuse me, but as it is written in the bug report, this was never the case
before, and does not happen on my second (almost identical) laptop which runs
Gentoo and kernel 4.10.0 right now.
bugzilla-daemon@bugzilla.kernel.org Feb. 28, 2017, 1:41 a.m. UTC | #5
https://bugzilla.kernel.org/show_bug.cgi?id=194721

--- Comment #3 from Michel Dänzer (michel@daenzer.net) ---
Are both laptops using the same version of Mesa?
bugzilla-daemon@bugzilla.kernel.org Feb. 28, 2017, 1:44 a.m. UTC | #6
https://bugzilla.kernel.org/show_bug.cgi?id=194721

--- Comment #4 from Eugene Shalygin (eugene.shalygin@gmail.com) ---
Yes, 17.0.0. But does it matter? The problem manifests itself when I do
$ cat /sys/bus/pci/devices/0000:01:00.0/config

or lspci does read this file.
bugzilla-daemon@bugzilla.kernel.org Feb. 28, 2017, 1:48 a.m. UTC | #7
https://bugzilla.kernel.org/show_bug.cgi?id=194721

--- Comment #5 from Eugene Shalygin (eugene.shalygin@gmail.com) ---
And the second problem is even worse: if the dGPU was disabled using acpi_call,
any read from that file hangs the reading process somewhere in the kernel. This
also was neither the case before nor happen on the Gentoo machine or in Arch
Linux with kernel version < 4.8.
bugzilla-daemon@bugzilla.kernel.org May 5, 2017, 6:22 p.m. UTC | #8
https://bugzilla.kernel.org/show_bug.cgi?id=194721

mathieu.westphal@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mathieu.westphal@gmail.com

--- Comment #6 from mathieu.westphal@gmail.com ---
I reproduce this bug as well.

lspci hangs and freeze the system.
diff mbox

Patch

--- lspci.txt   2017-02-27 09:55:03.885457274 +0100
+++ lspci.txt.gentoo    2017-02-27 09:55:21.978499749 +0100
@@ -16,3 +16,3 @@ 
 00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus
Controller (rev 05)
-01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI]
Neptune XT [Radeon HD 8970M]