]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ixgbe: set device if before calling get_invariants
authorEmil Tantilov <emil.s.tantilov@intel.com>
Wed, 12 Oct 2016 19:34:25 +0000 (12:34 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Sat, 25 Feb 2017 05:48:12 +0000 (21:48 -0800)
Orabug: 24568240

Fix an issue where set_phy_power was NULL for X550 copper devices
because get_invariants was called before hw->device_id was set.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 55570b6f5e2caa37a5bbd634cbe5ed126d3656f9)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

index 487571d1208d6a50dd94ca6d8e116720a50ebf68..cc223dcb3fbc4c534a035050ce24b44cef699f44 100644 (file)
@@ -5617,7 +5617,8 @@ static void ixgbe_init_dcb(struct ixgbe_adapter *adapter)
  * Fields are initialized based on PCI device information and
  * OS network device settings (MTU size).
  **/
-static int ixgbe_sw_init(struct ixgbe_adapter *adapter)
+static int ixgbe_sw_init(struct ixgbe_adapter *adapter,
+                        const struct ixgbe_info *ii)
 {
        struct ixgbe_hw *hw = &adapter->hw;
        struct pci_dev *pdev = adapter->pdev;
@@ -5632,6 +5633,9 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter)
        hw->subsystem_vendor_id = pdev->subsystem_vendor;
        hw->subsystem_device_id = pdev->subsystem_device;
 
+       /* get_invariants needs the device IDs */
+       ii->get_invariants(hw);
+
        /* Set common capability flags and settings */
        rss = min_t(int, ixgbe_max_rss_indices(adapter), num_online_cpus());
        adapter->ring_feature[RING_F_RSS].limit = rss;
@@ -9061,10 +9065,8 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        hw->phy.mdio.mdio_read = ixgbe_mdio_read;
        hw->phy.mdio.mdio_write = ixgbe_mdio_write;
 
-       ii->get_invariants(hw);
-
        /* setup the private structure */
-       err = ixgbe_sw_init(adapter);
+       err = ixgbe_sw_init(adapter, ii);
        if (err)
                goto err_sw_init;