Skip to content

Commit

Permalink
fast-reboot: creset PHBs on fast reboot
Browse files Browse the repository at this point in the history
On fast reboot, perform a creset of all PHBs. This ensures that any PHBs
that are fenced will be working after the reboot.

A later patch will disable CAPI mode during cresets - as such, PHBs in CAPI
mode will return to regular PCIe mode during a fast reboot.

Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
ajdlinux authored and stewartsmith committed Mar 20, 2017
1 parent 37546ae commit a1eba9d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions core/pci.c
Expand Up @@ -1528,6 +1528,8 @@ static void __pci_reset(struct list_head *list)
void pci_reset(void)
{
unsigned int i;
struct pci_slot *slot;
int64_t rc;

prlog(PR_NOTICE, "PCI: Clearing all devices...\n");

Expand All @@ -1539,6 +1541,25 @@ void pci_reset(void)
if (!phb)
continue;
__pci_reset(&phb->devices);

slot = phb->slot;
if (!slot || !slot->ops.creset) {
PCINOTICE(phb, 0, "Can't do complete reset\n");
} else {
rc = slot->ops.creset(slot);
while (rc > 0) {
time_wait(rc);
rc = slot->ops.poll(slot);
}
if (rc < 0) {
PCIERR(phb, 0, "Complete reset failed, aborting"
"fast reboot (rc=%lld)\n", rc);
if (platform.cec_reboot)
platform.cec_reboot();
while (true) {}
}
}

if (phb->ops->ioda_reset)
phb->ops->ioda_reset(phb, true);
}
Expand Down

0 comments on commit a1eba9d

Please sign in to comment.