From patchwork Thu Dec 12 02:58:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Trippelsdorf X-Patchwork-Id: 3329601 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EEE809F1F0 for ; Thu, 12 Dec 2013 02:58:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2161E2037E for ; Thu, 12 Dec 2013 02:58:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DE9BB202E6 for ; Thu, 12 Dec 2013 02:58:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 970D2FADA3; Wed, 11 Dec 2013 18:58:08 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.ud10.udmedia.de (ud10.udmedia.de [194.117.254.50]) by gabe.freedesktop.org (Postfix) with ESMTP id D7759FADA3 for ; Wed, 11 Dec 2013 18:58:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=mail.ud10.udmedia.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=beta; bh=Xr1yxRytwpGsSyGudg2dE8gpyS 90LjEuflhsjQ+24Sw=; b=KFRuIdvGQRkk3PfX0GAhziSbegtHlZ0mBf7Tkl0rG4 /NuutLWKi1jp0WvXbcP9n93o8K+qV/w6orR/ozdeGxMfuPTGrOYK9hKVWwkjcn99 xICob6uJt6qgdPs+MLlNBaoJGa7KYiNMUK8DOxsME5MhMSku6lAOvUpHw1e6mxRk U= Received: (qmail 8363 invoked from network); 12 Dec 2013 03:58:00 +0100 Received: from unknown (HELO x4) (ud10?360p3@91.64.96.185) by mail.ud10.udmedia.de with ESMTPSA (DHE-RSA-AES256-SHA encrypted, authenticated); 12 Dec 2013 03:58:00 +0100 Date: Thu, 12 Dec 2013 03:58:00 +0100 From: Markus Trippelsdorf To: "Deucher, Alexander" Subject: Re: Can no longer shutdown after drm/radeon: Implement radeon_pci_shutdown Message-ID: <20131212025800.GA273@x4> References: <84mwk86x5a.wl%peter.chubb@nicta.com.au> <20131211072658.GA273@x4> <84txefdomu.wl%peter.chubb@nicta.com.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Cc: Peter Chubb , "dri-devel@lists.freedesktop.org" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 2013.12.11 at 23:46 +0000, Deucher, Alexander wrote: > > -----Original Message----- > > From: Peter Chubb [mailto:peter.chubb@nicta.com.au] > > Sent: Wednesday, December 11, 2013 5:11 PM > > To: Markus Trippelsdorf > > Cc: Peter Chubb; Deucher, Alexander; airlied@linux.ie; dri- > > devel@lists.freedesktop.org > > Subject: Re: Can no longer shutdown after drm/radeon: Implement > > radeon_pci_shutdown > > > > >>>>> "Markus" == Markus Trippelsdorf writes: > > > > Markus> On 2013.12.11 at 11:37 +1100, Peter Chubb wrote: > > > > Markus> It would be interesting to know where exactly it hangs. Could > > Markus> you comment out the *_fini(rdev) calls in > > Markus> radeon_driver_unload_kms > > (drivers/gpu/drm/radeon/radeon_kms.c) > > Markus> one after the other to find out which one is responsible? > > > > It's radeon_device_fini() that is the problem. > > I think the problem is that the drm subsystem tears down the device > via drm_driver.unload in drm_dev_unregister(), but now that we have a > pci_driver.shutdown callback (which is needed for kexec) that gets > called too so the driver gets torn down twice. If that is the case the following patch should fix the issue. Can you give it a try, Peter? diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 55d0b474bd37..539e5f1ff5e3 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c @@ -59,7 +59,8 @@ int radeon_driver_unload_kms(struct drm_device *dev) radeon_acpi_fini(rdev); radeon_modeset_fini(rdev); - radeon_device_fini(rdev); + if (!rdev->shutdown) + radeon_device_fini(rdev); done_free: kfree(rdev);