Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp1542526rwl; Fri, 4 Nov 2022 15:38:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM61eqDQ0MopiN1aYhu5knDnHbfihI6+K7fL1wvfnSOnSd8LTiUnhg3T/D188Qzq2R+hllRM X-Received: by 2002:a17:90b:38c:b0:212:fe14:4ba0 with SMTP id ga12-20020a17090b038c00b00212fe144ba0mr56422530pjb.138.1667601514700; Fri, 04 Nov 2022 15:38:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667601514; cv=none; d=google.com; s=arc-20160816; b=kfrq0nqRZzHctu4sVfF6hVVHTdnvK0a9EvV3nkfQp1LDBXfKgMK5P+i3GGzEl7Dxuc jI1tvrrmtPND9i5eT/+4ow2pKnXqmk619svWnEILtOVhCtFGXJWEFE2aVqaT9Wta/Du/ WXljt/l6ciEq6UE/ViIXTz4LZRwp6DxVCjjT7a4Ub9VZIqqeUowP4gMZyIdIWpgkZRMs Z0E+qW2IRP/F7jiwJbax1pxsG+ETeYPIpdMOxGtgpOulOUcFbJhIsG/dXnaMHld8+6i7 SE64+YxT80+0ev9E+vC7TZvIlUjEMUZIIKEz+rQEdqXNclw9CtxYF6G5YtAzw6d0EJ/6 aX3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=OUWMpfCp8yMYMN27hOBTPmmaRDIODrfLy/QYyrxVC9U=; b=gG8UMeDSvm1RVWGceRk+0tljAQPrDtrei9nqUfiXVt1LiEcHFSfgSXGMGtfJTWAO5X batf9alnSPRrnXiui1wzdqC9Tv2PAIfSCFR6gGaYkxTEGHr2Mn5kwIRo5l8F74oxdS1f EJyCsxMvhQ6OfgPz/qvqxhy+Hc4CfNPSgvbY0hq5ND/Gab9pLfrWaIsGApvn0qyYEhYT QWqX8uUr9w8s2qQADRR1SKX4k8XkmFpRtrmyS62nccnrQBXmgk80H0G6WsMDXOkpQIfZ qnTePMXHK8ksqM8k9HwWD5zMqZzOlcmmRUS//k27Ay9qa2rIeUyAo/DgLqpOa/9R8CR4 fJyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="N/5MobyC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i18-20020a170902e49200b0017e90e88875si676917ple.384.2022.11.04.15.38.22; Fri, 04 Nov 2022 15:38:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="N/5MobyC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229851AbiKDWIp (ORCPT + 98 others); Fri, 4 Nov 2022 18:08:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbiKDWIl (ORCPT ); Fri, 4 Nov 2022 18:08:41 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9193FCFE for ; Fri, 4 Nov 2022 15:08:38 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id l11so9571856edb.4 for ; Fri, 04 Nov 2022 15:08:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=OUWMpfCp8yMYMN27hOBTPmmaRDIODrfLy/QYyrxVC9U=; b=N/5MobyCqMqaDHUf0VYAeGDlaShVI6gW3R/fr1tLkTjRzSd0mrwTwe6AgO1bc6rMAQ vGqaYuhfvQ82vWTraoh76WIR9XOumQyzsOIhiQlm7A5wwEuKKd3o4BWpzigWjyVJAaHB lXa1OaNbz5gonB88NC84ox0/3fAaw8jeOZ6TU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OUWMpfCp8yMYMN27hOBTPmmaRDIODrfLy/QYyrxVC9U=; b=nw2fZIhpF5FPsiehg5jAkHLgGyWu8jWxOg+HnvzVZcTrGY7GPC0VQQ34xwQbT+Jw0l N+R5mG4q/rKP3JervQFO6ytEODkgrgb7EkS8Rqt8vUdbzPxDpcBNpuydt5i7ryZ7sS8n /HBbfzmi8F79Te5N2KPW5+RClVmWp6G8u+WtgF1/caWapEgh3b8yDT79nQZSAFKJ6NDo EI/EuYeWBVXP58B/DIPI/NRhGZ1BN6w2MCwhhyJpkFhedYpBRonEAddU3TVwP7NdNhdg z+ZxJAUOueFs6xupgub572mYG1mF5Lazi2xI6scCUaecSljKt9qbTK/9O2HIlPcXMmEk f9qw== X-Gm-Message-State: ACrzQf334kOADTdHWmgUcpF74siGJ8kOXjuqQoz37LoowRVaBfdrJDfx Eqnc3IsEtF4XmHOEXH5UbNwmmKnkpZ6P1Fhu X-Received: by 2002:a05:6402:3510:b0:461:f781:6dfe with SMTP id b16-20020a056402351000b00461f7816dfemr36633065edd.272.1667599717241; Fri, 04 Nov 2022 15:08:37 -0700 (PDT) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com. [209.85.128.49]) by smtp.gmail.com with ESMTPSA id j10-20020aa7c0ca000000b00459ad800bbcsm321696edp.33.2022.11.04.15.08.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Nov 2022 15:08:32 -0700 (PDT) Received: by mail-wm1-f49.google.com with SMTP id ay14-20020a05600c1e0e00b003cf6ab34b61so6224414wmb.2 for ; Fri, 04 Nov 2022 15:08:29 -0700 (PDT) X-Received: by 2002:a05:600c:2212:b0:3cf:6068:3c40 with SMTP id z18-20020a05600c221200b003cf60683c40mr25419745wml.57.1667599706005; Fri, 04 Nov 2022 15:08:26 -0700 (PDT) MIME-Version: 1.0 References: <20221104064055.1.I00a0e4564a25489e85328ec41636497775627564@changeid> <20221104064055.2.I49b25b9bda9430fc7ea21e5a708ca5a0aced2798@changeid> In-Reply-To: From: Doug Anderson Date: Fri, 4 Nov 2022 15:08:12 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/3] clk: qcom: lpass-sc7180: Fix pm_runtime usage To: Stephen Boyd Cc: Bjorn Andersson , Taniya Das , Dmitry Baryshkov , Judy Hsiao , Srinivasa Rao Mandadapu , Matthias Kaehlcke , Andy Gross , Konrad Dybcio , Michael Turquette , Stephen Boyd , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Fri, Nov 4, 2022 at 2:19 PM Stephen Boyd wrote: > > Quoting Douglas Anderson (2022-11-04 06:56:29) > > The sc7180 lpass clock controller's pm_runtime usage wasn't broken > > quite as spectacularly as the sc7280's pm_runtime usage, but it was > > still broken. Putting some printouts in at boot showed me this (with > > serial console enabled, which makes the prints slow and thus changes > > timing): > > [ 3.109951] DOUG: my_pm_clk_resume, usage=1 > > [ 3.114767] DOUG: my_pm_clk_resume, usage=1 > > [ 3.664443] DOUG: my_pm_clk_suspend, usage=0 > > [ 3.897566] DOUG: my_pm_clk_suspend, usage=0 > > [ 3.910137] DOUG: my_pm_clk_resume, usage=1 > > [ 3.923217] DOUG: my_pm_clk_resume, usage=0 > > [ 4.440116] DOUG: my_pm_clk_suspend, usage=-1 > > [ 4.444982] DOUG: my_pm_clk_suspend, usage=0 > > [ 14.170501] DOUG: my_pm_clk_resume, usage=1 > > [ 14.176245] DOUG: my_pm_clk_resume, usage=0 > > > > ...or this w/out serial console: > > [ 0.556139] DOUG: my_pm_clk_resume, usage=1 > > [ 0.556279] DOUG: my_pm_clk_resume, usage=1 > > [ 1.058422] DOUG: my_pm_clk_suspend, usage=-1 > > [ 1.058464] DOUG: my_pm_clk_suspend, usage=0 > > [ 1.186250] DOUG: my_pm_clk_resume, usage=1 > > [ 1.186292] DOUG: my_pm_clk_resume, usage=0 > > [ 1.731536] DOUG: my_pm_clk_suspend, usage=-1 > > [ 1.731557] DOUG: my_pm_clk_suspend, usage=0 > > [ 10.288910] DOUG: my_pm_clk_resume, usage=1 > > [ 10.289496] DOUG: my_pm_clk_resume, usage=0 > > > > It seems to be doing roughly the right sequence of calls, but just > > like with sc7280 this is more by luck than anything. Having a usage of > > -1 is just not OK. > > > > Let's fix this like we did with sc7280. > > Any Fixes tag? Ah, right. I guess the most obvious one is actually: Fixes: ce8c195e652f ("clk: qcom: lpasscc: Introduce pm autosuspend for SC7180") That's what got us going negative. One could _sorta_ make the argument for a "Fixes" tag all the way to the start of the driver, though. The driver never did a pm_runtime_get() during probe and so there was (I guess) a chance that some of the bare register writes in probe could have been unclocked. I'm not aware of that ever being a problem, so I guess just the above "Fixes" is fine. > > Signed-off-by: Douglas Anderson > > --- > > Reviewed-by: Stephen Boyd Thanks! Yell if you want me to spin a v2 with the Fixes in place. -Doug