From patchwork Sat Jul 31 00:59:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirsher, Jeffrey T" X-Patchwork-Id: 116154 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6V15UcO031948 for ; Sat, 31 Jul 2010 01:05:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751445Ab0GaBFa (ORCPT ); Fri, 30 Jul 2010 21:05:30 -0400 Received: from qmta11.westchester.pa.mail.comcast.net ([76.96.59.211]:60803 "EHLO QMTA11.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750970Ab0GaBF3 (ORCPT ); Fri, 30 Jul 2010 21:05:29 -0400 Received: from omta18.westchester.pa.mail.comcast.net ([76.96.62.90]) by QMTA11.westchester.pa.mail.comcast.net with comcast id oQF01e0091wpRvQ5BQzZR9; Sat, 31 Jul 2010 00:59:33 +0000 Received: from localhost.localdomain ([63.64.152.142]) by omta18.westchester.pa.mail.comcast.net with comcast id oQzD1e00934bfcX3eQzGaw; Sat, 31 Jul 2010 00:59:31 +0000 From: Jeff Kirsher Subject: [RFC PATCH 2/2] igb/ixgbe: add code to trigger function reset if reset_devices is set To: davem@davemloft.net, jbarnes@virtuousgeek.org Cc: netdev@vger.kernel.org, linux-pci@vger.kernel.org, Alexander Duyck , Jeff Kirsher Date: Fri, 30 Jul 2010 17:59:12 -0700 Message-ID: <20100731005910.32625.89518.stgit@localhost.localdomain> In-Reply-To: <20100731005803.32625.6891.stgit@localhost.localdomain> References: <20100731005803.32625.6891.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 31 Jul 2010 01:05:31 +0000 (UTC) diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 667b527..b924443 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c @@ -1731,6 +1731,9 @@ static int __devinit igb_probe(struct pci_dev *pdev, return -EINVAL; } + if (reset_devices && pci_reset_device_function(pdev)) + return -ENODEV; + err = pci_enable_device_mem(pdev); if (err) return err; diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 7d6a415..f459f24 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c @@ -6548,6 +6548,9 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, return -EINVAL; } + if (reset_devices && pci_reset_device_function(pdev)) + return -ENODEV; + err = pci_enable_device_mem(pdev); if (err) return err;