From patchwork Wed Feb 17 22:20:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael Wysocki X-Patchwork-Id: 80098 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1HMLe8L013424 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 17 Feb 2010 22:22:16 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NhsFs-0005I7-UJ; Wed, 17 Feb 2010 22:20:24 +0000 Received: from sfi-mx-2.v28.ch3.sourceforge.com ([172.29.28.122] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NhsFs-0005Hz-5n for dri-devel@lists.sourceforge.net; Wed, 17 Feb 2010 22:20:24 +0000 X-ACL-Warn: Received: from ogre.sisk.pl ([217.79.144.158]) by sfi-mx-2.v28.ch3.sourceforge.com with esmtp (Exim 4.69) id 1NhsFq-00083g-JS for dri-devel@lists.sourceforge.net; Wed, 17 Feb 2010 22:20:24 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by ogre.sisk.pl (Postfix) with ESMTP id 200DC1782AE; Wed, 17 Feb 2010 23:00:51 +0100 (CET) Received: from ogre.sisk.pl ([127.0.0.1]) by localhost (ogre.sisk.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 15736-09; Wed, 17 Feb 2010 23:00:44 +0100 (CET) Received: from tosh.localnet (220-bem-13.acn.waw.pl [82.210.184.220]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ogre.sisk.pl (Postfix) with ESMTP id F3B8C17823D; Wed, 17 Feb 2010 23:00:43 +0100 (CET) From: "Rafael J. Wysocki" To: Pedro Ribeiro Subject: Re: 2.6.33-rc8 regression on i915: resume from hibernate locks up every 2nd time Date: Wed, 17 Feb 2010 23:20:57 +0100 User-Agent: KMail/1.12.4 (Linux/2.6.33-rc8-rjw; KDE/4.3.5; x86_64; ; ) References: <74fd948d1002171047g70d2bba0l957e264dfbc8ea23@mail.gmail.com> <201002172152.39255.rjw@sisk.pl> <74fd948d1002171410l5688c3dfy125ac5c7e80ad1a1@mail.gmail.com> In-Reply-To: <74fd948d1002171410l5688c3dfy125ac5c7e80ad1a1@mail.gmail.com> MIME-Version: 1.0 Message-Id: <201002172320.57491.rjw@sisk.pl> X-Virus-Scanned: amavisd-new at ogre.sisk.pl using MkS_Vir for Linux X-Spam-Score: -1.8 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.8 AWL AWL: From: address is in the auto white-list X-Headers-End: 1NhsFq-00083g-JS Cc: dri-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 17 Feb 2010 22:22:17 +0000 (UTC) Index: linux-2.6/drivers/gpu/drm/i915/i915_drv.c =================================================================== --- linux-2.6.orig/drivers/gpu/drm/i915/i915_drv.c +++ linux-2.6/drivers/gpu/drm/i915/i915_drv.c @@ -177,6 +177,8 @@ MODULE_DEVICE_TABLE(pci, pciidlist); static int i915_drm_freeze(struct drm_device *dev) { + struct drm_i915_private *dev_priv = dev->dev_private; + pci_save_state(dev->pdev); /* If KMS is active, we do the leavevt stuff here */ @@ -192,17 +194,12 @@ static int i915_drm_freeze(struct drm_de i915_save_state(dev); - return 0; -} - -static void i915_drm_suspend(struct drm_device *dev) -{ - struct drm_i915_private *dev_priv = dev->dev_private; - intel_opregion_free(dev, 1); /* Modeset on resume, not lid events */ dev_priv->modeset_on_lid = 0; + + return 0; } static int i915_suspend(struct drm_device *dev, pm_message_t state) @@ -222,8 +219,6 @@ static int i915_suspend(struct drm_devic if (error) return error; - i915_drm_suspend(dev); - if (state.event == PM_EVENT_SUSPEND) { /* Shut down the device */ pci_disable_device(dev->pdev); @@ -238,6 +233,10 @@ static int i915_drm_thaw(struct drm_devi struct drm_i915_private *dev_priv = dev->dev_private; int error = 0; + i915_restore_state(dev); + + intel_opregion_init(dev, 1); + /* KMS EnterVT equivalent */ if (drm_core_check_feature(dev, DRIVER_MODESET)) { mutex_lock(&dev->struct_mutex); @@ -264,10 +263,6 @@ static int i915_resume(struct drm_device pci_set_master(dev->pdev); - i915_restore_state(dev); - - intel_opregion_init(dev, 1); - return i915_drm_thaw(dev); } @@ -424,8 +419,6 @@ static int i915_pm_suspend(struct device if (error) return error; - i915_drm_suspend(drm_dev); - pci_disable_device(pdev); pci_set_power_state(pdev, PCI_D3hot); @@ -465,13 +458,8 @@ static int i915_pm_poweroff(struct devic { struct pci_dev *pdev = to_pci_dev(dev); struct drm_device *drm_dev = pci_get_drvdata(pdev); - int error; - - error = i915_drm_freeze(drm_dev); - if (!error) - i915_drm_suspend(drm_dev); - return error; + return i915_drm_freeze(drm_dev); } const struct dev_pm_ops i915_pm_ops = {