Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6239640ybi; Wed, 31 Jul 2019 10:41:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyFJ29RF6udbDcLd/my/CD2Zkln6U6MeXp03HOS30buXjki63n32joYUhW8yGvIuFB6B4zY X-Received: by 2002:a17:902:2a26:: with SMTP id i35mr119875802plb.315.1564594907501; Wed, 31 Jul 2019 10:41:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564594907; cv=none; d=google.com; s=arc-20160816; b=b8vrxZ2/VBjycHaR7OOXGJ2jBIpJ8tspAgXT2uRtgks4yEpKlRONz8u7LA2WwwnY9W o4LMDojYlOlLkmFjl3FTg9umL7vgOIr0MHGuQx0lSTfogKiCqk1isNgJmnagzUAAdNFA eKYtnVD4t7AKUeLrcWaylPjm2Zm38VxlLS1YgKOQ34mDtU9DfH40EPxfkA3QDtNHQY9U bfQ8vARDXQcShBFVzodEIG0m7IaeRmMiodJmjcAgL5jKHnTlwwYXNOFKtemWws1eB9SP OdfJTq1I6kyyf4jz2zj5NlmXtlAj1PqvX8SqV6kvfhg7KJ/sjMlsv9N3hHK3xQ6cO/Ec 3EeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=/frXQ4KOaIB5wlfnm3bIFpuw4RJxR6iAeoBpUdEjJNk=; b=e2ad+aafkSOwJMdknT0YK+PhHzCBxBkdPVW14sQM6STgcP8JvryFZgoiJ0718bqVo3 hzO01Ypval7/u4zorf3YyC3PlRH153o+i3JfTNF97sSTGdkfpwBwnDHeX900uRma4CiR go1xUeSvRZUe2o4dcRc3sBygCQ8w63AbDAR6ePckkH4bLBH8LIWVapZ9N2a7UncbhfmV ADG0WlkH2mgut3g9ouXTYbAdPxL6BDujCGcIB1iMA++CqMhQuGPkc9UicMjM7wbsf268 lPBcrbS+ppPkfvy5K6jT69Ao+bBAjwzBM8l2YEA5c89ICK4Tmdn7lpKOJpW8E3G/kbmJ 0L+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Rilh8BWb; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 207si35439569pfu.258.2019.07.31.10.41.30; Wed, 31 Jul 2019 10:41:47 -0700 (PDT) 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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Rilh8BWb; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729188AbfGaQfd (ORCPT + 99 others); Wed, 31 Jul 2019 12:35:33 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:35838 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726817AbfGaQfd (ORCPT ); Wed, 31 Jul 2019 12:35:33 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x6VGZKlT008471; Wed, 31 Jul 2019 11:35:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1564590920; bh=/frXQ4KOaIB5wlfnm3bIFpuw4RJxR6iAeoBpUdEjJNk=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=Rilh8BWbZ/+l5TBDpm11NM07/fO1kW/j9UZbET7VD4xAYd2fm73ZTz/gGdsfy6oeO yd2Ps56ie9I7ICEtrMu702nYrxUVhBBDGK5XBKxAc4tUpcIGG2ZCDC/jGNbvPoUC7Q mSccOg1j90bPH/QHJiqOP83ij2QHbIzGExCTiYkA= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x6VGZKqP093095 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 31 Jul 2019 11:35:20 -0500 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Wed, 31 Jul 2019 11:35:19 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Wed, 31 Jul 2019 11:35:19 -0500 Received: from [10.250.133.139] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x6VGZFVL083599; Wed, 31 Jul 2019 11:35:16 -0500 Subject: Re: [PATCH] scsi: ufs: Additional clock initialization in Cadence UFS To: Anil Varughese , , , CC: , , , , , , , References: <20190731083614.25926-1-aniljoy@cadence.com> From: Vignesh Raghavendra Message-ID: <77210067-ee65-4c12-9c7e-2b78260acdef@ti.com> Date: Wed, 31 Jul 2019 22:05:15 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190731083614.25926-1-aniljoy@cadence.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 31-Jul-19 2:06 PM, Anil Varughese wrote: > Configure CDNS_UFS_REG_HCLKDIV in .hce_enable_notify() > because if UFSHCD resets the controller ip because of > phy or device related errors then CDNS_UFS_REG_HCLKDIV > is reset to default value and .setup_clock() is not > called later in the sequence whereas hce_enable_notify > will be called everytime controller is reenabled. > So, now that CDNS_UFS_REG_HCLKDIV is configured in .hce_enable_notify(), is it still required to have the same code in .setup_clock() as well? Isn't setting up CDNS_UFS_REG_HCLKDIV in .hce_enable_notify() alone not sufficient? Regards Vignesh > Signed-off-by: Anil Varughese > --- > drivers/scsi/ufs/cdns-pltfrm.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/drivers/scsi/ufs/cdns-pltfrm.c b/drivers/scsi/ufs/cdns-pltfrm.c > index 86dbb723f..15ee54d28 100644 > --- a/drivers/scsi/ufs/cdns-pltfrm.c > +++ b/drivers/scsi/ufs/cdns-pltfrm.c > @@ -78,6 +78,22 @@ static int cdns_ufs_setup_clocks(struct ufs_hba *hba, bool on, > return cdns_ufs_set_hclkdiv(hba); > } > > +/** > + * Called before and after HCE enable bit is set. > + * @hba: host controller instance > + * @status: notify stage (pre, post change) > + * > + * Return zero for success and non-zero for failure > + */ > +static int cdns_ufs_hce_enable_notify(struct ufs_hba *hba, > + enum ufs_notify_change_status status) > +{ > + if (status != PRE_CHANGE) > + return 0; > + > + return cdns_ufs_set_hclkdiv(hba); > +} > + > /** > * cdns_ufs_init - performs additional ufs initialization > * @hba: host controller instance > @@ -115,12 +131,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", > .setup_clocks = cdns_ufs_setup_clocks, > + .hce_enable_notify = cdns_ufs_hce_enable_notify, > }; > > static const struct ufs_hba_variant_ops cdns_ufs_m31_16nm_pltfm_hba_vops = { > .name = "cdns-ufs-pltfm", > .init = cdns_ufs_init, > .setup_clocks = cdns_ufs_setup_clocks, > + .hce_enable_notify = cdns_ufs_hce_enable_notify, > .phy_initialization = cdns_ufs_m31_16nm_phy_initialization, > }; > >