lkml.org 
[lkml]   [2020]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [alsa-devel] [PATCH] soundwire: bus: fix device number leak on errors
From
Date


On 1/14/20 12:37 AM, Vinod Koul wrote:
> On 13-01-20, 16:56, Pierre-Louis Bossart wrote:
>> If the programming of the dev_number fails due to an IO error, a new
>> device_number will be assigned, resulting in a leak.
>>
>> Make sure we only assign a device_number once per Slave device.
>
> Although I am not sure if this would be a leak, we assign a new num and
> old number should have gotten recycled as they would be unattached
> status.

When you program the device number and it fails, there is still a
Device0 reporting as attached, so you will loop and try to assign a new
device number. In this case there is never a transition to UNATTACHED,
the Slave remains ATTACHED as Device0 until the enumeration succeed with
a successful non-zero device number.

This only happened to us w/ early prototypes where the PCB routing was
questionable and the speed too high, but still it's useful to keep this
device number constant

> Anyway this is good improvement as it helps to debug having same
> dev_num, so Applied, thanks

Thanks.

\
 
 \ /
  Last update: 2020-01-14 18:49    [W:0.024 / U:20.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site