int config_addr;                /* Traditional PCI address      */
        int addr;                       /* PE configuration address     */
        struct pci_controller *phb;     /* Associated PHB               */
+       struct pci_bus *bus;            /* Top PCI bus for bus PE       */
        int check_count;                /* Times of ignored error       */
        int freeze_count;               /* Times of froze up            */
        int false_positives;            /* Times of reported #ff's      */
 
        pe->addr        = edev->pe_config_addr;
        pe->config_addr = edev->config_addr;
 
+       /*
+        * While doing PE reset, we probably hot-reset the
+        * upstream bridge. However, the PCI devices including
+        * the associated EEH devices might be removed when EEH
+        * core is doing recovery. So that won't safe to retrieve
+        * the bridge through downstream EEH device. We have to
+        * trace the parent PCI bus, then the upstream bridge.
+        */
+       if (eeh_probe_mode_dev())
+               pe->bus = eeh_dev_to_pci_dev(edev)->bus;
+
        /*
         * Put the new EEH PE into hierarchy tree. If the parent
         * can't be found, the newly created PE will be attached
                bus = pe->phb->bus;
        } else if (pe->type & EEH_PE_BUS ||
                   pe->type & EEH_PE_DEVICE) {
+               if (pe->bus) {
+                       bus = pe->bus;
+                       goto out;
+               }
+
                edev = list_first_entry(&pe->edevs, struct eeh_dev, list);
                pdev = eeh_dev_to_pci_dev(edev);
                if (pdev)
                        bus = pdev->bus;
        }
 
+out:
        eeh_unlock();
 
        return bus;