Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 829a5071 authored by Yuval Mintz's avatar Yuval Mintz Committed by David S. Miller
Browse files

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarYuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: default avatarAriel Elior <ariele@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 639d65b8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;