[Skiboot] [PATCH v2 3/5] hw/phb3: disable CAPI mode during complete reset

Andrew Donnellan andrew.donnellan at au1.ibm.com
Mon Jan 16 19:35:17 AEDT 2017


On 16/01/17 10:26, Gavin Shan wrote:
>> +static void disable_capi_mode(struct phb3 *p)
>> +{
>> +	struct proc_chip *chip = get_chip(p->chip_id);
>> +	uint64_t reg;
>> +	uint32_t offset = PHB3_CAPP_REG_OFFSET(p);
>> +
>> +	lock(&capi_lock);
>> +
>> +	xscom_read(p->chip_id, PE_CAPP_EN + PE_REG_OFFSET(p), &reg);
>> +	if (!(reg & PPC_BIT(0))) {
>> +	        /* Not in CAPI mode, no action required */
>> +		unlock(&capi_lock);
>> +		return;
>> +	}
>> +
>> +	PHBDBG(p, "CAPP: Disabling CAPI mode\n");
>> +	if (!(chip->capp_phb3_attached_mask & (1 << p->index)))
>> +		PHBERR(p, "CAPP: CAPP attached mask not set!\n");
>> +
>> +	xscom_read(p->chip_id, CAPP_ERR_STATUS_CTRL + offset, &reg);
>> +	if (!(reg & PPC_BIT(0))) {
>> +		PHBERR(p, "CAPP: not in recovery, can't disable CAPI mode!\n");
>> +		return;
>
> I have no knowledge to understand the logic, but @capi_lock is missed
> to be released?

Good catch, will fix.

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



More information about the Skiboot mailing list