From ad7f9f7f534a276926a0aff6b2c0613b4bf24ce8 Mon Sep 17 00:00:00 2001 From: Vladislav Zolotarov Date: Mon, 19 Apr 2010 01:14:49 +0000 Subject: [PATCH] --- yaml --- r: 194296 b: refs/heads/master c: d3dbfee0d5ee4690824cbc5685bc9fe47a12bb8b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/net/bnx2x_main.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index c3d1fafb749e..99c7f3fc6041 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8eb5a20ccc67d85d52ead88fb263eb28814ca2b4 +refs/heads/master: d3dbfee0d5ee4690824cbc5685bc9fe47a12bb8b diff --git a/trunk/drivers/net/bnx2x_main.c b/trunk/drivers/net/bnx2x_main.c index d7c00748e270..c4bc006f5104 100644 --- a/trunk/drivers/net/bnx2x_main.c +++ b/trunk/drivers/net/bnx2x_main.c @@ -11935,6 +11935,14 @@ static int bnx2x_set_power_state(struct bnx2x *bp, pci_power_t state) break; case PCI_D3hot: + /* If there are other clients above don't + shut down the power */ + if (atomic_read(&bp->pdev->enable_cnt) != 1) + return 0; + /* Don't shut down the power for emulation and FPGA */ + if (CHIP_REV_IS_SLOW(bp)) + return 0; + pmcsr &= ~PCI_PM_CTRL_STATE_MASK; pmcsr |= 3; @@ -12551,9 +12559,7 @@ static int bnx2x_close(struct net_device *dev) /* Unload the driver, release IRQs */ bnx2x_nic_unload(bp, UNLOAD_CLOSE); - if (atomic_read(&bp->pdev->enable_cnt) == 1) - if (!CHIP_REV_IS_SLOW(bp)) - bnx2x_set_power_state(bp, PCI_D3hot); + bnx2x_set_power_state(bp, PCI_D3hot); return 0; }