Skip to contentSkip to conversation

bnx2x: fix a power state test

PATCH Applied Yuval Mintz 3 participants 3 messages Jun 2, 2013 – Jun 4, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bnx2x: fix a power state test

If PCIe supports PM capabilities, bnx2x will always claim eeprom is accessible as PCI_D0 is zero.

---
Hi Dave,

Please consider applying this to `net-next'.

Thanks,
Yuval

---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +2 -1
index 263950c..04a2ad5 100644
@@ -1391,7 +1391,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;
Signature · 1 line
1.8.1.227.g44fe835