[PATCH linux v4 17/20] drivers/fsi: Set slave SMODE to init communications

Christopher Bostic christopher.lee.bostic at gmail.com
Tue Oct 18 02:08:13 AEDT 2016


On Mon, Oct 17, 2016 at 2:04 AM, Jeremy Kerr <jk at ozlabs.org> wrote:
> Hi Chris,
>
>> @@ -301,15 +376,26 @@ static int fsi_master_link_enable(struct fsi_master *master, int link)
>>  static int fsi_master_break(struct fsi_master *master, int link)
>>  {
>>       int rc;
>> +     uint32_t smode;
>>
>>       if (!master->send_break)
>>               return -EINVAL;
>>
>> -     rc =  master->send_break(master, link);
>> -     if (rc)
>> +     rc = master->send_break(master, link);
>> +     if (rc) {
>>               dev_info(master->dev, "break failed with:%d\n", rc);
>> +             return rc;
>> +     }
>> +     /* Verify can read slave at default ID location */
>> +     rc = master->read(master, link, 3, FSI_SLAVE_BASE + FSI_SMODE,
>> +                     &smode, sizeof(smode));
>>
>> -     return rc;
>> +     /* If read fails then nothing on other end of link */
>> +     if (rc)
>> +             return -ENODEV;
>> +
>> +     dev_dbg(master->dev, "smode at ID 3 after break:%08x\n", smode);
>> +     return 0;
>>  }
>
> Should this smode read logic be in fsi_master_break() at all?
>
> I'd be inclined to keep the slave detection separate. If it's necessary
> to check for slave presence, we can do that in the caller.

Hi Jeremy,

OK, will move.

Thanks,
-Chris

>
> Cheers,
>
>
> Jeremy


More information about the openbmc mailing list