summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt/clx.c
AgeCommit message (Collapse)AuthorFilesLines
2023-10-13thunderbolt: Check for unplugged router in tb_switch_clx_disable()Mika Westerberg1-0/+3
There is no point disabling CL states if the router is unplugged so in that case return early. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2023-10-13thunderbolt: Make tb_switch_clx_is_supported() staticMika Westerberg1-22/+22
This function is not used outside of clx.c so make it static. No functional changes. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2023-06-16thunderbolt: Enable CL2 low power stateMika Westerberg1-12/+19
For USB4 v2 routers we can also enable CL2 which allows better power savings and thermal management than CL0s and CL1. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2023-06-09thunderbolt: Disable CL states when a DMA tunnel is establishedMika Westerberg1-1/+1
Tunnels between hosts should not have CL states enabled because otherwise they might enter a low power state without the other end noticing which causes packets to be lost. For this reason disable all CL states upon first DMA tunnel creation. Once the last DMA tunnel is torn down we try to re-enable them. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2023-06-09thunderbolt: Make tb_switch_clx_disable() return CL states that were enabledMika Westerberg1-2/+6
This allows us to disable all CL states temporarily when running lane margining and then return back the previously enabled states. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2023-06-09thunderbolt: Initialize CL states from the hardwareMika Westerberg1-27/+73
In case the boot firmware enabled any of them, read the currently configured CL states and update the router structure accordingly. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2023-06-09thunderbolt: Prefix CL state related log messages with "CLx: "Mika Westerberg1-4/+4
This makes it easier to spot from the logs and follows what we do with the TMU code already. We also log enabling/disabling CL states using the tb_sw_dbg() instead of tb_port_dbg(). Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2023-06-09thunderbolt: Check for first depth router in tb.cMika Westerberg1-16/+6
Currently tb_switch_clx_enable() enables CL states only for the first depth router. This is something we may want to change in the future and in addition it is not visible from the calling path at all. For this reason do the check in the tb.c so it is immediately visible that we only do this for the first depth router. Fix the kernel-docs accordingly. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2023-06-09thunderbolt: Switch CL states from enum to a bitmaskMika Westerberg1-74/+95
This is more natural and follows the hardware register layout better. This makes it easier to see which CL states we enable (even though they should be enabled together). Rename 'clx_mask' to 'clx' everywhere as this is now always bitmask. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2023-06-09thunderbolt: Get rid of __tb_switch_[en|dis]able_clx()Mika Westerberg1-49/+42
No need to have separate functions for these so fold them into tb_switch_clx_enable() and tb_switch_clx_disable() accordingly. No functional changes. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2023-06-09thunderbolt: Move CLx support functions into clx.cMika Westerberg1-0/+362
There really don't belong to switch.c so move them into their own file. As we do this rename the functions to match the conventions used elsewhere in the driver. No functional changes. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>