OSDN Git Service

drm/bridge: tc358767: fix poll timeouts
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 9 Dec 2019 08:27:07 +0000 (10:27 +0200)
committerNeil Armstrong <narmstrong@baylibre.com>
Mon, 10 Feb 2020 09:18:21 +0000 (10:18 +0100)
commit8a6483ac634acda3f599f50082c652d2d37199c7
treea996212823155378fec0738c0dfc5072fa57a395
parent7e0cf7e9936c4358b0863357b90aa12afe6489da
drm/bridge: tc358767: fix poll timeouts

Link training fails with:

  Link training timeout waiting for LT_LOOPDONE!
  main link enable error: -110

This is caused by too tight timeouts, which were changed recently in
aa92213f388b ("drm/bridge: tc358767: Simplify polling in tc_link_training()").

With a quick glance, the commit does not change the timeouts. However,
the method of delaying/sleeping is different, and as the timeout in the
previous implementation was not explicit, the new version in practice
has much tighter timeout.

The same change was made to other parts in the driver, but the link
training timeout is the only one I have seen causing issues.
Nevertheless, 1 us sleep is not very sane, and the timeouts look pretty
tight, so lets fix all the timeouts.

One exception was the aux busy poll, where the poll sleep was much
longer than necessary (or optimal).

I measured the times on my setup, and now the sleep times are set to
such values that they result in multiple loops, but not too many (say,
5-10 loops). The timeouts were all increased to 100ms, which should be
more than enough for all of these, but in case of bad errors, shouldn't
stop the driver as multi-second timeouts could do.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Fixes: aa92213f388b ("drm/bridge: tc358767: Simplify polling in tc_link_training()")
Tested-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191209082707.24531-1-tomi.valkeinen@ti.com
drivers/gpu/drm/bridge/tc358767.c