From 829a5071ccf040b78bd93286a218580c66833b00 Mon Sep 17 00:00:00 2001 From: Yuval Mintz Date: Sat, 1 Jun 2013 23:02:26 +0000 Subject: [PATCH] bnx2x: fix a power state test If PCIe supports PM capabilities, bnx2x will always claim eeprom is accessible as PCI_D0 is zero. Reported-by: Dan Carpenter Signed-off-by: Yuval Mintz Signed-off-by: Ariel Elior Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index 72b1b59294b4..7c6faebb1838 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c @@ -1390,7 +1390,8 @@ static bool bnx2x_is_nvm_accessible(struct bnx2x *bp) rc = pci_read_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, &pm); - if ((rc && !netif_running(dev)) || (!rc && ((pm & PCI_D0) != PCI_D0))) + if ((rc && !netif_running(dev)) || + (!rc && ((pm & PCI_PM_CTRL_STATE_MASK) != PCI_D0))) return false; return true; -- 2.39.5