Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8092205ybi; Thu, 6 Jun 2019 06:36:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9JyNdkfZKYnjK/o5YJhJg9dzzwL52DP9vtI2KgS2AcCvsD6C8iOrg0gu/MibcXWBWOmS+ X-Received: by 2002:a62:1dd0:: with SMTP id d199mr549052pfd.257.1559828214298; Thu, 06 Jun 2019 06:36:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559828214; cv=none; d=google.com; s=arc-20160816; b=C7BdzmsNYE9sy8wT/TQxY8FIhmze43b/n74kYqaupYuB7ODgtIYRy2kPLHMhDf6bku r4NyXQvAALSSvQQHeScWGc2tMktce36KhTHNgq+puMi1uKyE6P+SHQSMT9fGFYrMDCNL W9I6RZg/2b3Rg/xCmQVZFg8Xw0mxnpuNQnutDymVnobsm+eG3cPDC1hRfw4+onbOQa8R 0ZFD2/WGZ0SINgU3y9Ky/vAowPZ96uwjuASKjrYEVa3993YkV8F/v4qI7lsjPlP4srDw MK5oaw5N+88sy/2vuEeGCsqiey4xw+d9RIJfLDR2W94tzadoBjMfAhy/e4dDpsTXNr1Z N+8g== 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-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:cc:to:subject:dkim-signature :dkim-filter; bh=3M/G3KWFVRvfQVQ8wa9cPwyi0fym0xnczXtfcnAQRG0=; b=dT9t7z2uGnIerKDPkEQAXx53s/clkMFO+GJPfjTGue/D/vYToOW9z7ba4PrnvyC4UZ T+B8PGTKHpA9OKyjxHTb/FAIQvTQrqDljTlzeQnXZvvBfrMGKVpNM6JynAm2mdwxJug1 cZbDmODNvSc2PT2EHLttF1U2t9HWeHZFWXSaDQyDjUKjA6xI3KqbSPyrZ5puQ7o+DRFj 6Lwl2yZEMJ/cdH/AtyggtO8qnKf1az7Ey3d72doQhrrnKOUu63KicTcEASMeYEWh8sgL Ubm/Wf9Kg2odflqp8w+2f2yNGTbZRLTD4/po4af70EfFua/azn9zZqdBwS4fAx2qGTLm 8Ajw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="Cfnogv/S"; 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=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i5si2076905pgs.4.2019.06.06.06.36.36; Thu, 06 Jun 2019 06:36:54 -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=@samsung.com header.s=mail20170921 header.b="Cfnogv/S"; 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=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728168AbfFFNfY (ORCPT + 99 others); Thu, 6 Jun 2019 09:35:24 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:52650 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726092AbfFFNfX (ORCPT ); Thu, 6 Jun 2019 09:35:23 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190606133522euoutp017913b75abaf44c742bc9f572f3375e61~ln2mwU5Zk1755617556euoutp01i for ; Thu, 6 Jun 2019 13:35:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190606133522euoutp017913b75abaf44c742bc9f572f3375e61~ln2mwU5Zk1755617556euoutp01i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1559828122; bh=3M/G3KWFVRvfQVQ8wa9cPwyi0fym0xnczXtfcnAQRG0=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=Cfnogv/SUNySPtfO1s6wo4wPMFrpvsEWHiOt0LzzzeZk2jAfQANxzICiJJYIDGthu 4OuvVJSsRpM4032f9RCnZGWZsn62MWYJlbSvCF2bMLKaeJILjGDdDNWD2XhgYls51+ O7Anr7Y78KZRqfVPSSO5iO/nj6ZeEcCXdj+TTua8= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190606133521eucas1p2c06084f280b0af1f5474a0830a049122~ln2mAzf9n1223512235eucas1p2r; Thu, 6 Jun 2019 13:35:21 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 76.19.04325.99619FC5; Thu, 6 Jun 2019 14:35:21 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190606133520eucas1p14b8720349f70eceba874d3ff204ef08f~ln2lJiHCi1256112561eucas1p1P; Thu, 6 Jun 2019 13:35:20 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190606133520eusmtrp1d5ff5cb7f1790f6052802ef3631b0a99~ln2k52IWp2328723287eusmtrp1D; Thu, 6 Jun 2019 13:35:20 +0000 (GMT) X-AuditID: cbfec7f5-b75ff700000010e5-08-5cf916994751 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 46.6B.04140.89619FC5; Thu, 6 Jun 2019 14:35:20 +0100 (BST) Received: from [106.120.51.20] (unknown [106.120.51.20]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190606133519eusmtip1ab9099e80e7fcadbbf9caeb0b6f4d20b~ln2kMtXz02303323033eusmtip17; Thu, 6 Jun 2019 13:35:19 +0000 (GMT) Subject: Re: [PATCH v8 08/13] drivers: memory: add DMC driver for Exynos5422 To: Krzysztof Kozlowski Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, "linux-samsung-soc@vger.kernel.org" , =?UTF-8?Q?Bart=c5=82omiej_=c5=bbo=c5=82nierkiewicz?= , kgene@kernel.org, Chanwoo Choi , kyungmin.park@samsung.com, Marek Szyprowski , s.nawrocki@samsung.com, myungjoo.ham@samsung.com, keescook@chromium.org, tony@atomide.com, jroedel@suse.de, treding@nvidia.com, digetx@gmail.com, willy.mh.wolff.ml@gmail.com From: Lukasz Luba Message-ID: <20a5e3a9-3ac9-2bb6-2c26-fab02d92c2b4@partner.samsung.com> Date: Thu, 6 Jun 2019 15:35:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA02Sa0gUURTHuzszO6O0y+xYerCHtPQhA60s8EYlBiKDGuSHooeQU04muZvu qGUWrdnTtIeW5apsQZKsiWmSupHRalm+TUvTXuRSZBqIr7Y0cpwiv/3u+f/PPed/uQzBDVLe TJwxSTQZhXi92p188MzV5pfv6Ypa3VdO44ob5RTuGftCYWtDG4VLRwYQzm0qUuGWCwZ8aeAb gdvb79G49eQQjbvshWo8mt2A8I32OhUua3hH4/70EjWuHzpL4cfdYbj/lxZPPP+Egjl+YjyH 5AvMnSRfa3lH85W282o+O+O7mr9YZUP8/eY0frRy6VZml/vGGDE+LkU0rQqKdj+Qa/9IJ7To jjjejhJm9FSTidwYYNfB7dIPKBO5MxxbgiCvtxjJAseOIbhwapkijCJ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BbBEBTYnrf78D2VwczAIb WSQuvuplAnGEBKYwS1y5tJ4dZBmbgJ7EjlWFIA28Am4SJzsnMoPYLAIqEs8mXGUEsUUFIiRm 72pggagRlDg58wmYzSkQKHHs1EWwg5gFzCTmbX7IDGGLS9x6Mp8JwpaX2P52DvMERqFZSNpn IWmZhaRlFpKWBYwsqxhFUkuLc9Nzi430ihNzi0vz0vWS83M3MQKjftuxn1t2MHa9Cz7EKMDB qMTDO4PpZ4wQa2JZcWXuIUYJDmYlEd6yCz9ihHhTEiurUovy44tKc1KLDzGaAj03kVlKNDkf mJDySuINTQ3NLSwNzY3Njc0slMR5OwQOxggJpCeWpGanphakFsH0MXFwSjUwugQyXMl+22jQ dGPujKs+ntPWnZ4vGxG5RenBesOrk7bU9VmWrVrZWFon+IJt3w32r16fVnDOn5dsunv/+9/i PNGHLddfYl2/Zo7diTMsp75vnHvjd/zDrfLtrfe4dvUaXIpedvrD+z0n+Ddkv/znf6V99r0F SkcTyp+w779qx/W7KKL6FDdHQZoSS3FGoqEWc1FxIgCfs1vCEAMAAA== X-CMS-MailID: 20190606133520eucas1p14b8720349f70eceba874d3ff204ef08f X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20190605165435eucas1p2fa32f4583f396fdce443b6943ac180d3 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190605165435eucas1p2fa32f4583f396fdce443b6943ac180d3 References: <20190605165410.14606-1-l.luba@partner.samsung.com> <20190605165410.14606-9-l.luba@partner.samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/6/19 1:45 PM, Krzysztof Kozlowski wrote: > On Thu, 6 Jun 2019 at 12:38, Lukasz Luba wrote: >> Hi Krzysztof, >>>> +/** >>>> + * exynos5_dmc_init_clks() - Initialize clocks needed for DMC operation. >>>> + * @dmc: DMC structure containing needed fields >>>> + * >>>> + * Get the needed clocks defined in DT device, enable and set the right parents. >>>> + * Read current frequency and initialize the initial rate for governor. >>>> + */ >>>> +static int exynos5_dmc_init_clks(struct exynos5_dmc *dmc) >>>> +{ >>>> + int ret; >>>> + unsigned long target_volt = 0; >>>> + unsigned long target_rate = 0; >>>> + >>>> + dmc->fout_spll = devm_clk_get(dmc->dev, "fout_spll"); >>>> + if (IS_ERR(dmc->fout_spll)) >>>> + return PTR_ERR(dmc->fout_spll); >>>> + >>>> + dmc->fout_bpll = devm_clk_get(dmc->dev, "fout_bpll"); >>>> + if (IS_ERR(dmc->fout_bpll)) >>>> + return PTR_ERR(dmc->fout_bpll); >>>> + >>>> + dmc->mout_mclk_cdrex = devm_clk_get(dmc->dev, "mout_mclk_cdrex"); >>>> + if (IS_ERR(dmc->mout_mclk_cdrex)) >>>> + return PTR_ERR(dmc->mout_mclk_cdrex); >>> >>> You are not enabling this clock. It is divider so it is fine for him >>> but what about its parents? How can you guarantee that parents are >>> enabled? >> It uses two parents in this configuration: >> 1. 'mout_bpll' which is set by the bootloader and is a default mode >> 2. 'mout_mx_mspll_ccore' which is used temporary as a 'bypass clock >> source' only for the time when BPLL is changing it's settings >> >> Do you suggest to put a call: >> >> to make sure the parent is up and running? >> OR just move the lines from the end of this function: >> clk_prepare_enable(dmc->fout_bpll); >> clk_prepare_enable(dmc->mout_bpll); >> and add: >> ret = clk_set_parent(dmc->mout_mclk_cdrex, dmc->mout_bpll); >> then call the clk_get_rate on 'mout_mclk_cdrex' >> > > Ah, It's my mistake. I missed that later you enable its new parent. It's fine. OK, so I will leave it as is and just fix the other stuff that you've mentioned. Regards, Lukasz > > Best regards, > Krzysztof > >