Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3091385rwb; Mon, 15 Aug 2022 17:55:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR52cGqfYoOcjUgbWa+MGp5zJUNJqht1XZuoBg3Vn3UwUYanORes0Y3VT15ShHQkeRUGtLL9 X-Received: by 2002:a17:90a:2948:b0:1f3:1b42:a810 with SMTP id x8-20020a17090a294800b001f31b42a810mr21423374pjf.203.1660611307342; Mon, 15 Aug 2022 17:55:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611307; cv=none; d=google.com; s=arc-20160816; b=sJow1XwoItBXktHGCi2iwmupff1TfckkuGSskkG+HRoEXy76+kPoEql14tGd37x/pQ 7FwYl+nF5CgVa92ZLoyXJPYufFzGT81zekOpAMGnqiFkzwvzpoTvE2Z/nikKGwCH+jM4 h5j2LbugnvkmviF8rF2LYc/g8QL4H5T7KAZMZsbWuWBITdZw6/msmOgCBgiAXtQ/htic /Hj86cpXcSYTUik3vwgDWPMbooSs8yfH3WZ/56LjTUhbYoXUFVig8RGhHL4E63wZ6NfX JlxJZwAYCDXg5tKVyTEvjwd4zxe5gKv1jWhPlVIG9ORD2k2W6w5A1BkCy90Y92Q8xvBw jDJw== 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=brU0Xg99prVPSUwpVTj+fOtc7Y8JfS6ozrnvkOqFj3r/92OfIRWMWWylACXNsB8jb1 BPnt2bFSfQUfpH6lAL589vldLf7gVXI0xX7721lmkVfzpS+SBToaJ+IX/VFiBqx6SfnO XLE0TkOKqOOqHjdlz39O3OAzeJ68r2Qx21veRmrgDBAtKmTWyaoICNDul5tCwZgUHyoJ CTaK6bt1dUMl7U2Oepl4dIbVED38HV09WqvxQzik4jhmc6DSj3W6XWQDKoDU6Gvdgttn cOM3++3LYw3yf/DUM/ZmCDhi3W4xwBdgO2qcExOEwMqW5ZiviUkmwGiDio0ydOngV7ds WDYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0U3H527q; 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 i14-20020a170902cf0e00b001708d35bb67si11764692plg.463.2022.08.15.17.54.56; Mon, 15 Aug 2022 17:55: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=0U3H527q; 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 S1346255AbiHPAcj (ORCPT + 99 others); Mon, 15 Aug 2022 20:32:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346094AbiHPAaf (ORCPT ); Mon, 15 Aug 2022 20:30:35 -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 248A518524C; Mon, 15 Aug 2022 13:35:55 -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 8F530B80EA9; Mon, 15 Aug 2022 20:35:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD18CC433D6; Mon, 15 Aug 2022 20:35:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595753; bh=nrWhq4iCZ7BN31NlTgoGvArbe2SU4K8P3fMYiYDV4vI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0U3H527qS3zHVQ8t4wNhl3cOL6ZIMUK6/Q5Bfd2PU9SfTKpkHYXLuCuJwo85IzyPf dfD8Wj62BJVvNVeT+Ylb89MHTI52+JP8lNUA/sfJ5NIZjn1mhO5R6vrrppU7hwmQMj CSardgsrzzPGRDfpgsDPbLm+LROQo6Yo3YruaFtE= 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.19 0831/1157] clk: qcom: gdsc: Bump parent usage count when GDSC is found enabled Date: Mon, 15 Aug 2022 20:03:07 +0200 Message-Id: <20220815180512.735356534@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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