From patchwork Tue Jan 23 12:02:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Asutosh Das (asd)" X-Patchwork-Id: 10180043 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D9EB3601D5 for ; Tue, 23 Jan 2018 12:02:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD34328614 for ; Tue, 23 Jan 2018 12:02:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C133528705; Tue, 23 Jan 2018 12:02:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B3E528614 for ; Tue, 23 Jan 2018 12:02:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751295AbeAWMCo (ORCPT ); Tue, 23 Jan 2018 07:02:44 -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-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;