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

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>

authored by

Sathya Perla and committed by
David S. Miller
d79c0a20 421737bd

+3 -9
-2
drivers/net/ethernet/emulex/benet/be_hw.h
··· 58 58 59 59 #define SLI_PORT_CONTROL_IP_MASK 0x08000000 60 60 61 - #define PCICFG_CUST_SCRATCHPAD_CSR 0x1EC 62 - 63 61 /********* Memory BAR register ************/ 64 62 #define PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET 0xfc 65 63 /* Host Interrupt Enable, if set interrupts are enabled although "PCI Interrupt
+3 -7
drivers/net/ethernet/emulex/benet/be_main.c
··· 1049 1049 u16 offset, stride; 1050 1050 1051 1051 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV); 1052 + if (!pos) 1053 + return 0; 1052 1054 pci_read_config_word(pdev, pos + PCI_SRIOV_VF_OFFSET, &offset); 1053 1055 pci_read_config_word(pdev, pos + PCI_SRIOV_VF_STRIDE, &stride); 1054 1056 ··· 2544 2542 be_cmd_fw_clean(adapter); 2545 2543 2546 2544 be_msix_disable(adapter); 2547 - pci_write_config_dword(adapter->pdev, PCICFG_CUST_SCRATCHPAD_CSR, 0); 2548 2545 return 0; 2549 2546 } 2550 2547 ··· 2786 2785 2787 2786 schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000)); 2788 2787 adapter->flags |= BE_FLAGS_WORKER_SCHEDULED; 2789 - 2790 - pci_write_config_dword(adapter->pdev, PCICFG_CUST_SCRATCHPAD_CSR, 1); 2791 2788 return 0; 2792 2789 err: 2793 2790 be_clear(adapter); ··· 3723 3724 3724 3725 static bool be_reset_required(struct be_adapter *adapter) 3725 3726 { 3726 - u32 reg; 3727 - 3728 - pci_read_config_dword(adapter->pdev, PCICFG_CUST_SCRATCHPAD_CSR, &reg); 3729 - return reg; 3727 + return be_find_vfs(adapter, ENABLED) > 0 ? false : true; 3730 3728 } 3731 3729 3732 3730 static int __devinit be_probe(struct pci_dev *pdev,