linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vignesh Raghavendra <vigneshr@ti.com>
To: Anil Varughese <aniljoy@cadence.com>, <alim.akhtar@samsung.com>,
	<avri.altman@wdc.com>, <pedrom.sousa@synopsys.com>
Cc: <jejb@linux.ibm.com>, <martin.petersen@oracle.com>,
	<hare@suse.de>, <rafalc@cadence.com>, <mparab@cadence.com>,
	<jank@cadence.com>, <linux-scsi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1] scsi: ufs: Disable local LCC in .link_startup_notify() in Cadence UFS
Date: Mon, 26 Aug 2019 17:37:56 +0530	[thread overview]
Message-ID: <ef91f93a-89d9-e49b-e9f3-dd5a9cd98b91@ti.com> (raw)
In-Reply-To: <20190813074250.28177-1-aniljoy@cadence.com>

Hi,

On 13/08/19 1:12 PM, Anil Varughese wrote:
> Some UFS devices have issues if LCC is enabled. So we
> are setting PA_LOCAL_TX_LCC_Enable to 0 before link
> startup which will make sure that both host and device
> TX LCC are disabled once link startup is completed.
> 
> Signed-off-by: Anil Varughese <aniljoy@cadence.com>> ---

Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>

Regards
Vignesh

>  drivers/scsi/ufs/cdns-pltfrm.c | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/drivers/scsi/ufs/cdns-pltfrm.c b/drivers/scsi/ufs/cdns-pltfrm.c
> index 993519080..b2af04c57 100644
> --- a/drivers/scsi/ufs/cdns-pltfrm.c
> +++ b/drivers/scsi/ufs/cdns-pltfrm.c
> @@ -77,6 +77,31 @@ static int cdns_ufs_hce_enable_notify(struct ufs_hba *hba,
>  	return cdns_ufs_set_hclkdiv(hba);
>  }
>  
> +/**
> + * Called before and after Link startup is carried out.
> + * @hba: host controller instance
> + * @status: notify stage (pre, post change)
> + *
> + * Return zero for success and non-zero for failure
> + */
> +static int cdns_ufs_link_startup_notify(struct ufs_hba *hba,
> +					enum ufs_notify_change_status status)
> +{
> +	if (status != PRE_CHANGE)
> +		return 0;
> +
> +	/*
> +	 * Some UFS devices have issues if LCC is enabled.
> +	 * So we are setting PA_Local_TX_LCC_Enable to 0
> +	 * before link startup which will make sure that both host
> +	 * and device TX LCC are disabled once link startup is
> +	 * completed.
> +	 */
> +	ufshcd_dme_set(hba, UIC_ARG_MIB(PA_LOCAL_TX_LCC_ENABLE), 0);
> +
> +	return 0;
> +}
> +
>  /**
>   * cdns_ufs_init - performs additional ufs initialization
>   * @hba: host controller instance
> @@ -114,12 +139,14 @@ static int cdns_ufs_m31_16nm_phy_initialization(struct ufs_hba *hba)
>  static const struct ufs_hba_variant_ops cdns_ufs_pltfm_hba_vops = {
>  	.name = "cdns-ufs-pltfm",
>  	.hce_enable_notify = cdns_ufs_hce_enable_notify,
> +	.link_startup_notify = cdns_ufs_link_startup_notify,
>  };
>  
>  static const struct ufs_hba_variant_ops cdns_ufs_m31_16nm_pltfm_hba_vops = {
>  	.name = "cdns-ufs-pltfm",
>  	.init = cdns_ufs_init,
>  	.hce_enable_notify = cdns_ufs_hce_enable_notify,
> +	.link_startup_notify = cdns_ufs_link_startup_notify,
>  	.phy_initialization = cdns_ufs_m31_16nm_phy_initialization,
>  };
>  
> 

-- 
Regards
Vignesh

  reply	other threads:[~2019-08-26 12:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13  7:42 [PATCH v1] scsi: ufs: Disable local LCC in .link_startup_notify() in Cadence UFS Anil Varughese
2019-08-26 12:07 ` Vignesh Raghavendra [this message]
2019-08-29 21:43 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ef91f93a-89d9-e49b-e9f3-dd5a9cd98b91@ti.com \
    --to=vigneshr@ti.com \
    --cc=alim.akhtar@samsung.com \
    --cc=aniljoy@cadence.com \
    --cc=avri.altman@wdc.com \
    --cc=hare@suse.de \
    --cc=jank@cadence.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mparab@cadence.com \
    --cc=pedrom.sousa@synopsys.com \
    --cc=rafalc@cadence.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).