Commit af89d26c authored by Shannon Nelson's avatar Shannon Nelson Committed by Jeff Kirsher

i40e: check MAC type before any REG access

We need to check if we are dealing with the correct MAC type before we
try to read anything from the registers.

Change-Id: I3989516999d06c3009e87d6a2eafc20af305c5c2
Signed-off-by: default avatarKamil Krawczyk <kamil.krawczyk@intel.com>
Signed-off-by: default avatarShannon Nelson <shannon.nelson@intel.com>
Tested-by: default avatarKavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 5f9116ac
...@@ -180,14 +180,6 @@ i40e_status i40e_init_shared_code(struct i40e_hw *hw) ...@@ -180,14 +180,6 @@ i40e_status i40e_init_shared_code(struct i40e_hw *hw)
i40e_status status = 0; i40e_status status = 0;
u32 reg; u32 reg;
hw->phy.get_link_info = true;
/* Determine port number */
reg = rd32(hw, I40E_PFGEN_PORTNUM);
reg = ((reg & I40E_PFGEN_PORTNUM_PORT_NUM_MASK) >>
I40E_PFGEN_PORTNUM_PORT_NUM_SHIFT);
hw->port = (u8)reg;
i40e_set_mac_type(hw); i40e_set_mac_type(hw);
switch (hw->mac.type) { switch (hw->mac.type) {
...@@ -198,6 +190,14 @@ i40e_status i40e_init_shared_code(struct i40e_hw *hw) ...@@ -198,6 +190,14 @@ i40e_status i40e_init_shared_code(struct i40e_hw *hw)
break; break;
} }
hw->phy.get_link_info = true;
/* Determine port number */
reg = rd32(hw, I40E_PFGEN_PORTNUM);
reg = ((reg & I40E_PFGEN_PORTNUM_PORT_NUM_MASK) >>
I40E_PFGEN_PORTNUM_PORT_NUM_SHIFT);
hw->port = (u8)reg;
/* Determine the PF number based on the PCI fn */ /* Determine the PF number based on the PCI fn */
reg = rd32(hw, I40E_GLPCI_CAPSUP); reg = rd32(hw, I40E_GLPCI_CAPSUP);
if (reg & I40E_GLPCI_CAPSUP_ARI_EN_MASK) if (reg & I40E_GLPCI_CAPSUP_ARI_EN_MASK)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment