RDMA/hfi1: Use RMW accessors for changing LNKCTL2
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fri, 3 May 2024 13:36:40 +0000 (16:36 +0300)
committerLeon Romanovsky <leon@kernel.org>
Sun, 5 May 2024 13:11:40 +0000 (16:11 +0300)
commit8f3b7103b41314d26e2653e9ccca29480123a204
tree0626a6c5fd5c6c3417fc2c00f1919303ac9eaf75
parent44b607ad4cdf23ae8f796b95bd14709fa06f7728
RDMA/hfi1: Use RMW accessors for changing LNKCTL2

Convert open coded RMW accesses for LNKCTL2 to use
pcie_capability_clear_and_set_word() which makes its easier to
understand what the code tries to do.

In addition, this futureproofs the code. LNKCTL2 is not really owned by
any driver because it is a collection of control bits that PCI core
might need to touch. RMW accessors already have support for proper
locking for a selected set of registers to avoid losing concurrent
updates (LNKCTL2 is not yet among the registers that need protection
but likely will be in the future).

Suggested-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240503133640.15899-1-ilpo.jarvinen@linux.intel.com
Reviewed-by: Dean Luick <dean.luick@cornelisnetworks.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/hfi1/pcie.c