From patchwork Fri Jan 18 11:42:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Khlebnikov X-Patchwork-Id: 2001211 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 404863FD86 for ; Fri, 18 Jan 2013 11:43:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753028Ab3ARLnP (ORCPT ); Fri, 18 Jan 2013 06:43:15 -0500 Received: from mail-la0-f51.google.com ([209.85.215.51]:64515 "EHLO mail-la0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754466Ab3ARLmW (ORCPT ); Fri, 18 Jan 2013 06:42:22 -0500 Received: by mail-la0-f51.google.com with SMTP id fj20so3773926lab.10 for ; Fri, 18 Jan 2013 03:42:21 -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=sKBZyOSwsAO/rrIXHj/0RJglVPuDwQuxykrEz2Yk/4o=; b=KU0fire/8IFwDvfe6oiODqkjHO+ZQ43R9Mk95WYrbNKV/6x/tbfRH2rk7qidIjiquw 5n+idE4s1gTOyQJ/sUqobauz1wCHgsHmkwtbwxz7gHyfIcLuAKlCxB+p5f0QwDVo7h5y Ve8f+GEBTO2cQpailsURI/SgxzOmmzaM5iNpdnavbA61KCTHELHZHcROhVShK3AltoSh jrP5aSb4uCsfomNCiZWOBwMq3nc5KjSWFOsnTPWsZveZkyc1ZLbXjYnv2DBoRAK6QnH5 zhqfOliqz3FbEOxvejJdZqVNlAbzLpt7eztTlKqr49VX3ahjHumopgh+8ukEgsaZgcSe lEtA== X-Received: by 10.152.144.130 with SMTP id sm2mr8124016lab.49.1358509340962; Fri, 18 Jan 2013 03:42:20 -0800 (PST) Received: from localhost (swsoft-msk-nat.sw.ru. [195.214.232.10]) by mx.google.com with ESMTPS id ee5sm1980468lbb.14.2013.01.18.03.42.19 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Jan 2013 03:42:20 -0800 (PST) Subject: [PATCH 2/5] e1000e: fix pci device enable counter balance 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:18 +0400 Message-ID: <20130118114218.6698.42484.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 __e1000_shutdown() calls pci_disable_device() at the end, thus __e1000_resume() should call pci_enable_device_mem() to keep enable counter in balance. 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 Reviewed-by: Bjorn Helgaas Acked-by: Rafael J. Wysocki --- drivers/net/ethernet/intel/e1000e/netdev.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 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 2853c11..6bce796 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -5598,6 +5598,13 @@ static int __e1000_resume(struct pci_dev *pdev) pci_restore_state(pdev); pci_save_state(pdev); + err = pci_enable_device_mem(pdev); + if (err) { + dev_err(&pdev->dev, + "Cannot re-enable PCI device after suspend.\n"); + return err; + } + e1000e_set_interrupt_capability(adapter); if (netif_running(netdev)) { err = e1000_request_irq(adapter);