Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2433887ybi; Mon, 1 Jul 2019 12:00:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyF8eFp5NPjPkV6KG8MO+giHHbq1eFv16hRNymp+ftVw8DyG9iAglBUUStoEaUIcrVYTscq X-Received: by 2002:a63:1208:: with SMTP id h8mr25257834pgl.377.1562007651501; Mon, 01 Jul 2019 12:00:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562007651; cv=none; d=google.com; s=arc-20160816; b=U5870Icp2i2t64HSev3qK72OzfIk9iG+JjrraUKRLbBrT0+fBgvvnz2sMY6hQW8qUQ 4bBKTUbOsaL8uBdj9BP7SlzjbRK3KcrafvqXR39nyCUh2QeDGhjo6+z9AqnyM8LukPnU n3q2YdZiZGWAuPlgvHxQAxPxKLB25QfpkCI2PQglDQmd+Ef4ZEDRiewGs42A7rcUb6xv 6L/K587KaVR/comXeHroDzzqDGjjRU6fVCs5ZgVIpN9ouqpggSu3gPfBq6MfGArqAJsW SzoRTYcxAaSMz4u2ldozRW5FsH+BNV+Sw5Qn4hGK01E5qAL/+GnnqcO6FJHjSmK+SSz4 g5yQ== 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=pHrGNQ49AaGKJ3l+4A7hkHqbH10XRgFjiNEVRByexR0=; b=EewOmguhTnXwUN9a8WEGAEwsODCowLuAk172pMOXX/sMkpophLX2D6Wio43vUhLeWw /iGCFI3Bt0priL3W7V93DCvO1nTl13fkyhEeeTujhsXdxZbaqdqMsnGpAVrCylwiHrWB hnCQraiDEBQH6QaYPYH5wxL5J36Nwr6dZJz/ZjDG5f7sC7G6Oiar8sICJhY2zXkfFNia gwIRM88aTPzkAotOLOYCscE5yc1Tq/6YR8Fuo1tTXq4QH2LXPS7H/WKy5v+vb9KfiB6K iQ9I1gRWiVGrZQX5UADu2LNpX/IsazroKoAirM7KzvhdeVQv4J8p3bZOnLrSAt39MDUb 5ovQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KnI0hNv+; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r200si12335211pfc.281.2019.07.01.12.00.35; Mon, 01 Jul 2019 12:00:51 -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=@gmail.com header.s=20161025 header.b=KnI0hNv+; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726951AbfGAS6d (ORCPT + 99 others); Mon, 1 Jul 2019 14:58:33 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:38649 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726652AbfGAS6d (ORCPT ); Mon, 1 Jul 2019 14:58:33 -0400 Received: by mail-ed1-f65.google.com with SMTP id r12so24799257edo.5; Mon, 01 Jul 2019 11:58:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pHrGNQ49AaGKJ3l+4A7hkHqbH10XRgFjiNEVRByexR0=; b=KnI0hNv+Jm46TmYLlPKsmbOgIdkFU9NMS+sxpx73WzhyzihHn8mGQa6KhunsFLfIBp 5zCQKX5e9B7ggcGBQ0Zy4ZTX7E02YVQs25zw2xE3BhCZOoMWxtB4OEXaclCyDiyF8cio 9SyP7Sh22xPwcZ9IH1Bv7zEpU1Yq36dPnsqHZaq69dHddDoS3/5CLzEH2vul0Va9kU7h 28S1oRGwKughSArRM+yc7SXpbYuzxptwaUbrKZlybcH61HEYKYx7xR5S98Aidkd0U4U1 gcJqV+5YulFaz2eAE/DI58LLwVW7NN1Nv1z1lVNXwcyvTR03LFmrLTVlQ18dtGjOVJ2l 1bIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pHrGNQ49AaGKJ3l+4A7hkHqbH10XRgFjiNEVRByexR0=; b=UsnxbttqtLncS/ZEe1Mhec0jW02EHvBOSVEHgir1+wMsDTPT6CmuYH9ZmQnTZYCZOD R5Impga3eIMlg6f15+oLFhEp/LxY1mliW04ijkJg28L47xHtMOJBw/ZZ5cQUoawgC9OE YxSrU4ctJiBYoUReeNgH9Q5YnJ00w2scSkURyGZzIvDnqiYDOXxHUQR7hq1pq4yMbYVL nA/IVWSuDNRckQIzjwszDnb25BWD1pGa3RQlygfxg4VqW6K2yy1509xw4j5qUOVMNLa4 nbL6Ha07l6NzpNeJScL1qaj9Az1czPeZ0F39GACIYPjIcTxdBlnpzJ/H8qyKhEfo+jer dAAw== X-Gm-Message-State: APjAAAX3h0TSCzgCknfqU2ozmDsrGvcT6l49cHSF297kcZFsKcv/ZxeD 3+x1kakmdvB2josJevSLEISqTnqiCDSLxoktHTo= X-Received: by 2002:a50:9468:: with SMTP id q37mr30780649eda.163.1562007510992; Mon, 01 Jul 2019 11:58:30 -0700 (PDT) MIME-Version: 1.0 References: <20190630150230.7878-1-robdclark@gmail.com> <20190630150230.7878-5-robdclark@gmail.com> <75a2921d-bf1a-c4c1-6d9a-122474eface4@codeaurora.org> In-Reply-To: <75a2921d-bf1a-c4c1-6d9a-122474eface4@codeaurora.org> From: Rob Clark Date: Mon, 1 Jul 2019 11:58:15 -0700 Message-ID: Subject: Re: [PATCH 4/5] drm/msm/dsi: get the clocks into OFF state at init To: Jeffrey Hugo Cc: dri-devel , linux-arm-msm , freedreno , aarch64-laptops@lists.linaro.org, linux-clk , Linux PM , Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Jordan Crouse , Abhinav Kumar , Sibi Sankar , Mamta Shukla , Chandan Uddaraju , Archit Taneja , Rajesh Yadav , Linux Kernel Mailing List 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 Mon, Jul 1, 2019 at 11:37 AM Jeffrey Hugo wrote: > > On 6/30/2019 9:01 AM, Rob Clark wrote: > > From: Rob Clark > > > > Do an extra enable/disable cycle at init, to get the clks into disabled > > state in case bootloader left them enabled. > > > > In case they were already enabled, the clk_prepare_enable() has no real > > effect, other than getting the enable_count/prepare_count into the right > > state so that we can disable clocks in the correct order. This way we > > avoid having stuck clocks when we later want to do a modeset and set the > > clock rates. > > > > Signed-off-by: Rob Clark > > --- > > drivers/gpu/drm/msm/dsi/dsi_host.c | 18 +++++++++++++++--- > > drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c | 1 + > > 2 files changed, 16 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c b/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c > > index aabab6311043..d0172d8db882 100644 > > --- a/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c > > +++ b/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c > > @@ -354,6 +354,7 @@ static int dsi_pll_10nm_lock_status(struct dsi_pll_10nm *pll) > > if (rc) > > pr_err("DSI PLL(%d) lock failed, status=0x%08x\n", > > pll->id, status); > > +rc = 0; // HACK, this will fail if PLL already running.. > > Umm, why? Is this intentional? > I need to sort out a proper solution for this.. but PLL lock will fail if the clk is already running (which, in that case, is fine since it is already running and locked), which will cause the clk_enable to fail.. I guess there is some way that I can check that clk is already running and skip this check.. BR, -R