From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4E90C433EA for ; Thu, 16 Jul 2020 01:29:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 862A120791 for ; Thu, 16 Jul 2020 01:29:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="sDJkD157" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728051AbgGPB30 (ORCPT ); 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/zULy1ywkD8xC2LaAkWUVo2RqQXFuemqxaYFhXmq5XnFibnFpXrpecn7u JkZwQtLy3MF498EHvUOMTByMhxglOJiVRHh5uHjjhXhTEiurUovy44tKc1KLD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qK/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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEE1FC433E1 for ; Thu, 16 Jul 2020 01:31:20 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A972B20775 for ; Thu, 16 Jul 2020 01:31:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="g1318n5n"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="sDJkD157" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A972B20775 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:MIME-Version:Message-ID:Date:Subject: In-Reply-To:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mro9Pbf6r1KIfNTXrwCeui9P6whVEjIZhPnAWQ8gd14=; b=g1318n5nV6/aQ3xxSEr6HKM39 02nTTJCsu/yyzbVq7pVkMfwF/xiy2kfFSFVC1MQT09dnYI7QahA/Ms6c6euZWpk85cIb5WlEamyuC ro9Ct8ErlbGUahhgIqI9v3I6239FXEpmtxoQkj6fB5L9WBGkt7NdRrIa+/1CtcG6/obFsGdGhpBne 91zKFwHahqTKGsWIflu7vJ65x/pr1bMFV8lYTXKyJxLhcvp5nbsBPG/Lb5wfPl/o7C25GC8ltbkNd 2jHwp+cVjmEpzEKmj0idGHtz9Nbqbrq6adVCWnvdvCi/l73bOMnac2aDrincaMfAvdYHI/khQloly hGig2IKFw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvsiK-0000Rf-2k; Thu, 16 Jul 2020 01:29:32 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvsiG-0000Qh-Ob for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 01:29:30 +0000 Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20200716012921epoutp0137cd987c1432f0622360fd771ab0c8fb~iF2nJ2u5f0891108911epoutp01L for ; Thu, 16 Jul 2020 01:29:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20200716012921epoutp0137cd987c1432f0622360fd771ab0c8fb~iF2nJ2u5f0891108911epoutp01L 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'" 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 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 rCBVbAK6EjsWt4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Z4i4tMT1jRPYIWxhiZX/ngPZXEA1rxgl7t/sYQVJsAnoSuxY3MYGYosIqEps efKADaSIWeAdo8TufSfZIDoeM0pcOHIXrIpTwEDi1L9LLCC2sECgxKLZ75hAbBag7ltfXjOD 2LwClhLnll5mhLAFJU7OfAJUzwE0VU+ibSNYmFlAXmL72znMENcpSPx8uowVpEREwE3i870i iBJxiaM/e5gnMArPQjJoFsKgWUgGzULSsYCRZRWjZGpBcW56brFhgVFearlecWJucWleul5y fu4mRnBkaWntYNyz6oPeIUYmDsZDjBIczEoivDxcvPFCvCmJlVWpRfnxRaU5qcWHGKU5WJTE 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200715_212929_229700_E25FBEA2 X-CRM114-Status: GOOD ( 22.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, krzk@kernel.org, kwmad.kim@samsung.com, robh+dt@kernel.org, kishon@ti.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel