]> Gentwo Git Trees - linux/.git/commit
thunderbolt: Rework how tunnel->[init|deinit] hooks are called
authorMika Westerberg <mika.westerberg@linux.intel.com>
Tue, 20 Aug 2024 05:03:20 +0000 (08:03 +0300)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Fri, 3 Jan 2025 09:50:08 +0000 (11:50 +0200)
commitae765788936d9833647f02add49e9564345021cc
treecdb3022826540f4bba26308716ead6c4a6b55ed6
parent693b5bb6f6e567e4743e0df182a0844be539e381
thunderbolt: Rework how tunnel->[init|deinit] hooks are called

The way these are called is not exactly symmetric as it is supposed to
be: the former is called when tunnel is being activated and the latter
is called when it is being released (not when it is being de-activated).

Furthermore host-to-host (DMA) tunnels are abusing the ->deinit hook to
clear out the credits. This makes it quite hard to follow what is being
called and when.

For these reasons rework the two "init" hooks to be called symmetrically
and rename them accordingly. For the DMA one, add a new hook that is
specifically used to run clean up for the tunnel when its memory is
being released.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/tunnel.c
drivers/thunderbolt/tunnel.h