[Skiboot] [PATCH v2 5/8] capp/phb4: Force CAPP to PCIe mode during kernel shutdown
Vaibhav Jain
vaibhav at linux.ibm.com
Mon Dec 10 18:04:45 AEDT 2018
Andrew Donnellan <andrew.donnellan at au1.ibm.com> writes:
>> +static bool phb4_host_sync_reset(void *data)
>> +{
>> + struct phb4 *p = (struct phb4 *)data;
>> + struct phb *phb = &p->phb;
>> + int64_t rc = 0;
>> +
>> + /* Make sure no-one modifies the phb flags while we are active */
>> + phb_lock(phb);
>> +
>> + /* Make sure CAPP is attached to the PHB */
>> + if (phb->capp)
>> + /* Call phb ops to disable capi */
>> + rc = phb->ops->set_capi_mode(phb, OPAL_PHB_CAPI_MODE_PCIE,
>> + phb->capp->attached_pe);
>> + else
>> + rc = OPAL_SUCCESS;
>
> This code is fine, but I'm assuming that set_capi_mode() will still
> return OPAL_SUCCESS if the CAPP isn't attached, right?
No, with phb->capp un-initialized phb4_set_capi_mode() will return
OPAL_UNSUPPORTED and opal_sync_host_reboot() will return OPAL_BUSY_EVENT
back to kernel which will then continue to call opal_sync_host_reboot()
> ...
>
>> static int64_t phb4_poll_link(struct pci_slot *slot)
>> {
>> struct phb4 *p = phb_to_phb4(slot->phb);
>> @@ -4419,7 +4450,7 @@ static int64_t phb4_init_capp(struct phb4 *p)
>> capp->capp_xscom_offset = CAPP1_REG_OFFSET;
>> }
>>
>> - capp->attached_pe = phb4_get_reserved_pe_number(phb);
>> + capp->attached_pe = phb4_get_reserved_pe_number(&p->phb);
>>
>> /* Load capp microcode into the capp unit */
>> load_capp_ucode(p);
>> @@ -4462,7 +4493,8 @@ static int64_t phb4_set_capi_mode(struct phb *phb, uint64_t mode,
>> break;
>> }
>>
>> - xscom_read(p->chip_id, CAPP_ERR_STATUS_CTRL + offset, ®);
>> + xscom_read(p->chip_id, CAPP_ERR_STATUS_CTRL +
>> + capp->capp_xscom_offset, ®);
>
> These two hunks need to be moved to previous patches - snowpatch is
> reporting this breaks bisection.
Thanks for pointing this out. I will get it fixed
>
> With that fixed:
>
> Reviewed-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>
Thanks,
--
Vaibhav Jain <vaibhav at linux.ibm.com>
Linux Technology Center, IBM India Pvt. Ltd.
More information about the Skiboot
mailing list