public inbox for dri-devel@lists.freedesktop.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugzilla.kernel.org
To: dri-devel@lists.freedesktop.org
Subject: [Bug 73901] Kernel crash after modprobe radeon runpm=1
Date: Mon, 14 Apr 2014 22:15:43 +0000	[thread overview]
Message-ID: <bug-73901-2300-vuAQ1P0TKz@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-73901-2300@https.bugzilla.kernel.org/>

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

--- Comment #9 from Pali Rohár <pali.rohar@gmail.com> ---
I looked into radeon_atpx_handler.c code and I found reason why radeon kernel
driver does not detect ATPX...

First here is lspci output:
00:02.0 VGA compatible controller [0300]: Intel Corporation 4th Gen Core
Processor Integrated Graphics Controller [8086:0416] (rev 06)
01:00.0 Display controller [0380]: Advanced Micro Devices, Inc. [AMD/ATI] Sun
XT [Radeon HD 8670A/8670M/8690M] [1002:6660]

Second here is relevant code of function radeon_atpx_detect(void) from file
radeon_atpx_handler.c

    int vga_count = 0;

    while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {
        vga_count++;

        has_atpx |= (radeon_atpx_pci_probe_handle(pdev) == true);
    }

    if (has_atpx && vga_count == 2) { ... ATPX was detected ... }

And some defines (from pci_ids.h):

#define PCI_CLASS_DISPLAY_VGA        0x0300
#define PCI_CLASS_DISPLAY_OTHER        0x0380

Because my Radeon card has pci class 0380 and not 0300 it is not checked for
ATPX in while loop and so vgaswitcheroo is not enabled.

I created this quick & dirty patch and after that runpm=1 working without any
crash.

--- radeon_atpx_handler.c.orig    2014-04-14 17:36:36.583744668 +0200
+++ radeon_atpx_handler.c    2014-04-14 23:50:53.354492060 +0200
@@ -528,6 +528,12 @@ static bool radeon_atpx_detect(void)
         has_atpx |= (radeon_atpx_pci_probe_handle(pdev) == true);
     }

+    while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_OTHER << 8, pdev)) != NULL)
{
+        vga_count++;
+
+        has_atpx |= (radeon_atpx_pci_probe_handle(pdev) == true);
+    }
+
     if (has_atpx && vga_count == 2) {
         acpi_get_name(radeon_atpx_priv.atpx.handle, ACPI_FULL_PATHNAME,
&buffer);
         printk(KERN_INFO "VGA switcheroo: detected switching method %s
handle\n",

Now also vgaswitcheroo debugfs file appeared:

$ sudo cat /sys/kernel/debug/vgaswitcheroo/switch
0:IGD:+:Pwr:0000:00:02.0
1:DIS: :DynPwr:0000:01:00.0

Alex, I think that now you have everything needed for implementing proper fix
for this bug.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2014-04-14 22:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-12 18:44 [Bug 73901] New: Kernel crash after modprobe radeon runpm=1 bugzilla-daemon
2014-04-12 18:44 ` [Bug 73901] " bugzilla-daemon
2014-04-12 18:45 ` bugzilla-daemon
2014-04-14 14:18 ` bugzilla-daemon
2014-04-14 15:28 ` bugzilla-daemon
2014-04-14 15:28 ` bugzilla-daemon
2014-04-14 16:57 ` bugzilla-daemon
2014-04-14 17:21 ` bugzilla-daemon
2014-04-14 17:22 ` bugzilla-daemon
2014-04-14 17:25 ` bugzilla-daemon
2014-04-14 17:31 ` bugzilla-daemon
2014-04-14 22:15 ` bugzilla-daemon [this message]
2014-04-14 23:06 ` bugzilla-daemon
2014-04-14 23:07 ` bugzilla-daemon
2014-04-15  8:02 ` bugzilla-daemon
2014-04-15  8:07 ` bugzilla-daemon
2014-04-15 13:22 ` bugzilla-daemon
2014-04-20 20:53 ` bugzilla-daemon
2014-04-22 20:12 ` bugzilla-daemon
2014-07-12 21:36 ` bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-73901-2300-vuAQ1P0TKz@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@bugzilla.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox