Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <dan.carpenter@oracle.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Yuval Mintz and committed by
David S. Miller
829a5071 639d65b8

+2 -1
+2 -1
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
··· 1390 1390 rc = pci_read_config_word(bp->pdev, 1391 1391 bp->pm_cap + PCI_PM_CTRL, &pm); 1392 1392 1393 - if ((rc && !netif_running(dev)) || (!rc && ((pm & PCI_D0) != PCI_D0))) 1393 + if ((rc && !netif_running(dev)) || 1394 + (!rc && ((pm & PCI_PM_CTRL_STATE_MASK) != PCI_D0))) 1394 1395 return false; 1395 1396 1396 1397 return true;