Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

thunderbolt: Software CM only should set force power in Tiger Lake

When Software CM is running it should not send any NHI mailbox command
during PM flows. Only force power bit needs to be set and cleared so
change Tiger Lake (well and Ice Lake) nhi_ops to take this into account.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>

+16 -9
+16 -9
drivers/thunderbolt/nhi_ops.c
··· 121 121 122 122 static int icl_nhi_suspend(struct tb_nhi *nhi) 123 123 { 124 + struct tb *tb = pci_get_drvdata(nhi->pdev); 124 125 int ret; 125 126 126 127 if (icl_nhi_is_device_connected(nhi)) 127 128 return 0; 128 129 129 - /* 130 - * If there is no device connected we need to perform both: a 131 - * handshake through LC mailbox and force power down before 132 - * entering D3. 133 - */ 134 - icl_nhi_lc_mailbox_cmd(nhi, ICL_LC_PREPARE_FOR_RESET); 135 - ret = icl_nhi_lc_mailbox_cmd_complete(nhi, ICL_LC_MAILBOX_TIMEOUT); 136 - if (ret) 137 - return ret; 130 + if (tb_switch_is_icm(tb->root_switch)) { 131 + /* 132 + * If there is no device connected we need to perform 133 + * both: a handshake through LC mailbox and force power 134 + * down before entering D3. 135 + */ 136 + icl_nhi_lc_mailbox_cmd(nhi, ICL_LC_PREPARE_FOR_RESET); 137 + ret = icl_nhi_lc_mailbox_cmd_complete(nhi, ICL_LC_MAILBOX_TIMEOUT); 138 + if (ret) 139 + return ret; 140 + } 138 141 139 142 return icl_nhi_force_power(nhi, false); 140 143 } 141 144 142 145 static int icl_nhi_suspend_noirq(struct tb_nhi *nhi, bool wakeup) 143 146 { 147 + struct tb *tb = pci_get_drvdata(nhi->pdev); 144 148 enum icl_lc_mailbox_cmd cmd; 145 149 146 150 if (!pm_suspend_via_firmware()) 147 151 return icl_nhi_suspend(nhi); 152 + 153 + if (!tb_switch_is_icm(tb->root_switch)) 154 + return 0; 148 155 149 156 cmd = wakeup ? ICL_LC_GO2SX : ICL_LC_GO2SX_NO_WAKE; 150 157 icl_nhi_lc_mailbox_cmd(nhi, cmd);