thunderbolt: Ignore port locked error in tb_port_wait_for_link_width()
Sometimes when polling for the port after target link width is changed we get back port locked notification (because the link actually was reset and then re-trained). Instead of bailing out we can ignore these when polling for the width change as this is expected. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
This commit is contained in:
@@ -1168,10 +1168,17 @@ int tb_port_wait_for_link_width(struct tb_port *port, int width,
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
ret = tb_port_get_link_width(port);
|
ret = tb_port_get_link_width(port);
|
||||||
if (ret < 0)
|
if (ret < 0) {
|
||||||
return ret;
|
/*
|
||||||
else if (ret == width)
|
* Sometimes we get port locked error when
|
||||||
|
* polling the lanes so we can ignore it and
|
||||||
|
* retry.
|
||||||
|
*/
|
||||||
|
if (ret != -EACCES)
|
||||||
|
return ret;
|
||||||
|
} else if (ret == width) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
usleep_range(1000, 2000);
|
usleep_range(1000, 2000);
|
||||||
} while (ktime_before(ktime_get(), timeout));
|
} while (ktime_before(ktime_get(), timeout));
|
||||||
|
|||||||
Reference in New Issue
Block a user