From patchwork Sun Sep 8 12:10:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Trippelsdorf X-Patchwork-Id: 2858451 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 78AB99F495 for ; Sun, 8 Sep 2013 12:19:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A0E9920208 for ; Sun, 8 Sep 2013 12:19:41 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E6219201DA for ; Sun, 8 Sep 2013 12:19:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AECFDE6924 for ; Sun, 8 Sep 2013 05:19:36 -0700 (PDT) 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 C1474E68F9 for ; Sun, 8 Sep 2013 05:17:40 -0700 (PDT) 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=pPOhcMxnt9ALOiiNRR3P1t4iUL TjJrqnI4/9Mp+c96s=; b=sOa8AyoDHmMFKiz+3Wdg9NCXkSNOpd8cdX5QeAQGms UfloK7ObauuyC6l+TCldte6w1+l64TM/08eygrSKu/26A1nGkTbMwklay+nDKjy1 3+JisvKklMj6xWmFYazqtObMPok3bcRWsYnH8ZZfM297zhPS4zTb6y4M3gwI0Fco Y= Received: (qmail 27504 invoked from network); 8 Sep 2013 14:10:59 +0200 Received: from unknown (HELO x4) (ud10?360p3@91.64.96.185) by mail.ud10.udmedia.de with ESMTPSA (DHE-RSA-AES256-SHA encrypted, authenticated); 8 Sep 2013 14:10:59 +0200 Date: Sun, 8 Sep 2013 14:10:58 +0200 From: Markus Trippelsdorf To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/3] drm/radeon: Implement radeon_pci_shutdown Message-ID: <20130908121058.GC360@x4> References: <20130908120947.GA360@x4> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130908120947.GA360@x4> Cc: kexec@lists.infradead.org, Eric Biederman 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+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.7 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 Currently radeon devices are not properbly shutdown during kexec. This cases a varity of issues, e.g. dpm initialization failures. Fix this by implementing a radeon_pci_shutdown function, that unloads the driver cleanly. Signed-off-by: Markus Trippelsdorf --- drivers/gpu/drm/radeon/radeon_drv.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index cb4445f..d71edee 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -380,6 +380,15 @@ static const struct file_operations radeon_driver_kms_fops = { #endif }; + +static void +radeon_pci_shutdown(struct pci_dev *pdev) +{ + struct drm_device *dev = pci_get_drvdata(pdev); + + radeon_driver_unload_kms(dev); +} + static struct drm_driver kms_driver = { .driver_features = DRIVER_USE_AGP | @@ -453,6 +462,7 @@ static struct pci_driver radeon_kms_pci_driver = { .remove = radeon_pci_remove, .suspend = radeon_pci_suspend, .resume = radeon_pci_resume, + .shutdown = radeon_pci_shutdown, }; static int __init radeon_init(void)