diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gv100/nvlink_gv100.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gv100/nvlink_gv100.c b/drivers/gpu/nvgpu/gv100/nvlink_gv100.c index 7e25c946..c87a3ce9 100644 --- a/drivers/gpu/nvgpu/gv100/nvlink_gv100.c +++ b/drivers/gpu/nvgpu/gv100/nvlink_gv100.c | |||
@@ -2482,7 +2482,8 @@ int gv100_nvlink_link_set_sublink_mode(struct gk20a *g, u32 link_id, | |||
2482 | bool is_rx_sublink, u32 mode) | 2482 | bool is_rx_sublink, u32 mode) |
2483 | { | 2483 | { |
2484 | int err = 0; | 2484 | int err = 0; |
2485 | u32 rx_sublink_state, tx_sublink_state; | 2485 | u32 rx_sublink_state = nvgpu_nvlink_sublink_rx__last; |
2486 | u32 tx_sublink_state = nvgpu_nvlink_sublink_tx__last; | ||
2486 | u32 reg; | 2487 | u32 reg; |
2487 | 2488 | ||
2488 | if (!(BIT(link_id) & g->nvlink.enabled_links)) | 2489 | if (!(BIT(link_id) & g->nvlink.enabled_links)) |
@@ -2492,8 +2493,12 @@ int gv100_nvlink_link_set_sublink_mode(struct gk20a *g, u32 link_id, | |||
2492 | if (err) | 2493 | if (err) |
2493 | return err; | 2494 | return err; |
2494 | 2495 | ||
2495 | rx_sublink_state = g->ops.nvlink.get_rx_sublink_state(g, link_id); | 2496 | if (is_rx_sublink) |
2496 | tx_sublink_state = g->ops.nvlink.get_tx_sublink_state(g, link_id); | 2497 | rx_sublink_state = g->ops.nvlink.get_rx_sublink_state(g, |
2498 | link_id); | ||
2499 | else | ||
2500 | tx_sublink_state = g->ops.nvlink.get_tx_sublink_state(g, | ||
2501 | link_id); | ||
2497 | 2502 | ||
2498 | switch (mode) { | 2503 | switch (mode) { |
2499 | case nvgpu_nvlink_sublink_tx_hs: | 2504 | case nvgpu_nvlink_sublink_tx_hs: |
@@ -2656,7 +2661,7 @@ u32 gv100_nvlink_link_get_sublink_mode(struct gk20a *g, u32 link_id, | |||
2656 | return nvgpu_nvlink_sublink_tx_safe; | 2661 | return nvgpu_nvlink_sublink_tx_safe; |
2657 | if (state == nvl_sl0_slsm_status_tx_primary_state_off_v()) | 2662 | if (state == nvl_sl0_slsm_status_tx_primary_state_off_v()) |
2658 | return nvgpu_nvlink_sublink_tx_off; | 2663 | return nvgpu_nvlink_sublink_tx_off; |
2659 | return nvgpu_nvlink_sublink_tx_off; | 2664 | return nvgpu_nvlink_sublink_tx__last; |
2660 | } else { | 2665 | } else { |
2661 | state = g->ops.nvlink.get_rx_sublink_state(g, link_id); | 2666 | state = g->ops.nvlink.get_rx_sublink_state(g, link_id); |
2662 | if (state == nvl_sl1_slsm_status_rx_primary_state_hs_v()) | 2667 | if (state == nvl_sl1_slsm_status_rx_primary_state_hs_v()) |
@@ -2667,7 +2672,7 @@ u32 gv100_nvlink_link_get_sublink_mode(struct gk20a *g, u32 link_id, | |||
2667 | return nvgpu_nvlink_sublink_rx_safe; | 2672 | return nvgpu_nvlink_sublink_rx_safe; |
2668 | if (state == nvl_sl1_slsm_status_rx_primary_state_off_v()) | 2673 | if (state == nvl_sl1_slsm_status_rx_primary_state_off_v()) |
2669 | return nvgpu_nvlink_sublink_rx_off; | 2674 | return nvgpu_nvlink_sublink_rx_off; |
2670 | return nvgpu_nvlink_sublink_rx_off; | 2675 | return nvgpu_nvlink_sublink_rx__last; |
2671 | } | 2676 | } |
2672 | return nvgpu_nvlink_sublink_tx__last; | 2677 | return nvgpu_nvlink_sublink_tx__last; |
2673 | } | 2678 | } |