@@ -469,10 +469,12 @@ struct eeh_pe *eeh_pe_find(struct pci_controller *phb,
* The whole PEs existing in the system are organized as hierarchy
* tree. The function is used to retrieve the parent PE according
* to the parent EEH device.
+ * Returns a referenced PE.
*/
static struct eeh_pe *eeh_pe_get_parent(struct eeh_dev *edev)
{
struct eeh_dev *parent;
+ struct eeh_pe *pe;
struct pci_dn *pdn = eeh_dev_to_pdn(edev);
/*
@@ -490,8 +492,14 @@ static struct eeh_pe *eeh_pe_get_parent(struct eeh_dev *edev)
if (!parent)
return NULL;
- if (parent->pe)
- return parent->pe;
+ if (parent->pe) {
+ /* TODO: Unsafe until eeh_dev can be synchronized
+ * with eeh_pe.
+ */
+ pe = parent->pe;
+ eeh_get_pe(pe);
+ return pe;
+ }
pdn = pdn->parent;
}
Synchronize access to eeh_pe. Signed-off-by: Sam Bobroff <sbobroff@linux.ibm.com> --- arch/powerpc/kernel/eeh_pe.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)