Received: by 10.223.176.46 with SMTP id f43csp4080755wra; Tue, 23 Jan 2018 04:03:22 -0800 (PST) X-Google-Smtp-Source: AH8x227nxtRDLDqCiADfudHivWEvRIWh/tkuoEq/2CQR1L/hoBPIbSa2COIUXR08Nt8q67XL3RaV X-Received: by 10.98.59.80 with SMTP id i77mr10432868pfa.146.1516709002685; Tue, 23 Jan 2018 04:03:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516709002; cv=none; d=google.com; s=arc-20160816; b=VO17tNs2QGEsoMzfqx4HlTtDgX3JTyjDliumRVzNigXL1UGbZFy0NApJnGBgrMjhj2 CNX8PkkmyWzCOrQJcU1SPc9DRwp6xT0ypQSm7PucrxfX4RQc4QWDaxkeoft+eicOVpwI Cx9EOIPTyNQMjEu1rC1n2yS05gU9iJ8Yu1vANZlvpmoHzLLviFk0K6QmlaxHk0Prebsx Te1iS4IaURgsjXFvegF446OgAZ5ZOq6VPl26Z13LMJkdufOoQ+osPx1RIxWj74DbFd3W CaMD05mtprSJZ/ECWZATclyl9OuOF8lbxhQ5LgMYD+q8IVCUE3LPMHGtHbFJacez0hHQ eFbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=8bCTnBvoQaGr9oTSrrVplRUk2zYUPKs5MjJxvVKGN3o=; b=evQKTZvrO9ZZIXSFSCcbzzvusEgelI63/kIph70xWku9lCNHufbNB3SyPQnanvWRw6 PEgFsiA1iPmYki4vWBPZzK4E7AenW+q8Wm1TZ8fjedlALTccBQGh+w2HFmdu2oH+6Wru +jL6E5ulFMcTAST6RYcRkBOW1FY1LDVvCRyQovZtZMrAW91VLxhQDkStxfFXUyLnj9/C aq9cbu/ZaHoa/GF65a/AFWGiOWY9uO39l3yJjBbntALbWB2XSmyTzwYyKz8RBykjhLT2 G+CPrDvQkx0bnKUsrqulAk0aXBTHstJGXpTBmOpvBCbEkQf3ljpa3U9GKnKWA4j7E7bf HR0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a61-v6si3388742pla.689.2018.01.23.04.03.07; Tue, 23 Jan 2018 04:03:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751451AbeAWMCp (ORCPT + 99 others); Tue, 23 Jan 2018 07:02:45 -0500 Received: from alexa-out.qualcomm.com ([129.46.98.28]:50731 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751156AbeAWMCn (ORCPT ); Tue, 23 Jan 2018 07:02:43 -0500 X-IronPort-AV: E=Sophos;i="5.46,401,1511856000"; d="scan'208";a="13497354" Received: from ironmsg-sd-alpha.qualcomm.com ([10.53.140.30]) by alexa-out.qualcomm.com with ESMTP; 23 Jan 2018 04:02:43 -0800 X-IronPort-AV: E=McAfee;i="5900,7806,8781"; a="58646897" X-MGA-submission: =?us-ascii?q?MDEScaIjr3OwCwNATbvUUSkmTnd2wCqM/d+Yle?= =?us-ascii?q?QU4bT6qGK/3VDNWC3SXFrpLiDRJ0x/kIFLShLNMObcCFqGrZcWlGPW0d?= =?us-ascii?q?NHk3i570vLqa/k5Pm053NAW1kTQAhpKwrzQpOtX8vog7mKxYuEE5h+pG?= =?us-ascii?q?tP?= Received: from asutoshd-linux.qualcomm.com ([10.206.24.163]) by ironmsg-SD-alpha.qualcomm.com with ESMTP; 23 Jan 2018 04:02:38 -0800 Received: by asutoshd-linux.qualcomm.com (Postfix, from userid 92687) id 726A41983; Tue, 23 Jan 2018 17:32:36 +0530 (IST) From: Asutosh Das To: subhashj@quicinc.com, cang@codeaurora.org, vivek.gautam@codeaurora.org, vinholikatti@gmail.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, Yaniv Gardi , Subhash Jadavani , Asutosh Das , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/1] scsi: ufs: Allowing power mode change Date: Tue, 23 Jan 2018 17:32:00 +0530 Message-Id: <1516708920-20620-1-git-send-email-asutoshd@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yaniv Gardi Due to M-PHY issues, moving from HS to any other mode or gear or even Hibern8 causes some un-predicted behavior of the device. This patch fixes this issues. Signed-off-by: Yaniv Gardi Signed-off-by: Subhash Jadavani Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 011c336..d74d529 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -4167,9 +4167,13 @@ static int ufshcd_link_startup(struct ufs_hba *hba) goto out; } while (ret && retries--); - if (ret) + if (ret) { /* failed to get the link up... retire */ goto out; + } else { + ufshcd_dme_set(hba, UIC_ARG_MIB(TX_LCC_ENABLE), 0); + ufshcd_dme_set(hba, UIC_ARG_MIB(TX_LCC_ENABLE), 1); + } if (link_startup_again) { link_startup_again = false; -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.