From patchwork Thu May 18 08:05:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Wunner X-Patchwork-Id: 9732889 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 25A3B601A1 for ; Thu, 18 May 2017 08:13:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E86622B26 for ; Thu, 18 May 2017 08:13:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0233C287C8; Thu, 18 May 2017 08:13:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 228AD22B26 for ; Thu, 18 May 2017 08:13:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D2C4189307; Thu, 18 May 2017 08:13:01 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 476 seconds by postgrey-1.35 at gabe; Thu, 18 May 2017 08:13:00 UTC Received: from mailout2.hostsharing.net (mailout2.hostsharing.net [83.223.90.233]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5A95489307; Thu, 18 May 2017 08:13:00 +0000 (UTC) Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout2.hostsharing.net (Postfix) with ESMTPS id 2C3A61008D0D9; Thu, 18 May 2017 10:04:27 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 26093138295; Thu, 18 May 2017 10:05:01 +0200 (CEST) Date: Thu, 18 May 2017 10:05:01 +0200 From: Lukas Wunner To: Nicolai Stange Subject: Re: [REGRESSION] drm/radeon: Don't register Thunderbolt eGPU with vga_switcheroo Message-ID: <20170518080501.GA31002@wunner.de> References: <87h90jkx88.fsf@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87h90jkx88.fsf@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Alex Deucher , dri-devel@lists.freedesktop.org, Christian =?iso-8859-1?Q?K=F6nig?= , amd-gfx@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 -- 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