Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2056135rdb; Tue, 3 Oct 2023 08:58:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHUfAMP1q2yHFUJ3lgmbJ4Qb0+MdTbMAD1s/AZgWyYZtLk+KMSOwEseXfMigl49GTmbzD55 X-Received: by 2002:a05:6a20:4311:b0:138:60e:9c4 with SMTP id h17-20020a056a20431100b00138060e09c4mr14951999pzk.23.1696348734941; Tue, 03 Oct 2023 08:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696348734; cv=none; d=google.com; s=arc-20160816; b=rWWNGK/I0xygsOlTaZaYc7nAvkF6uiO2TRjFqqslDyxobiWlDXm3zcVYzgB3dDdQg7 LLYFBQoYvFJ8uGqlngyfp1E3Ocndd4uzQg0koWuW9fNEHDGcYhux7+Q6EdWrpkoDOs65 4gXYEckedVDkc4E2T4zQRz2VevFB1GiVMR2SySKq/53VzIN78Usd2ShdF6A5o2cUv+ka s4a1OaqZSnKtbrPHjI8YqWiqdWtzixQNeRbgjLNLf6M/seB6gfGgTU0YVoKzuP2V0PSP di5N4SMsoGAI7kBWCKAw+cr5BG5yk8NEjJadSiq86ivI919tdSrk74ecvGB4KPco5QLB FcZQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2WAxk7cbmgYTm9N7R4dlEf3MJ/vDcncUg+CQ4H0cs0I=; fh=A7ESGAPW6WV+DCQVqmR+9L9s97lYo7gbF/gPHfKJi14=; b=QuLFMFEmZCV0al9FmcTcU7iUfg93uh4jES9MLR5n5aGTp57LVzhIy82QF4vNmksOfU iSxs529ry2DEDnL4XX2QuAgaoKn1+ylqYs/Y3Rr0YamdPg6sQKW6NT7x8qg3G4B+1iXE FhveQj7tkH6fJ7s+Ysi9yT3Ntofe3E5l5hHrBcchFRTuSPPZneQljmp660DRldwrr6F1 eanjnHUchE5+9pnrGUf18WbAZ5iqewk3LNOgoxoq96UHmkHzxYkU5XKiqaHn4NKntxig Vn42Ftq0+A4HL/p0RvwdBg63rGuXgQxxKGyb45MI1TA4zqZn05YbfH8Hguy8kh/0oc03 FozQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="I/uNHvQs"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id cd26-20020a056a00421a00b0068fb8fa1e71si1739844pfb.207.2023.10.03.08.58.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 08:58:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="I/uNHvQs"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 4C89D82C5156; Tue, 3 Oct 2023 08:58:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240176AbjJCP6w (ORCPT + 99 others); Tue, 3 Oct 2023 11:58:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239352AbjJCP6g (ORCPT ); Tue, 3 Oct 2023 11:58:36 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49176AD; Tue, 3 Oct 2023 08:58:31 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E279DC433CC; Tue, 3 Oct 2023 15:58:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696348710; bh=0qc7/9y/unJJylgNAX3JbS8b4NM02Ln9LHqplyR4wyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I/uNHvQsrULhHsQWc04qSOzIBUXExGDZ4pciHPiv2KV5h6AgsAi2a8IfizwFLrUaj WAv+yqUyQj0XpaLVX96MhM4imcZ0susNTT7GGTogrCIio/+MhDU2KUaLpejxWpBRCD OxDCnn6A3KQjuAfUAYUu2S2yG5A78yy8MvUvLXxTwNLk+fAjoIwD1sDcXs6+vES5U/ ADFo/sjBsipBAjVUPMYWdbBGKiJG2NxoSzgW8vDilA52fmH2+ujNbwdzwqpOfRbEIx C5xFZe8Jst6b0gXhmJOT7e/abhVkk4FZ2xpXgupMtHxSY/AtpU6nbC8PnQg3Jet29H wb1OP+QBLe+qQ== Received: from johan by xi.lan with local (Exim 4.96) (envelope-from ) id 1qnhnG-00074w-0q; Tue, 03 Oct 2023 17:58:42 +0200 From: Johan Hovold To: Mark Brown Cc: Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Srinivas Kandagatla , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH 5/7] ASoC: codecs: wcd938x: fix runtime PM imbalance on remove Date: Tue, 3 Oct 2023 17:55:56 +0200 Message-ID: <20231003155558.27079-6-johan+linaro@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231003155558.27079-1-johan+linaro@kernel.org> References: <20231003155558.27079-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 03 Oct 2023 08:58:53 -0700 (PDT) Make sure to balance the runtime PM operations, including the disable count, on driver unbind. Fixes: 16572522aece ("ASoC: codecs: wcd938x-sdw: add SoundWire driver") Cc: stable@vger.kernel.org # 5.14 Cc: Srinivas Kandagatla Signed-off-by: Johan Hovold --- sound/soc/codecs/wcd938x.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c index 679c627f7eaa..d27b919c63b4 100644 --- a/sound/soc/codecs/wcd938x.c +++ b/sound/soc/codecs/wcd938x.c @@ -3620,9 +3620,15 @@ static int wcd938x_probe(struct platform_device *pdev) static void wcd938x_remove(struct platform_device *pdev) { - struct wcd938x_priv *wcd938x = dev_get_drvdata(&pdev->dev); + struct device *dev = &pdev->dev; + struct wcd938x_priv *wcd938x = dev_get_drvdata(dev); + + component_master_del(dev, &wcd938x_comp_ops); + + pm_runtime_disable(dev); + pm_runtime_set_suspended(dev); + pm_runtime_dont_use_autosuspend(dev); - component_master_del(&pdev->dev, &wcd938x_comp_ops); regulator_bulk_disable(WCD938X_MAX_SUPPLY, wcd938x->supplies); regulator_bulk_free(WCD938X_MAX_SUPPLY, wcd938x->supplies); } -- 2.41.0