Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3013375rwb; Mon, 15 Aug 2022 16:09:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR5uSLBLCbbG2kPnmrbsMc3AjZsixUHH7syz2Rq+lCegZncicGbIJQ3l0C077/M0+nGOtx29 X-Received: by 2002:a05:6402:2813:b0:442:bfc8:5d34 with SMTP id h19-20020a056402281300b00442bfc85d34mr15969635ede.114.1660604947175; Mon, 15 Aug 2022 16:09:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660604947; cv=none; d=google.com; s=arc-20160816; b=zlsDaWKXaDwWuPHvH+UsRYnhlip1xOMKhLLGYWtezbhH5JEGtBICoHDW0LAXqEgrnr da4zXgN1iw6SE0Ot1zQkuF84QUhG5DdQTlOjFmcRGp9GK7mhFn0gfc9OJURynhWga7HK keli+KMqnjEld2nzcirH2ylljcAgP5AaHjx+3+AFyDoKNrBz9KnIB1Bi26wnO0mz8Mw/ Do0dLYgV8rpLpmiuyKkqdz7xXs2zxiQmrbNyMU59PBPDQwu2Hn4SJMbPRJ4iVaW3DVTG nxT+7caPzN9YXTbfPYJbWADII22mDJ+JkHhhCzGOpIrmxa/eZX+WQwmnxNtHq6mdPmo2 gB0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zh+gFAoSmlX31T01IA8oCHWmWa6iFEghfNnufv5HJ4o=; b=QXc/bA7ijUjqYyc/9neyik6Tt4IsFnm4bqJ6LL2KlMT+pLzNPa7In0qw5rGYiCh18a hPlR3H3G1ki+gg7BRhL9rBie4YPUaCQRUDZvENTgSd/33m9TjWfsAMUTWLTrGX1i0IfX 7bOE+G1BntPI84jkFf8TNW6RibrwO7sA9y5UGqL/i0ifw22aotQOn6HfT+c6vw05vzze GoEmQL+6lrwaCRuDIh2BdXzNA7s6QbFWPKcTPYXN9xUCQ0Q94BPB07fNyze0LxIZBMgJ Picbsd1AgpKqb32TlOVz0FoVEz3ep901xAnBQDz6opmc4lW+mEf59iu7uXIEmSxtrGVp vODg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eM7Dvt7I; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g17-20020a056402321100b004434be26155si7226702eda.463.2022.08.15.16.08.41; Mon, 15 Aug 2022 16:09:07 -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=@linuxfoundation.org header.s=korg header.b=eM7Dvt7I; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231201AbiHOWOj (ORCPT + 99 others); Mon, 15 Aug 2022 18:14:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350380AbiHOWMG (ORCPT ); Mon, 15 Aug 2022 18:12:06 -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 C44F011D51B; Mon, 15 Aug 2022 12:39:13 -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 E1932B80EB2; Mon, 15 Aug 2022 19:39:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36FB4C433D6; Mon, 15 Aug 2022 19:39:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660592350; bh=nrWhq4iCZ7BN31NlTgoGvArbe2SU4K8P3fMYiYDV4vI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eM7Dvt7IE5b7/GtR8tGk2h8E7ymKzPPtEAJTWjVm/G8Cory06sn81c4MnTEdXDDAh If4CAHK3v/m7wZlCFtkARXphe++7A6nArU46cO/n409awEPwjVZSIZl9oTVtgv4O3t VG0zhbY6NDmdy4pXHmd665mxhDCJ0sZ/8rGS1eOA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bjorn Andersson , Stephen Boyd , Sasha Levin Subject: [PATCH 5.18 0774/1095] clk: qcom: gdsc: Bump parent usage count when GDSC is found enabled Date: Mon, 15 Aug 2022 20:02:53 +0200 Message-Id: <20220815180501.272373978@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Bjorn Andersson [ Upstream commit 41fff779d7948147f2440c4bb134cdf8b45b22d7 ] When a GDSC is found to be enabled at boot the pm_runtime state will be unbalanced as the GDSC is later turned off. Fix this by increasing the usage counter on the power-domain, in line with how we handled the regulator state. Fixes: 1b771839de05 ("clk: qcom: gdsc: enable optional power domain support") Signed-off-by: Bjorn Andersson Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/20220713212818.130277-1-bjorn.andersson@linaro.org Signed-off-by: Sasha Levin --- drivers/clk/qcom/gdsc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c index 44520efc6c72..2db0938f8dd3 100644 --- a/drivers/clk/qcom/gdsc.c +++ b/drivers/clk/qcom/gdsc.c @@ -420,6 +420,14 @@ static int gdsc_init(struct gdsc *sc) return ret; } + /* ...and the power-domain */ + ret = gdsc_pm_runtime_get(sc); + if (ret) { + if (sc->rsupply) + regulator_disable(sc->rsupply); + return ret; + } + /* * Votable GDSCs can be ON due to Vote from other masters. * If a Votable GDSC is ON, make sure we have a Vote. -- 2.35.1