From patchwork Fri Jan 18 11:42:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Khlebnikov X-Patchwork-Id: 2001221 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 0A8103FD86 for ; Fri, 18 Jan 2013 11:43:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752798Ab3ARLmW (ORCPT ); Fri, 18 Jan 2013 06:42:22 -0500 Received: from mail-la0-f41.google.com ([209.85.215.41]:56299 "EHLO mail-la0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753846Ab3ARLmT (ORCPT ); Fri, 18 Jan 2013 06:42:19 -0500 Received: by mail-la0-f41.google.com with SMTP id em20so3793486lab.0 for ; Fri, 18 Jan 2013 03:42:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=c+11gHlCD9aWqv1S6cQbTiUkiLz5w2lqoQmxMAXEUso=; b=S6Znvao6dzK924B4QK2qHbzyS5PfpI1pBCUd1MPeZ1c2P2GOVkKf5c2CiAy/IMCPU6 4VVKEfOqlFAsRPN19jdaDFY1HxTQNi/En/asGVRrKo/i6bF6+0J0GfXOTBhh2MtNzh0D 2veio7+/3UCtMjbrKyFy1G3MMMrQZIbcPNmtlMvUBiHAQmtTKLKbbRIQOs+cH4FJWfvs 7Pwh2RhE31nlcR3o7D0JLoU5rRsqIq8/ynA/7378abcyfLkfF2Dz9splpf2ErYN0I1aj h6d9tCYqwUzRCELGSBOWpevwWjHUqKD7UANSLkpcHszggqADcss+4Bjky7L79x0T5JKr o35g== X-Received: by 10.152.114.66 with SMTP id je2mr8048137lab.40.1358509337163; Fri, 18 Jan 2013 03:42:17 -0800 (PST) Received: from localhost (swsoft-msk-nat.sw.ru. [195.214.232.10]) by mx.google.com with ESMTPS id hc20sm1909035lab.11.2013.01.18.03.42.15 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Jan 2013 03:42:16 -0800 (PST) Subject: [PATCH 1/5] e1000e: fix resuming from runtime-suspend To: linux-kernel@vger.kernel.org From: Konstantin Khlebnikov Cc: e1000-devel@lists.sourceforge.net, linux-pci@vger.kernel.org, Bruce Allan , Jeff Kirsher Date: Fri, 18 Jan 2013 15:42:14 +0400 Message-ID: <20130118114214.6698.24975.stgit@zurg> In-Reply-To: <20130118113019.6698.25941.stgit@zurg> References: <20130118113019.6698.25941.stgit@zurg> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Bug was introduced in commit 23606cf5d1192c2b17912cb2ef6e62f9b11de133 ("e1000e / PCI / PM: Add basic runtime PM support (rev. 4)") in v2.6.35 Signed-off-by: Konstantin Khlebnikov Cc: e1000-devel@lists.sourceforge.net Cc: Jeff Kirsher Cc: Bruce Allan --- drivers/net/ethernet/intel/e1000e/netdev.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index fbf75fd..2853c11 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -5691,14 +5691,17 @@ static int e1000_runtime_suspend(struct device *dev) struct pci_dev *pdev = to_pci_dev(dev); struct net_device *netdev = pci_get_drvdata(pdev); struct e1000_adapter *adapter = netdev_priv(netdev); + int retval; + bool wake; - if (e1000e_pm_ready(adapter)) { - bool wake; + if (!e1000e_pm_ready(adapter)) + return 0; - __e1000_shutdown(pdev, &wake, true); - } + retval = __e1000_shutdown(pdev, &wake, true); + if (!retval) + e1000_power_off(pdev, true, wake); - return 0; + return retval; } static int e1000_idle(struct device *dev)