[Skiboot] [PATCH 4/5] hw/phb3: add host sync notifier to trigger creset/CAPP disable on kexec

Andrew Donnellan andrew.donnellan at au1.ibm.com
Fri Jan 13 15:19:41 AEDT 2017


On 13/01/17 00:31, Frederic Barrat wrote:
>> +static bool phb3_host_sync_reset(void *data)
>> +{
>> +    struct phb3 *p = (struct phb3 *)data;
>> +    struct pci_slot *slot = p->phb.slot;
>> +    struct proc_chip *chip = get_chip(p->chip_id);
>> +    int64_t rc;
>> +
>> +    switch (slot->state) {
>> +    case PHB3_SLOT_NORMAL:
>> +        lock(&capi_lock);
>> +        rc = (chip->capp_phb3_attached_mask & (1 << p->index)) ?
>> +            OPAL_PHB_CAPI_MODE_CAPI :
>> +            OPAL_PHB_CAPI_MODE_PCIE;
>> +        unlock(&capi_lock);
>> +
>> +        if (rc == OPAL_PHB_CAPI_MODE_PCIE)
>> +            return true;
>> +
>> +        PHBINF(p, "PHB in CAPI mode, resetting\n");
>> +        p->flags &= ~PHB3_CAPP_RECOVERY;
>> +        phb3_creset(slot);
>> +        return false;
>> +    default:
>> +        rc = slot->ops.poll(slot);
>> +        return rc == OPAL_SUCCESS;
>> +    }
>> +}
>> +
>
>
> So it apparently relies on the kernel looping (in opal_shutdown()),
> which may be worth a comment...

Fair point.

Something like:

This helper is called repeatedly by the host sync notifier mechanism, 
which relies on the kernel to regularly poll the OPAL_SYNC_HOST_REBOOT 
call as it shuts down.

?

-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan at au1.ibm.com  IBM Australia Limited



More information about the Skiboot mailing list