From patchwork Wed Feb 21 04:56:32 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: 10231289 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 1BDC260209 for ; Wed, 21 Feb 2018 05:07:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E835289A8 for ; Wed, 21 Feb 2018 05:07:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0331928A22; Wed, 21 Feb 2018 05:07:21 +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 A4082289A8 for ; Wed, 21 Feb 2018 05:07:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751477AbeBUFHI (ORCPT ); Wed, 21 Feb 2018 00:07:08 -0500 Received: from alexa-out-tai-02.qualcomm.com ([103.229.16.227]:54422 "EHLO alexa-out-tai-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751461AbeBUFHF (ORCPT ); Wed, 21 Feb 2018 00:07:05 -0500 X-IronPort-AV: E=Sophos;i="5.46,542,1511798400"; d="scan'208";a="1477" Received: from ironmsg02-tai.qualcomm.com ([10.249.140.7]) by alexa-out-tai-02.qualcomm.com with ESMTP; 21 Feb 2018 12:57:33 +0800 X-IronPort-AV: E=McAfee;i="5900,7806,8810"; a="2386722" Received: from asutoshd-linux.qualcomm.com ([10.206.24.163]) by ironmsg02-tai.qualcomm.com with ESMTP; 20 Feb 2018 20:56:49 -0800 Received: by asutoshd-linux.qualcomm.com (Postfix, from userid 92687) id 45F472378; Wed, 21 Feb 2018 10:26:48 +0530 (IST) From: Asutosh Das To: subhashj@codeaurora.org, cang@codeaurora.org, vivek.gautam@codeaurora.org, rnayak@codeaurora.org, vinholikatti@gmail.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, Yaniv Gardi , Asutosh Das , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/9] scsi: ufs: Allowing power mode change Date: Wed, 21 Feb 2018 10:26:32 +0530 Message-Id: <70df05c82a8624987c76b16c65143f00a111c94d.1519120988.git.asutoshd@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: 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;