diff options
author | Dave Airlie <airlied@redhat.com> | 2021-10-28 07:59:38 +0300 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2021-10-28 07:59:38 +0300 |
commit | 970eae15600a883e4ad27dd0757b18871cc983ab (patch) | |
tree | 7aeb639a35ca2ab8b54a5987837f8ac5f96ee5f4 /net/smc/smc_wr.h | |
parent | 27f4432577e4f78bbdf15c104748cc738db8eead (diff) | |
parent | 3906fe9bb7f1a2c8667ae54e967dc8690824f4ea (diff) | |
download | linux-970eae15600a883e4ad27dd0757b18871cc983ab.tar.xz |
BackMerge tag 'v5.15-rc7' into drm-next
The msm next tree is based on rc3, so let's just backmerge rc7 before pulling it in.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'net/smc/smc_wr.h')
-rw-r--r-- | net/smc/smc_wr.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/net/smc/smc_wr.h b/net/smc/smc_wr.h index 423b8709f1c9..2bc626f230a5 100644 --- a/net/smc/smc_wr.h +++ b/net/smc/smc_wr.h @@ -60,6 +60,20 @@ static inline void smc_wr_tx_set_wr_id(atomic_long_t *wr_tx_id, long val) atomic_long_set(wr_tx_id, val); } +static inline bool smc_wr_tx_link_hold(struct smc_link *link) +{ + if (!smc_link_usable(link)) + return false; + atomic_inc(&link->wr_tx_refcnt); + return true; +} + +static inline void smc_wr_tx_link_put(struct smc_link *link) +{ + if (atomic_dec_and_test(&link->wr_tx_refcnt)) + wake_up_all(&link->wr_tx_wait); +} + static inline void smc_wr_wakeup_tx_wait(struct smc_link *lnk) { wake_up_all(&lnk->wr_tx_wait); |