Skip to content

Commit eed4bdb

Browse files
Sam Bobroffmpe
authored andcommitted
powerpc/eeh: Cleanup unnecessary eeh_pe_state_mark_with_cfg()
The function eeh_pe_state_mark_with_cfg() just performs the work of eeh_pe_state_mark() and then, conditionally, the work of eeh_pe_state_clear(). However it is only ever called with a constant state such that the condition is always true, so replace it by direct calls. Signed-off-by: Sam Bobroff <sbobroff@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 5464492 commit eed4bdb

2 files changed

Lines changed: 4 additions & 24 deletions

File tree

‎arch/powerpc/kernel/eeh.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,15 +830,17 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state stat
830830
eeh_pe_state_clear(pe, EEH_PE_ISOLATED);
831831
break;
832832
case pcie_hot_reset:
833-
eeh_pe_state_mark_with_cfg(pe, EEH_PE_ISOLATED);
833+
eeh_pe_state_mark(pe, EEH_PE_ISOLATED);
834+
eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED);
834835
eeh_ops->set_option(pe, EEH_OPT_FREEZE_PE);
835836
eeh_pe_dev_traverse(pe, eeh_disable_and_save_dev_state, dev);
836837
if (!(pe->type & EEH_PE_VF))
837838
eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED);
838839
eeh_ops->reset(pe, EEH_RESET_HOT);
839840
break;
840841
case pcie_warm_reset:
841-
eeh_pe_state_mark_with_cfg(pe, EEH_PE_ISOLATED);
842+
eeh_pe_state_mark(pe, EEH_PE_ISOLATED);
843+
eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED);
842844
eeh_ops->set_option(pe, EEH_OPT_FREEZE_PE);
843845
eeh_pe_dev_traverse(pe, eeh_disable_and_save_dev_state, dev);
844846
if (!(pe->type & EEH_PE_VF))

‎arch/powerpc/kernel/eeh_pe.c‎

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -670,28 +670,6 @@ void eeh_pe_state_clear(struct eeh_pe *pe, int state)
670670
eeh_pe_traverse(pe, __eeh_pe_state_clear, &state);
671671
}
672672

673-
/**
674-
* eeh_pe_state_mark_with_cfg - Mark PE state with unblocked config space
675-
* @pe: PE
676-
* @state: PE state to be set
677-
*
678-
* Set specified flag to PE and its child PEs. The PCI config space
679-
* of some PEs is blocked automatically when EEH_PE_ISOLATED is set,
680-
* which isn't needed in some situations. The function allows to set
681-
* the specified flag to indicated PEs without blocking their PCI
682-
* config space.
683-
*/
684-
void eeh_pe_state_mark_with_cfg(struct eeh_pe *pe, int state)
685-
{
686-
eeh_pe_traverse(pe, __eeh_pe_state_mark, &state);
687-
if (!(state & EEH_PE_ISOLATED))
688-
return;
689-
690-
/* Clear EEH_PE_CFG_BLOCKED, which might be set just now */
691-
state = EEH_PE_CFG_BLOCKED;
692-
eeh_pe_traverse(pe, __eeh_pe_state_clear, &state);
693-
}
694-
695673
/*
696674
* Some PCI bridges (e.g. PLX bridges) have primary/secondary
697675
* buses assigned explicitly by firmware, and we probably have

0 commit comments

Comments
 (0)