From patchwork Tue Mar 26 08:32:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Avri Altman X-Patchwork-Id: 782978 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0AA9BEEA8; Tue, 26 Mar 2024 08:33:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711442001; cv=none; b=umXRf3RXGVxH8SwRh67/Ess5U+hyuy2wdFXyhO5gAJLtWEUnMyGWisTWeE2czsz+zLvav0VhR63aK6PQiPHPwSy+8cuvF/4MsCWprsQO9J7MyUnf15DoTNnKIxLbeasaVnRNobTIQ7RbX0pfx0WWJXmxN/0YUgnp1SdHC374lKE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711442001; c=relaxed/simple; bh=Omr0cRds6Atsx+0DtQhcG//wTiSm+bz26TyhMod6BlE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=G3Ms9uxcQhPkWh/ncXP+rAja+xGS2HFOY6aasreg8i06wWN6Fyznz/nfyxIrgbRhLKg8i2KzvfFZl9DIgVKSn+3/ZNnIRTLqosFNBugJ2PeJgW074Yhp1n4EL2AAdLC6rfDylhaMbE0+3fLLhalTepH1knxNFlgqTMYVlmHVRXo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=lK4jjU7+; arc=none smtp.client-ip=216.71.154.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="lK4jjU7+" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1711441999; x=1742977999; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Omr0cRds6Atsx+0DtQhcG//wTiSm+bz26TyhMod6BlE=; b=lK4jjU7+xaYOF4a7/ewE5qMhLTuuqxjL1KPiBsGqU0lOJDdJwvQpFAmq RjPs7hNSBj0GIcRvh1AnulZ1JbvXYyjUOEbwwR4tTHCb5B+OJubg64IyS MLE8KBuW5BH4Bip0AP+5XS/vKrPOGDq3msNh9cqc73FY/FJqaR8GKDnLv KOttjTQe/eizVeKjsI7uQV9KZ5KpThHBoEswK9Eaq083lCk6/o84aRjrv 9rjQMXtGpucM248aujqU4rwmpSESn03U/UVDhDRHfQ/mggYSv7LzMZMhm HPYQ7gt4hJOXWEMl0HrnIJMrtSHuCYlw8z0VXD/NaS5DoOWVigYxkLvo0 w==; X-CSE-ConnectionGUID: LCb0ZaI2T/ujP4m+j7wWzQ== X-CSE-MsgGUID: hLYwWrrIS22lHCRG2B9pWA== X-IronPort-AV: E=Sophos;i="6.07,155,1708358400"; d="scan'208";a="12495278" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 26 Mar 2024 16:33:12 +0800 IronPort-SDR: CFqKlPTslS98Ukp7J/R/Yg6mJGaTUUKjnbSAWYA7b3xMdzNIAHm9jJMo/sQw0rSS9yF1hiVLoz jVarziEmGwDg== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 26 Mar 2024 00:41:57 -0700 IronPort-SDR: 8AYhFVs0a4Rb0/PjG8h7dfyQJYmRdbAOnsSueF6qM7wQlO3MHKY6tV1qRirk/1Qe0LtEsiAOX6 m8X7acX+tvHQ== WDCIronportException: Internal Received: from bxygm33.ad.shared ([10.45.31.229]) by uls-op-cesaip02.wdc.com with ESMTP; 26 Mar 2024 01:33:10 -0700 From: Avri Altman To: "James E . J . Bottomley" , "Martin K . Petersen" Cc: Bart Van Assche , Bean Huo , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Avri Altman Subject: [PATCH 1/2] scsi: ufs: Remove support for old UFSHCI versions Date: Tue, 26 Mar 2024 10:32:49 +0200 Message-ID: <20240326083253.1303-2-avri.altman@wdc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240326083253.1303-1-avri.altman@wdc.com> References: <20240326083253.1303-1-avri.altman@wdc.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 UFS spec version 2.1 was published more than 10 years ago. It is vanishingly unlikely that even there are out there platforms that uses earlier host controllers, let alone that those ancient platforms will ever run a V6.10 kernel. Thus, remove support of host controllers prior to UFS2.1. Signed-off-by: Avri Altman --- drivers/ufs/core/ufshcd.c | 73 ++++++++------------------------------- include/ufs/ufshci.h | 7 ---- 2 files changed, 15 insertions(+), 65 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 823bc28c0cb0..cda1939f2d8a 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -740,22 +740,6 @@ static int ufshcd_wait_for_register(struct ufs_hba *hba, u32 reg, u32 mask, return err; } -/** - * ufshcd_get_intr_mask - Get the interrupt bit mask - * @hba: Pointer to adapter instance - * - * Return: interrupt bit mask per version - */ -static inline u32 ufshcd_get_intr_mask(struct ufs_hba *hba) -{ - if (hba->ufs_version == ufshci_version(1, 0)) - return INTERRUPT_MASK_ALL_VER_10; - if (hba->ufs_version <= ufshci_version(2, 0)) - return INTERRUPT_MASK_ALL_VER_11; - - return INTERRUPT_MASK_ALL_VER_21; -} - /** * ufshcd_get_ufs_version - Get the UFS version supported by the HBA * @hba: Pointer to adapter instance @@ -992,10 +976,6 @@ EXPORT_SYMBOL_GPL(ufshcd_is_hba_active); u32 ufshcd_get_local_unipro_ver(struct ufs_hba *hba) { - /* HCI version 1.0 and 1.1 supports UniPro 1.41 */ - if (hba->ufs_version <= ufshci_version(1, 1)) - return UFS_UNIPRO_VER_1_41; - else return UFS_UNIPRO_VER_1_6; } EXPORT_SYMBOL(ufshcd_get_local_unipro_ver); @@ -2674,14 +2654,7 @@ static void ufshcd_enable_intr(struct ufs_hba *hba, u32 intrs) { u32 set = ufshcd_readl(hba, REG_INTERRUPT_ENABLE); - if (hba->ufs_version == ufshci_version(1, 0)) { - u32 rw; - rw = set & INTERRUPT_MASK_RW_VER_10; - set = rw | ((set ^ intrs) & intrs); - } else { - set |= intrs; - } - + set |= intrs; ufshcd_writel(hba, set, REG_INTERRUPT_ENABLE); } @@ -2694,16 +2667,7 @@ static void ufshcd_disable_intr(struct ufs_hba *hba, u32 intrs) { u32 set = ufshcd_readl(hba, REG_INTERRUPT_ENABLE); - if (hba->ufs_version == ufshci_version(1, 0)) { - u32 rw; - rw = (set & INTERRUPT_MASK_RW_VER_10) & - ~(intrs & INTERRUPT_MASK_RW_VER_10); - set = rw | ((set & intrs) & ~INTERRUPT_MASK_RW_VER_10); - - } else { - set &= ~intrs; - } - + set &= ~intrs; ufshcd_writel(hba, set, REG_INTERRUPT_ENABLE); } @@ -2715,21 +2679,17 @@ static void ufshcd_disable_intr(struct ufs_hba *hba, u32 intrs) * @upiu_flags: flags required in the header * @cmd_dir: requests data direction * @ehs_length: Total EHS Length (in 32‐bytes units of all Extra Header Segments) - * @legacy_type: UTP_CMD_TYPE_SCSI or UTP_CMD_TYPE_DEV_MANAGE */ static void ufshcd_prepare_req_desc_hdr(struct ufs_hba *hba, struct ufshcd_lrb *lrbp, u8 *upiu_flags, enum dma_data_direction cmd_dir, - int ehs_length, enum utp_cmd_type legacy_type) + int ehs_length) { struct utp_transfer_req_desc *req_desc = lrbp->utr_descriptor_ptr; struct request_desc_header *h = &req_desc->header; enum utp_data_direction data_direction; - if (hba->ufs_version <= ufshci_version(1, 1)) - lrbp->command_type = legacy_type; - else - lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE; + lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE; *h = (typeof(*h)){ }; @@ -2863,7 +2823,7 @@ static int ufshcd_compose_devman_upiu(struct ufs_hba *hba, u8 upiu_flags; int ret = 0; - ufshcd_prepare_req_desc_hdr(hba, lrbp, &upiu_flags, DMA_NONE, 0, UTP_CMD_TYPE_DEV_MANAGE); + ufshcd_prepare_req_desc_hdr(hba, lrbp, &upiu_flags, DMA_NONE, 0); if (hba->dev_cmd.type == DEV_CMD_TYPE_QUERY) ufshcd_prepare_utp_query_req_upiu(hba, lrbp, upiu_flags); @@ -2887,8 +2847,7 @@ static void ufshcd_comp_scsi_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) unsigned int ioprio_class = IOPRIO_PRIO_CLASS(req_get_ioprio(rq)); u8 upiu_flags; - ufshcd_prepare_req_desc_hdr(hba, lrbp, &upiu_flags, - lrbp->cmd->sc_data_direction, 0, UTP_CMD_TYPE_SCSI); + ufshcd_prepare_req_desc_hdr(hba, lrbp, &upiu_flags, lrbp->cmd->sc_data_direction, 0); if (ioprio_class == IOPRIO_CLASS_RT) upiu_flags |= UPIU_CMD_FLAGS_CP; ufshcd_prepare_utp_scsi_cmd_upiu(lrbp, upiu_flags); @@ -5565,15 +5524,13 @@ void ufshcd_compl_one_cqe(struct ufs_hba *hba, int task_tag, ufshcd_release_scsi_cmd(hba, lrbp); /* Do not touch lrbp after scsi done */ scsi_done(cmd); - } else if (lrbp->command_type == UTP_CMD_TYPE_DEV_MANAGE || - lrbp->command_type == UTP_CMD_TYPE_UFS_STORAGE) { - if (hba->dev_cmd.complete) { - if (cqe) { - ocs = le32_to_cpu(cqe->status) & MASK_OCS; - lrbp->utr_descriptor_ptr->header.ocs = ocs; - } - complete(hba->dev_cmd.complete); + } else { + WARN_ON(!hba->dev_cmd.complete); + if (cqe) { + ocs = le32_to_cpu(cqe->status) & MASK_OCS; + lrbp->utr_descriptor_ptr->header.ocs = ocs; } + complete(hba->dev_cmd.complete); } } @@ -7229,7 +7186,7 @@ static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba, ufshcd_setup_dev_cmd(hba, lrbp, cmd_type, 0, tag); - ufshcd_prepare_req_desc_hdr(hba, lrbp, &upiu_flags, DMA_NONE, 0, UTP_CMD_TYPE_DEV_MANAGE); + ufshcd_prepare_req_desc_hdr(hba, lrbp, &upiu_flags, DMA_NONE, 0); /* update the task tag in the request upiu */ req_upiu->header.task_tag = tag; @@ -7381,7 +7338,7 @@ int ufshcd_advanced_rpmb_req_handler(struct ufs_hba *hba, struct utp_upiu_req *r ufshcd_setup_dev_cmd(hba, lrbp, DEV_CMD_TYPE_RPMB, UFS_UPIU_RPMB_WLUN, tag); - ufshcd_prepare_req_desc_hdr(hba, lrbp, &upiu_flags, DMA_NONE, ehs, UTP_CMD_TYPE_DEV_MANAGE); + ufshcd_prepare_req_desc_hdr(hba, lrbp, &upiu_flags, DMA_NONE, ehs); /* update the task tag */ req_upiu->header.task_tag = tag; @@ -10508,7 +10465,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq) hba->ufs_version = ufshcd_get_ufs_version(hba); /* Get Interrupt bit mask per version */ - hba->intr_mask = ufshcd_get_intr_mask(hba); + hba->intr_mask = INTERRUPT_MASK_ALL_VER_21; err = ufshcd_set_dma_mask(hba); if (err) { diff --git a/include/ufs/ufshci.h b/include/ufs/ufshci.h index 88193f5540e5..aecdc209ab75 100644 --- a/include/ufs/ufshci.h +++ b/include/ufs/ufshci.h @@ -425,13 +425,6 @@ union ufs_crypto_cfg_entry { * Request Descriptor Definitions */ -/* Transfer request command type */ -enum utp_cmd_type { - UTP_CMD_TYPE_SCSI = 0x0, - UTP_CMD_TYPE_UFS = 0x1, - UTP_CMD_TYPE_DEV_MANAGE = 0x2, -}; - /* To accommodate UFS2.0 required Command type */ enum { UTP_CMD_TYPE_UFS_STORAGE = 0x1, From patchwork Tue Mar 26 08:32:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avri Altman X-Patchwork-Id: 783526 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5204E3FB9B; Tue, 26 Mar 2024 08:33:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711442003; cv=none; b=gzZnMiQZXBZ4DYAjD9xw2rGrk86K7GmoB5CUpTeigxowsACfp4juIDyG/RCwLX6/TBV0xkvJZzqLJN5H0aU/rFMIXr0PqagsbGTQR3G3kpJGoChLBTuRgfEtXlRmHA2XuL1s6rQafmXGZ4+WtX/eI6eCpkrIYWX5/p1nxUjCaio= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711442003; c=relaxed/simple; bh=L9ECRQuWWxOYBhvGRljfWbWYDuMM29Hmf/oHGt0Mqn0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hWo84iJxfa0a3p/SEcTOsxO2iCjWAqFO+KSjUStA+U+XH1j1XTDA/aUjQseHoGb4FZ2zIjdZDLegfwhfsq/ypXut6lz0MXNpC8PYeamt2Hz3HlNN4Jejp8+yj3F/Dqrmo3ByYAUTD61nwprTEMC8SfTZOWyPwNMofKYlJVA71/I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=Gk9f9tEV; arc=none smtp.client-ip=216.71.154.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="Gk9f9tEV" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1711442001; x=1742978001; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=L9ECRQuWWxOYBhvGRljfWbWYDuMM29Hmf/oHGt0Mqn0=; b=Gk9f9tEV7kzCK74oMSaLznTMGfTrbsAYNg0sYhbJIt6QYbxg2r76vIzq y0aVjRhcn32aI/q/9v5lW/SS0vPmjfBuNm3ist2km2jtX186wwpZvpQBW 4Ugitg0iR54jEtUNO7Vq/JTv/e07G79E18sdpN60jEzYVFbUfuuULf2Co Ua2KgmjZF25h4CHjptlFYX85T/3jox/xEBf3aCPStpD7VwC+2TNsIscBj fYtXsOadJR7TCzn/LepodNJdRNFdAor5q5j39Hm5cN+fD+5nvCkwKb0qF LXWYiThpKXze7npgAGKt8l5mz7AL/vqj3J+j7KVRuKK50cVUTjQHRHFwd Q==; X-CSE-ConnectionGUID: vnsO3JvrRE2g1QpW1VJQGw== X-CSE-MsgGUID: rqeSrDu2QzqevU8jIVUNqg== X-IronPort-AV: E=Sophos;i="6.07,155,1708358400"; d="scan'208";a="12495279" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 26 Mar 2024 16:33:16 +0800 IronPort-SDR: 4oOtUEAr6RndZlTwpHnGNjTjzMKZAUblQ9r2Ikkrl5G0WNQXFewyXfwUugZIAeVZnMTCeUeOyt uTEBdUan39WQ== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 26 Mar 2024 00:42:01 -0700 IronPort-SDR: 081SocrVI7iLooEdak6P7QoSIpS2VFZ8vWMI+zdCe5jSfqhGipOHoxny2mjux0iJdQJaaJ9iLf KDl05hg7aALw== WDCIronportException: Internal Received: from bxygm33.ad.shared ([10.45.31.229]) by uls-op-cesaip02.wdc.com with ESMTP; 26 Mar 2024 01:33:14 -0700 From: Avri Altman To: "James E . J . Bottomley" , "Martin K . Petersen" Cc: Bart Van Assche , Bean Huo , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Avri Altman Subject: [PATCH 2/2] scsi: ufs: Remove legacy tuning calls Date: Tue, 26 Mar 2024 10:32:50 +0200 Message-ID: <20240326083253.1303-3-avri.altman@wdc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240326083253.1303-1-avri.altman@wdc.com> References: <20240326083253.1303-1-avri.altman@wdc.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Those tunings only apply to old host controllers, Now that UFSHCI <= 2.0 has been removed, we can remove those calls as well. Signed-off-by: Avri Altman --- drivers/ufs/core/ufshcd.c | 96 ------------------------------------- drivers/ufs/host/ufs-qcom.c | 3 +- 2 files changed, 1 insertion(+), 98 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index cda1939f2d8a..d97590c1c9e7 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -980,20 +980,6 @@ u32 ufshcd_get_local_unipro_ver(struct ufs_hba *hba) } EXPORT_SYMBOL(ufshcd_get_local_unipro_ver); -static bool ufshcd_is_unipro_pa_params_tuning_req(struct ufs_hba *hba) -{ - /* - * If both host and device support UniPro ver1.6 or later, PA layer - * parameters tuning happens during link startup itself. - * - * We can manually tune PA layer parameters if either host or device - * doesn't support UniPro ver 1.6 or later. But to keep manual tuning - * logic simple, we will only do manual tuning if local unipro version - * doesn't support ver1.6 or later. - */ - return ufshcd_get_local_unipro_ver(hba) < UFS_UNIPRO_VER_1_6; -} - /** * ufshcd_pm_qos_init - initialize PM QoS request * @hba: per adapter instance @@ -8325,83 +8311,6 @@ static void ufs_put_device_desc(struct ufs_hba *hba) dev_info->model = NULL; } -/** - * ufshcd_tune_pa_tactivate - Tunes PA_TActivate of local UniPro - * @hba: per-adapter instance - * - * PA_TActivate parameter can be tuned manually if UniPro version is less than - * 1.61. PA_TActivate needs to be greater than or equal to peerM-PHY's - * RX_MIN_ACTIVATETIME_CAPABILITY attribute. This optimal value can help reduce - * the hibern8 exit latency. - * - * Return: zero on success, non-zero error value on failure. - */ -static int ufshcd_tune_pa_tactivate(struct ufs_hba *hba) -{ - int ret = 0; - u32 peer_rx_min_activatetime = 0, tuned_pa_tactivate; - - ret = ufshcd_dme_peer_get(hba, - UIC_ARG_MIB_SEL( - RX_MIN_ACTIVATETIME_CAPABILITY, - UIC_ARG_MPHY_RX_GEN_SEL_INDEX(0)), - &peer_rx_min_activatetime); - if (ret) - goto out; - - /* make sure proper unit conversion is applied */ - tuned_pa_tactivate = - ((peer_rx_min_activatetime * RX_MIN_ACTIVATETIME_UNIT_US) - / PA_TACTIVATE_TIME_UNIT_US); - ret = ufshcd_dme_set(hba, UIC_ARG_MIB(PA_TACTIVATE), - tuned_pa_tactivate); - -out: - return ret; -} - -/** - * ufshcd_tune_pa_hibern8time - Tunes PA_Hibern8Time of local UniPro - * @hba: per-adapter instance - * - * PA_Hibern8Time parameter can be tuned manually if UniPro version is less than - * 1.61. PA_Hibern8Time needs to be maximum of local M-PHY's - * TX_HIBERN8TIME_CAPABILITY & peer M-PHY's RX_HIBERN8TIME_CAPABILITY. - * This optimal value can help reduce the hibern8 exit latency. - * - * Return: zero on success, non-zero error value on failure. - */ -static int ufshcd_tune_pa_hibern8time(struct ufs_hba *hba) -{ - int ret = 0; - u32 local_tx_hibern8_time_cap = 0, peer_rx_hibern8_time_cap = 0; - u32 max_hibern8_time, tuned_pa_hibern8time; - - ret = ufshcd_dme_get(hba, - UIC_ARG_MIB_SEL(TX_HIBERN8TIME_CAPABILITY, - UIC_ARG_MPHY_TX_GEN_SEL_INDEX(0)), - &local_tx_hibern8_time_cap); - if (ret) - goto out; - - ret = ufshcd_dme_peer_get(hba, - UIC_ARG_MIB_SEL(RX_HIBERN8TIME_CAPABILITY, - UIC_ARG_MPHY_RX_GEN_SEL_INDEX(0)), - &peer_rx_hibern8_time_cap); - if (ret) - goto out; - - max_hibern8_time = max(local_tx_hibern8_time_cap, - peer_rx_hibern8_time_cap); - /* make sure proper unit conversion is applied */ - tuned_pa_hibern8time = ((max_hibern8_time * HIBERN8TIME_UNIT_US) - / PA_HIBERN8_TIME_UNIT_US); - ret = ufshcd_dme_set(hba, UIC_ARG_MIB(PA_HIBERN8TIME), - tuned_pa_hibern8time); -out: - return ret; -} - /** * ufshcd_quirk_tune_host_pa_tactivate - Ensures that host PA_TACTIVATE is * less than device PA_TACTIVATE time. @@ -8474,11 +8383,6 @@ static int ufshcd_quirk_tune_host_pa_tactivate(struct ufs_hba *hba) static void ufshcd_tune_unipro_params(struct ufs_hba *hba) { - if (ufshcd_is_unipro_pa_params_tuning_req(hba)) { - ufshcd_tune_pa_tactivate(hba); - ufshcd_tune_pa_hibern8time(hba); - } - ufshcd_vops_apply_dev_quirks(hba); if (hba->dev_quirks & UFS_DEVICE_QUIRK_PA_TACTIVATE) diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index 06859e17b67b..06391f923dba 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -531,8 +531,7 @@ static int ufs_qcom_link_startup_notify(struct ufs_hba *hba, * and device TX LCC are disabled once link startup is * completed. */ - if (ufshcd_get_local_unipro_ver(hba) != UFS_UNIPRO_VER_1_41) - err = ufshcd_disable_host_tx_lcc(hba); + err = ufshcd_disable_host_tx_lcc(hba); break; default: