[PATCH linux dev-4.7 v2 6/7] drivers/fsi: Cleanup bus errors

Christopher Bostic cbostic at linux.vnet.ibm.com
Thu Feb 23 09:51:18 AEDT 2017



On 2/22/17 3:55 PM, Jeremy Kerr wrote:
> Hi Chris,
>
>> @@ -255,6 +263,10 @@ int hub_master_break(struct fsi_master *master, int linkno)
>>   	uint32_t break_offset = 0x4; /* hw workaround */
>>   	uint32_t addr;
>>   
>> +	/* config table lists 2 entries per hub link */
>> +	if (linkno >= (master->n_links / 2))
>> +		return -ENODEV;
>> +
> master->n_links should represent the actual number of links, rather than
> reflect what's in the config table.
>
> [besides, don't we do the / 2 during the config table parse anyway?]

Hi Jeremy,

Yes that's true, its set in scan so no need for the /2 here - will fix.


>>   	command = FSI_BREAK;
>>   	addr = (linkno * FSI_MASTER_HUB_LINK_SIZE) + hub->base;
>>   	return fsi_slave_write(hub->slave, addr + break_offset, &command,
>> @@ -641,6 +653,28 @@ static int fsi_master_break(struct fsi_master *master, int link)
>>   
>>   void fsi_master_handle_error(struct fsi_master *master, uint32_t addr)
>>   {
>> +	uint32_t smode = FSI_SLAVE_SMODE_DFLT;
>> +
>> +	/* Avoid nested error handling */
>> +	if (test_and_set_bit(FSI_IN_ERR_CLEANUP, &fsi_state))
>> +		return;
> Do we have any other bits of state to represent? If not, just use a
> plain atomic_t rather than a set of flags.
No others at this point,  will change to an atomic_t

Thanks,
Chris

> Cheers,
>
>
> Jeremy
>



More information about the openbmc mailing list