[REGRESSION] drm/radeon: Don't register Thunderbolt eGPU with vga_switcheroo
diff mbox

Message ID 20170518080501.GA31002@wunner.de
State New
Headers show

Commit Message

Lukas Wunner May 18, 2017, 8:05 a.m. UTC
On Wed, May 17, 2017 at 11:08:23PM +0200, Nicolai Stange wrote:
> I'm experiencing a boot failure on next-20170515:
> 
>   BUG: unable to handle kernel NULL pointer dereference at 00000000000007cb
>   IP: radeon_driver_load_kms+0xeb/0x230 [radeon]
[snip]
> Bisection lead to commit 7ffb0ce31cf9 ("drm/radeon: Don't register
> Thunderbolt eGPU with vga_switcheroo"). Reverting this commit on top of
> next-20170515 fixes the issue for me.
> 
> My box is a Dell laptop which most certainly hasn't got any Thunderbolt
> circuitry.

Thanks a lot Nicolai for reporting this, my apologies for the breakage
which turns out to be a dereference of rdev->pdev before it's set. :-(

14:   e8 e7 c0 0e 00          callq  0xec100	      	 ; radeon_has_atpx()
19:   84 c0                   test   %al,%al
1b:   74 9a                   je     0xffffffffffffffb7
1d:   41 f7 c5 00 00 02 00    test   $0x20000,%r13d	 ; flags & RADEON_IS_IGP
24:   75 91                   jne    0xffffffffffffffb7
26:   49 8b 44 24 10          mov    0x10(%r12),%rax	 ; rax = rdev
2b:*  0f b6 90 cb 07 00 00    movzbl 0x7cb(%rax),%edx         <-- trapping instruction

Could you verify if the patch below fixes the issue for you?

Thanks!

Lukas

-- >8 --

Patch
diff mbox

diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index e3e7cb1..4761f27 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -116,7 +116,7 @@  int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
 	if ((radeon_runtime_pm != 0) &&
 	    radeon_has_atpx() &&
 	    ((flags & RADEON_IS_IGP) == 0) &&
-	    !pci_is_thunderbolt_attached(rdev->pdev))
+	    !pci_is_thunderbolt_attached(dev->pdev))
 		flags |= RADEON_IS_PX;
 
 	/* radeon_device_init should report only fatal error