diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index 291c43448764..0500320545c4 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -2794,7 +2794,7 @@ static int ufs_qcom_get_rx_fom(struct ufs_hba *hba, if (ret) { dev_err(hba->dev, "%s: Failed to apply TX EQ settings for HS-G%u: %d\n", __func__, gear, ret); - return ret; + goto link_recover_and_restore; } /* Force PMC to target HS Gear to use new TX Equalization settings. */ @@ -2802,16 +2802,15 @@ static int ufs_qcom_get_rx_fom(struct ufs_hba *hba, if (ret) { dev_err(hba->dev, "%s: Failed to change power mode to HS-G%u, Rate-%s: %d\n", __func__, gear, ufs_hs_rate_to_str(rate), ret); - return ret; + goto link_recover_and_restore; } ret = ufs_qcom_host_sw_rx_fom(hba, pwr_mode->lane_rx, fom); - if (ret) { + if (ret) dev_err(hba->dev, "Failed to get SW FOM of TX (PreShoot: %u, DeEmphasis: %u): %d\n", d_iter->preshoot, d_iter->deemphasis, ret); - return ret; - } +link_recover_and_restore: /* Restore Device's TX Equalization settings. */ ret = ufshcd_apply_tx_eq_settings(hba, &hba->tx_eq_params[gear - 1], gear); if (ret) {