Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp871926ybh; Wed, 15 Jul 2020 18:30:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYB+kfJ1wuu6BqbAQZMp+cAU8MA634jaGi73GEkrd+DS8UOojKF3+L1aJxAiqYjMgLJL+H X-Received: by 2002:aa7:db4b:: with SMTP id n11mr2290976edt.137.1594863033880; Wed, 15 Jul 2020 18:30:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594863033; cv=none; d=google.com; s=arc-20160816; b=ABCZqEeAeX/Oqcjp5ypwoz42imYYQKu6lSUdsDnHlQ+//vzsuRQ7fpugnFsnPanwWF SVF9U0a3tRthtxteUSR0uq5nsK1AlpMYRtRxIfHkH95zma8Wbf4zky4sZlBLw4lfq61j p6wg0bd1hTWpUptjbk5wFmGBbQXHANoZ2pEUgUtbqzH2Enq71BUPXAiNanCk7MYFHxpY IBerSRy0ParME9PY/mgsj5hTwY1AHV4ws346p7CFeXrRLKBvOhJyI1+70NMSOwhxyZv0 nsfzKZ3ldBrOD6T9IuDt3G4WSXrwbYPVXMjHspOPzRvYcydG5nGOe94Q41g3zf77KYwS 6ykg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:content-language :thread-index:content-transfer-encoding:mime-version:message-id:date :subject:in-reply-to:cc:to:from:dkim-signature:dkim-filter; bh=hOa/A7YiqiUgUKfubXBHWOxCskvKIPDJb68BD6K6Sdw=; b=MUv6ISl2Q47fzmHADQQ6yywUtwASzArSYJf9/1044wIWQIS9xcrY+DAYiHQZIGfy1B rdKi1VOjY8TiPHC1ENVtXNWvaLRq84bDQmGSt2UFCYxDeyo7oeytAeEZ92mi+OUAVhJv FKs3eDW4mdzWXJOuaafLEGvcoeT/jvyU+N31tDLrVxqXlvrmNmj0ivAvxuYBwTigA7yO c7SK9WwZ04mIdFf8J541UjpCfmbe9AuyZdiOZDV4Qo2PwDDoIZerb6MEP4FGgfsrzs0K WROqky/G6fZOBeHwfEx60V90NI0lAINtgbZ77b6QejcfzFyFQS8jKQllQC3PwAXjNVgy YZOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=sDJkD157; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt21si2209674ejb.402.2020.07.15.18.30.11; Wed, 15 Jul 2020 18:30:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=sDJkD157; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727948AbgGPB30 (ORCPT + 99 others); Wed, 15 Jul 2020 21:29:26 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:49022 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728033AbgGPB3Z (ORCPT ); Wed, 15 Jul 2020 21:29:25 -0400 Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20200716012921epoutp01a6c2f65424fdaf3b13eb9df5dd30de3d~iF2nUBlut0890408904epoutp01Q for ; Thu, 16 Jul 2020 01:29:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20200716012921epoutp01a6c2f65424fdaf3b13eb9df5dd30de3d~iF2nUBlut0890408904epoutp01Q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1594862961; bh=hOa/A7YiqiUgUKfubXBHWOxCskvKIPDJb68BD6K6Sdw=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=sDJkD157ZwKeUhy3Akdkhhi095mTtIZFjR0nR2RYYcGSmYkKkNVmoEpTzQCnUoQ54 R7EFZORZO2AvdnDAZrjhQV7vPQ7CCyZ5Y05AiANfQpLAqRcYW96KHe9LZovcvBU0gL Yfy2rjcukJhR6DshEOSLjlHlT5M+k8mZycd86jSU= Received: from epsmges5p1new.samsung.com (unknown [182.195.42.73]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20200716012920epcas5p2ff4a5f48f3e6b052117db3476bd22e35~iF2m1jJaB0342103421epcas5p2K; Thu, 16 Jul 2020 01:29:20 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 4D.1A.09467.07DAF0F5; Thu, 16 Jul 2020 10:29:20 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20200716011732epcas5p4e81ce853962d66b1a48ce24e9f63d7ed~iFsTYGCbK1630116301epcas5p4Z; Thu, 16 Jul 2020 01:17:32 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200716011732epsmtrp219362f3104ebe5bcc0433d9f84bf0c9a~iFsTXS0GR2678726787epsmtrp2V; Thu, 16 Jul 2020 01:17:32 +0000 (GMT) X-AuditID: b6c32a49-a29ff700000024fb-ba-5f0fad709991 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 5D.EB.08303.CAAAF0F5; Thu, 16 Jul 2020 10:17:32 +0900 (KST) Received: from alimakhtar02 (unknown [107.108.234.165]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200716011730epsmtip1bda720948ff454b86cbda2a5c209b952~iFsRNj4yc3113931139epsmtip19; Thu, 16 Jul 2020 01:17:30 +0000 (GMT) From: "Alim Akhtar" To: "'Vinod Koul'" Cc: , , , , , , , In-Reply-To: <20200713061737.GD34333@vkoul-mobl> Subject: RE: [PATCH v12 2/2] phy: samsung-ufs: add UFS PHY driver for samsung SoC Date: Thu, 16 Jul 2020 06:47:28 +0530 Message-ID: <077501d65b0e$e1630100$a4290300$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIAZudAEAONCLYZ7ErPEYM0UJKVzwJEgx3VAd4V62cCg/PmQ6h9FfEw Content-Language: en-in X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCKsWRmVeSWpSXmKPExsWy7bCmpm7BWv54gzM39C3mHznHanHhaQ+b xfnzG9gtbm45ymKx6fE1VovLu+awWcw4v4/JonXvEXaLnXdOMDtwemxa1cnmsXlJvUffllWM HsdvbGfy+LxJLoA1issmJTUnsyy1SN8ugStj+l2rgjXyFfeexDUwfpHoYuTkkBAwkZh7fwcb iC0ksJtR4u4PCQj7E6PE8/aiLkYuIPszo8Sby7tYYBom3rjDDpHYxSjRd+w+E4TzhlHi9Mpp rCBVbAK6EjsWt4GNFRFQldjy5AEbSBGzwDNGiTWbOhhBEpwCBhKn/l0CGyssECzxYd8CZhCb Bajh1pfXYDavgKXEuaWXGSFsQYmTM5+A1TMLyEtsfzuHGeIkBYmfT5cBLeYAWuYm8fleEUSJ uMTRnz3MIHslBBZySKz9f4MZpEZCwEXiz1R1iFZhiVfHt7BD2FISn9/tZYMoyZbo2WUMEa6R WDrvGNTz9hIHrsxhASlhFtCUWL9LHyIsKzH11DomiK18Er2/nzBBxHkldsyDsVUlmt9dhRoj LTGxu5t1AqPSLCR/zULy1ywkD8xC2LaAkWUVo2RqQXFuemqx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5qcWHGKU5WJTE eb/OWhgnJJCeWJKanZpakFoEk2Xi4JRqYOJ7c/On3BxlV0eej5Pnp+/7kn385FSmmQqK/Fu2 Kf+3l4qSN/pyb+JFwfNvdTvkecrrj/QdORWbt6R78nuF1n9xCfel8/aq8iZtCX7MfKza4R1r 9b+dIvzXq3/tSzvf6trWl+j6tyDWzdtmUop0obRatssdhayti8/tOXd/vlc7+58ra/eaxPKG r5a3vj4/Mu366qkne1I8xMR8I29L/nz0v/swi3dlo6X7OZu/alIlPOXf5q0ql41t2CegH8T9 jEn45sOqVtVN35x25Oc8/LepbB1bwrOpX2uKTy5wvOi7onuzReS/U76CV4VnLasvn7to5XGZ hxUN11lYd7LqrEpimaP6SdT553ZrPeO3rkosxRmJhlrMRcWJAGADDc8bAwAA X-CMS-MailID: 20200716011732epcas5p4e81ce853962d66b1a48ce24e9f63d7ed X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P X-CMS-RootMailID: 20200703173144epcas5p1daa9f5c594e7f299638cc75b7425b7c8 References: <20200703171135.77389-1-alim.akhtar@samsung.com> <20200703171135.77389-2-alim.akhtar@samsung.com> <20200713061737.GD34333@vkoul-mobl> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vinod, > -----Original Message----- > From: Vinod Koul > Sent: 13 July 2020 11:48 > To: Alim Akhtar > Cc: robh+dt@kernel.org; krzk@kernel.org; kwmad.kim@samsung.com; > devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux- > kernel@vger.kernel.org; linux-samsung-soc@vger.kernel.org; kishon@ti.com > Subject: Re: [PATCH v12 2/2] phy: samsung-ufs: add UFS PHY driver for samsung > SoC > > On 03-07-20, 22:41, Alim Akhtar wrote: > > > +static const struct samsung_ufs_phy_cfg exynos7_post_init_cfg[] = { > > + END_UFS_PHY_CFG > > +}; > > This is dummy, why not add a check to make config optional? > Currently this is dummy, however this might be used for the similar platform which do some phy tunning post init. Will just remove this for now for this platform, will add this check in driver. > > +static int samsung_ufs_phy_symbol_clk_init(struct samsung_ufs_phy > > +*phy) { > > + int ret = 0; > > superfluous init, am sure I flagged it before as well > Yes, you did, but 0-DAY CI kernel test gave warning [1], so I kept this as it is. [1] https://lkml.org/lkml/2020/7/3/81 > > + > > + phy->tx0_symbol_clk = devm_clk_get(phy->dev, "tx0_symbol_clk"); > > + if (IS_ERR(phy->tx0_symbol_clk)) { > > + dev_err(phy->dev, "failed to get tx0_symbol_clk clock\n"); > > + goto out; > > + } > > + > > + phy->rx0_symbol_clk = devm_clk_get(phy->dev, "rx0_symbol_clk"); > > + if (IS_ERR(phy->rx0_symbol_clk)) { > > + dev_err(phy->dev, "failed to get rx0_symbol_clk clock\n"); > > + goto out; > > + } > > + > > + phy->rx1_symbol_clk = devm_clk_get(phy->dev, "rx1_symbol_clk"); > > + if (IS_ERR(phy->rx0_symbol_clk)) { > > + dev_err(phy->dev, "failed to get rx1_symbol_clk clock\n"); > > + goto out; > > + } > > + > > + ret = clk_prepare_enable(phy->tx0_symbol_clk); > > + if (ret) { > > + dev_err(phy->dev, "%s: tx0_symbol_clk enable failed %d\n", > __func__, ret); > > + goto out; > > + } > > + > > + ret = clk_prepare_enable(phy->rx0_symbol_clk); > > + if (ret) { > > + dev_err(phy->dev, "%s: rx0_symbol_clk enable failed %d\n", > __func__, ret); > > + clk_disable_unprepare(phy->tx0_symbol_clk); > > + goto out; > > + } > > + > > + ret = clk_prepare_enable(phy->rx1_symbol_clk); > > + if (ret) { > > + dev_err(phy->dev, "%s: rx1_symbol_clk enable failed %d\n", > __func__, ret); > > + clk_disable_unprepare(phy->tx0_symbol_clk); > > + clk_disable_unprepare(phy->rx0_symbol_clk); > > maybe it will look better if we add common rollback and jump to proper labels > Sure, will change in next version. > > +static int samsung_ufs_phy_clks_init(struct samsung_ufs_phy *phy) { > > + int ret; > > + > > + phy->ref_clk = devm_clk_get(phy->dev, "ref_clk"); > > + if (IS_ERR(phy->ref_clk)) > > + dev_err(phy->dev, "failed to get ref_clk clock\n"); > > + > > + ret = clk_prepare_enable(phy->ref_clk); > > + if (ret) { > > + dev_err(phy->dev, "%s: ref_clk enable failed %d\n", __func__, > ret); > > + return ret; > > + } > > + > > + dev_info(phy->dev, "UFS MPHY ref_clk_rate = %ld\n", > > +clk_get_rate(phy->ref_clk)); > > debug pls > Sure, will change > > +static int samsung_ufs_phy_init(struct phy *phy) { > > + struct samsung_ufs_phy *_phy = get_samsung_ufs_phy(phy); > > ss_phy perhaps? > Sure, will change > > + int ret; > > + > > + _phy->lane_cnt = phy->attrs.bus_width; > > + _phy->ufs_phy_state = CFG_PRE_INIT; > > + > > + if (_phy->drvdata->has_symbol_clk) { > > + ret = samsung_ufs_phy_symbol_clk_init(_phy); > > + if (ret) > > + dev_err(_phy->dev, "failed to set ufs phy symbol > clocks\n"); > > + } > > + > > + ret = samsung_ufs_phy_clks_init(_phy); > > + if (ret) > > + dev_err(_phy->dev, "failed to set ufs phy clocks\n"); > > + > > + samsung_ufs_phy_calibrate(phy); > > + > > + return 0; > > not return samsung_ufs_phy_calibrate() ? > -- Will add an error path. > ~Vinod