lkml.org 
[lkml]   [2019]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v3 20/36] thunderbolt: Deactivate all paths before restarting them
    Date
    State of the connected devices and tunnel configuration is not known
    during resume. For example some paths may not be complete anymore if the
    user has unplugged the related devices. So instead of marking all paths
    as inactive we go ahead and deactivate them explicitly before we restart
    them.

    Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    ---
    drivers/thunderbolt/tunnel.c | 12 +++++++++++-
    1 file changed, 11 insertions(+), 1 deletion(-)

    diff --git a/drivers/thunderbolt/tunnel.c b/drivers/thunderbolt/tunnel.c
    index 91d7e00516b4..e109578da175 100644
    --- a/drivers/thunderbolt/tunnel.c
    +++ b/drivers/thunderbolt/tunnel.c
    @@ -185,8 +185,18 @@ int tb_tunnel_restart(struct tb_tunnel *tunnel)

    tb_tunnel_info(tunnel, "activating\n");

    + /*
    + * Make sure all paths are properly disabled before enabling
    + * them again.
    + */
    + for (i = 0; i < tunnel->npaths; i++) {
    + if (tunnel->paths[i]->activated) {
    + tb_path_deactivate(tunnel->paths[i]);
    + tunnel->paths[i]->activated = false;
    + }
    + }
    +
    for (i = 0; i < tunnel->npaths; i++) {
    - tunnel->paths[i]->activated = false;
    res = tb_path_activate(tunnel->paths[i]);
    if (res)
    goto err;
    --
    2.20.1
    \
     
     \ /
      Last update: 2019-03-28 13:38    [W:2.078 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site