Skip to content

Commit d79c0a2

Browse files
Sathya Perladavem330
authored andcommitted
be2net: do not use SCRATCHPAD register
The CUST_SCRATCHPAD_CSR register is used for marking if FW cleanup is needed. This is used in a crash kernel scenario. Do no use this register as it is not available for some functions. Instead, always issue an FLR when a function is probed *except* when VFs are preset (enabled in the previous PF load). Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 421737b commit d79c0a2

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

‎drivers/net/ethernet/emulex/benet/be_hw.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@
5858

5959
#define SLI_PORT_CONTROL_IP_MASK 0x08000000
6060

61-
#define PCICFG_CUST_SCRATCHPAD_CSR 0x1EC
62-
6361
/********* Memory BAR register ************/
6462
#define PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET 0xfc
6563
/* Host Interrupt Enable, if set interrupts are enabled although "PCI Interrupt

‎drivers/net/ethernet/emulex/benet/be_main.c‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,8 @@ static int be_find_vfs(struct be_adapter *adapter, int vf_state)
10491049
u16 offset, stride;
10501050

10511051
pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV);
1052+
if (!pos)
1053+
return 0;
10521054
pci_read_config_word(pdev, pos + PCI_SRIOV_VF_OFFSET, &offset);
10531055
pci_read_config_word(pdev, pos + PCI_SRIOV_VF_STRIDE, &stride);
10541056

@@ -2542,7 +2544,6 @@ static int be_clear(struct be_adapter *adapter)
25422544
be_cmd_fw_clean(adapter);
25432545

25442546
be_msix_disable(adapter);
2545-
pci_write_config_dword(adapter->pdev, PCICFG_CUST_SCRATCHPAD_CSR, 0);
25462547
return 0;
25472548
}
25482549

@@ -2785,8 +2786,6 @@ static int be_setup(struct be_adapter *adapter)
27852786

27862787
schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000));
27872788
adapter->flags |= BE_FLAGS_WORKER_SCHEDULED;
2788-
2789-
pci_write_config_dword(adapter->pdev, PCICFG_CUST_SCRATCHPAD_CSR, 1);
27902789
return 0;
27912790
err:
27922791
be_clear(adapter);
@@ -3724,10 +3723,7 @@ static void be_worker(struct work_struct *work)
37243723

37253724
static bool be_reset_required(struct be_adapter *adapter)
37263725
{
3727-
u32 reg;
3728-
3729-
pci_read_config_dword(adapter->pdev, PCICFG_CUST_SCRATCHPAD_CSR, &reg);
3730-
return reg;
3726+
return be_find_vfs(adapter, ENABLED) > 0 ? false : true;
37313727
}
37323728

37333729
static int __devinit be_probe(struct pci_dev *pdev,

0 commit comments

Comments
 (0)