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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A63FC4332F for ; Wed, 2 Nov 2022 02:49:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230457AbiKBCtf (ORCPT ); Tue, 1 Nov 2022 22:49:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230448AbiKBCte (ORCPT ); Tue, 1 Nov 2022 22:49:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 882D31FFA7; Tue, 1 Nov 2022 19:49:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 070D9B82072; Wed, 2 Nov 2022 02:49:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F206C433C1; Wed, 2 Nov 2022 02:49:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667357370; bh=W4fAhnKbB727M/BBd7ZkvwyarygTC85F2EeJtyYUMec=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hvbtbU6E38Y8CQ1GJX/u7/GDZTJHDaRxGZPkNR8g/2SDCyeCVX2JhV/PzMO5LTcJa rTDRkc0lPxIVjIGfpF38bwThUYCS4wiUpyE37ZHDX2IzapaZWA5dXmhiQWX3WzXbAI kBKRIHR6Nz+qy4gjr/ZFmsu++QCrzvGVU6lT/uPNPrlBjrYnjhfTiMG4/faK0wSP3w nyr4VXFUxqyirIXSv5uyfCOKJLluzF5a9pTbsaJaEIGG4+hS2qSrfSymwNfeHlcLtR SyldkVAXhNW98BRCwZSZjBZDh3IhqnEUoEvxmWz6wkEsvb6X7xOTpx85uaRdELQffi 6RNvz62EWserA== Date: Tue, 1 Nov 2022 21:49:27 -0500 From: Bjorn Andersson To: Stephen Boyd Cc: Michael Turquette , Stephen Boyd , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, patches@lists.linux.dev, Andy Gross , Konrad Dybcio , linux-arm-msm@vger.kernel.org, Dmitry Baryshkov , Johan Hovold , Ulf Hansson , Taniya Das , Satya Priya , Douglas Anderson , Matthias Kaehlcke Subject: Re: [PATCH] clk: qcom: gdsc: Remove direct runtime PM calls Message-ID: <20221102024927.n5mjyzyqyapveapa@builder.lan> References: <20221101233421.997149-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221101233421.997149-1-swboyd@chromium.org> Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org On Tue, Nov 01, 2022 at 04:34:21PM -0700, Stephen Boyd wrote: > We shouldn't be calling runtime PM APIs from within the genpd > enable/disable path for a couple reasons. [..][ > Upon closer inspection, calling runtime PM APIs like this in the GDSC > driver doesn't make sense. It was intended to make sure the GDSC for the > clock controller providing other GDSCs was enabled, specifically the > MMCX GDSC for the display clk controller on SM8250 (sm8250-dispcc), so > that GDSC register accesses succeeded. That will already happen because > we make the 'dev->pm_domain' a parent domain of each GDSC we register in > gdsc_register() via pm_genpd_add_subdomain(). When any of these GDSCs > are accessed, we'll enable the parent domain (in this specific case > MMCX). > It's correct that adding the GDSCs as subdomains for the device's parent-domain will ensure that enabling a GDSC will propagate up and turn on the (typically) rpmhpd resource. But the purpose for the explicit calls was to ensure that the clock controller itself is accessible. It's been a while since I looked at this, but iirc letting MMCX to turn off would cause the register access during dispcc probing to fail - similar to how clk_pm_runtime_get()/put() ensures the clock registers are accessible. Perhaps I misunderstood something in the process, or lost track of the actual issues? Regards, Bjorn