Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8031014ybi; Thu, 6 Jun 2019 05:41:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqz86NGOWgKNbvPcOORTSiIinxGwxSd1712mGFHa5oNav3tz6eKnU1+ZLdIOeLN0Y5zs/Fej X-Received: by 2002:aa7:8b17:: with SMTP id f23mr17233409pfd.194.1559824873807; Thu, 06 Jun 2019 05:41:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559824873; cv=none; d=google.com; s=arc-20160816; b=C9HEEaYBmEDxwVv1Ud+n9VSMootdMbW9UN8fMIY65T1sKJxPa206S/tl00CpgqW14b 9GSMX8sQJmU46cotztvr6bzxdgDo5mPnLrx6plPAMoUTlOPnk0njdGdvn/mgJOvQguWb 8Gk085XY1DFjiy1xQqPZ+dyzm2eisLT13SSZZh7tY7cG1+aZQhHGgh8Qm0SpoPBwFdgo oZpEL+cZB8scn6WHovNRiAj2LAdYeQGfOJlTyADAqGSumoD2xeulc3ldIr3fhpDh+WH+ 5aHJLJxZLjL3xe8vXD6ql+l34xLCwJTiCk9T9gM8GWFzSgQCirgjleVqUNLJxZ1X4iEO a2pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Lb0vvb3vvELT226+WzbMRgshI/ZGxf7ciP1NG5wt9sw=; b=ZnQ/FJkFGevx8RU8DJy/txklyBBupEcDOFk4jUywvV7Y7xIeXjXvUsK2yPypuQb9Aj LYEH7p6XwCS4QgaCKGkgsusx+nyLvHWbMCJqxQ70mHLGkrgSznlP5jhupH6HXdfbv+Qb uwcEvBglJehjYg1JeQkYGapx3tQXA5n0ahFCxAn39v3pC77hoqXx09oSvpC7WN7cPRI2 7iKwr3lA/R6CWN8Cc84ojgIjUZw49m8qFrvuQyKQOvWk1svHT6dFqfHy91UAKaYCKoCh jwtVP9AkTKN2+TTESWbYR2asEBHnY/cJVYgac6ELr2HV6h3dTIc73LOK5Y/SAuYIecs3 5fjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=b6yQ9oA8; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f91si1848738plf.300.2019.06.06.05.40.57; Thu, 06 Jun 2019 05:41:13 -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=@kernel.org header.s=default header.b=b6yQ9oA8; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727603AbfFFLpa (ORCPT + 99 others); Thu, 6 Jun 2019 07:45:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:37876 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725267AbfFFLp3 (ORCPT ); Thu, 6 Jun 2019 07:45:29 -0400 Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A3439208C0; Thu, 6 Jun 2019 11:45:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559821529; bh=vqDCsXe5IHyavNfXW5krmCev6CdBmExEhG6HMAbCLhc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=b6yQ9oA8ENOTDIff2KAsFD3F/2NkJA10BoHe6N5aygghiYufyZUDmWLKLSdgY/2s5 QQA61xYx11ZD/CnuimtlFIGJchk3K7856I/p/OqUxgKQkOimJQRTh34vyKAti116SA mkz/P+8qVzFpnMqqL0jlMYlxU+pMuzxiC9qeMHPE= Received: by mail-lj1-f179.google.com with SMTP id o13so1698278lji.5; Thu, 06 Jun 2019 04:45:28 -0700 (PDT) X-Gm-Message-State: APjAAAWiOTPzDmE/LU8D7L/BDloXUFNUy0KceyVOuijhcpa1FQLxAL9+ TyccQOEht1ts/3ZDFib7qr3UdEmvgcrIcXkteT4= X-Received: by 2002:a2e:568d:: with SMTP id k13mr23893341lje.194.1559821526851; Thu, 06 Jun 2019 04:45:26 -0700 (PDT) MIME-Version: 1.0 References: <20190605165410.14606-1-l.luba@partner.samsung.com> <20190605165410.14606-9-l.luba@partner.samsung.com> In-Reply-To: From: Krzysztof Kozlowski Date: Thu, 6 Jun 2019 13:45:15 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v8 08/13] drivers: memory: add DMC driver for Exynos5422 To: Lukasz Luba Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, "linux-samsung-soc@vger.kernel.org" , =?UTF-8?B?QmFydMWCb21pZWogxbtvxYJuaWVya2lld2ljeg==?= , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Best regards, Krzysztof