Commit 58cf663f authored by Mark Rustad's avatar Mark Rustad Committed by Jeff Kirsher
Browse files

ixgbe: Add bit to mark service task initialization

There needs to be an indication when the service task has been
initialized. This is because register access prior to that time
can detect a removal and attempt to schedule the service task.
Adding the __IXGBE_SERVICE_INITED bit allows this to be checked
and if not set prevent the service task scheduling. By checking
for a removal right after initialization, the probe can be failed
at that point without getting the service task involved.
Signed-off-by: default avatarMark Rustad <>
Tested-by: default avatarPhil Schmitt <>
Signed-off-by: default avatarJeff Kirsher <>
parent 6d39d589
......@@ -811,6 +811,7 @@ enum ixgbe_state_t {
......@@ -297,6 +297,7 @@ static void ixgbe_remove_adapter(struct ixgbe_hw *hw)
hw->hw_addr = NULL;
e_dev_err("Adapter removed\n");
if (test_bit(__IXGBE_SERVICE_INITED, &adapter->state))
......@@ -8023,6 +8024,10 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* EEPROM */
memcpy(&hw->eeprom.ops, ii->eeprom_ops, sizeof(hw->eeprom.ops));
if (ixgbe_removed(hw->hw_addr)) {
err = -EIO;
goto err_ioremap;
/* If EEPROM is valid (bit 8 = 1), use default otherwise use bit bang */
if (!(eec & (1 << 8)))
hw-> = &ixgbe_read_eeprom_bit_bang_generic;
......@@ -8185,7 +8190,12 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
setup_timer(&adapter->service_timer, &ixgbe_service_timer,
(unsigned long) adapter);
if (ixgbe_removed(hw->hw_addr)) {
err = -EIO;
goto err_sw_init;
INIT_WORK(&adapter->service_task, ixgbe_service_task);
set_bit(__IXGBE_SERVICE_INITED, &adapter->state);
clear_bit(__IXGBE_SERVICE_SCHED, &adapter->state);
err = ixgbe_init_interrupt_scheme(adapter);
......@@ -8494,6 +8504,9 @@ static pci_ers_result_t ixgbe_io_error_detected(struct pci_dev *pdev,
#endif /* CONFIG_PCI_IOV */
if (!test_bit(__IXGBE_SERVICE_INITED, &adapter->state))
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