lkml.org 
[lkml]   [2017]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [alsa-devel] [PATCH 08/14] soundwire: Add Slave status handling helpers
From
Date

>
>>> + if (found == false) {
>>> + /* TODO: Park this device in Group 13 */
>>> + dev_err(bus->dev, "Slave Entry not found");
>>
>> No break here? Otherwise...
>
> Thats intentional. We want to still read next device that show up
>
>>
>>> + }
>>> +
>>> + } while (ret == 0);
>>
>> ... the outer loop may go endlessly.
>> This condition doesn't look effective.
>
> not really. We cant keep reading successfully. At some point all slaves will
> ignore and return ENODATA and we exit. Bus errors will also make it exit
>
> BUT given that we have seen stuff i am inclined to add a counter, we cant
> have more than 11 device so that's a sane value to use :)

Yep. Keep in mind however that there could be theoretical corner cases:
if a device is enumerated, loses sync and becomes attached again while
you deal with others, you'd have more than 11 iterations.


\
 
 \ /
  Last update: 2017-10-31 22:19    [W:0.158 / U:0.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site