Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1912528iob; Thu, 5 May 2022 10:40:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwj440DV8jT6v5uz1wiMRNH1uaLfyr+7M6zxkeLv0a6+xyHQ/yjNlXhyigJEGI4tm5GarJi X-Received: by 2002:a17:902:d717:b0:15e:b6ed:4824 with SMTP id w23-20020a170902d71700b0015eb6ed4824mr14904824ply.110.1651772457855; Thu, 05 May 2022 10:40:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651772457; cv=none; d=google.com; s=arc-20160816; b=jlkmUuUZnJddoMoWGEXW8t/sd77Z5OvDK9LS3+oE3zCnJWcBTC4/niFdN5mAk1YeW0 sUceTXyeLuFJTdAq2Iv1M+W65Z5eQaHiv+8m9Xu2v09DhKxO0R7F+f9V/uquoDyN8uNy 3gtLR6cqOPPb+mMwmdvgwy8cM2JUdBWEukos2hOD6jAQF4V7mLj+mJl3Bf8ul2jmQb+k XT25ReuqnGq0Vmf1LAB/nuDBwBBK9p2HymorduWQOPeptb/Q9kTB50xbWY449wP21g8h vZI5hKHWYAtbNeeyYzEkiZjD128a9T0wyTfae23FUYBORJu6Dt+mPRc0ylBy8J7suJ0V /PzA== 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=3lSczf3v0n1hyKkaXX1M/VRrRzFEsjPFyBtg5hJZ3HA=; b=quPDI7pUcnUXlRHNqGYQ4f5nhITSTmJb6IgY2JAbkEUG4ZwHHhYvbl8gp3E94ee12e bhTNbIxBqqjmebjeRpWQdaNK2tMxfWGNwY87O9SBoNDjlgO44EcRyHVz147jIRG4ZylM KHi9rK3szhiDRwqHoMX8od459760Xkj+1bhN5apHbd/nJnIpwk872XhGZ29lTS9iMGyq BUjNWV21vZ73csmYjOz747IKsCadLYSc/xizD0HxyLersxb9b4lm2voZ0fnfprZ/ZVfn Ko04ZCXZzuNkdvOTbnqi99qd53qbA4m9x0VyiFOIX7hq/PeBPzbRHsHtgp4AQLo6p584 +RhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mxq5Wcqr; 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 i26-20020a63541a000000b003c1eb460704si2092688pgb.445.2022.05.05.10.40.43; Thu, 05 May 2022 10:40:57 -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=mxq5Wcqr; 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 S1343491AbiEDRGD (ORCPT + 99 others); Wed, 4 May 2022 13:06:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354937AbiEDQ7e (ORCPT ); Wed, 4 May 2022 12:59: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 2A64148E54; Wed, 4 May 2022 09:51:10 -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 BA4CEB82552; Wed, 4 May 2022 16:51:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F124C385A4; Wed, 4 May 2022 16:51:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683067; bh=fiEjsMwi+sx83CopIVwfDXjNiCaih6WW+Reo85LpXa0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mxq5WcqrEbpruMNikozdUMjzhD8YpmCtI4CNX9xMMgsF7600GeRtbW3bjNGJLGbTg BtkdumDoTOFXgqPvaLJhgF1nyxcPquvp/Bzf0pYvjYKqUmecZ/hZ+0lDC2Hf+3YPAv 7ciuwI8XsvjmDBVQxh0JwcQpPrY4V8We7hQi7TmY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Vinod Koul , Sasha Levin Subject: [PATCH 5.10 052/129] phy: mapphone-mdm6600: Fix PM error handling in phy_mdm6600_probe Date: Wed, 4 May 2022 18:44:04 +0200 Message-Id: <20220504153025.174384585@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504153021.299025455@linuxfoundation.org> References: <20220504153021.299025455@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 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: Miaoqian Lin [ Upstream commit d644e0d79829b1b9a14beedbdb0dc1256fc3677d ] The pm_runtime_enable will increase power disable depth. If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable(). And use pm_runtime_dont_use_autosuspend() to undo pm_runtime_use_autosuspend() In the PM Runtime docs: Drivers in ->remove() callback should undo the runtime PM changes done in ->probe(). Usually this means calling pm_runtime_disable(), pm_runtime_dont_use_autosuspend() etc. We should do this in error handling. Fixes: f7f50b2a7b05 ("phy: mapphone-mdm6600: Add runtime PM support for n_gsm on USB suspend") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220301024615.31899-1-linmq006@gmail.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/phy/motorola/phy-mapphone-mdm6600.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/phy/motorola/phy-mapphone-mdm6600.c b/drivers/phy/motorola/phy-mapphone-mdm6600.c index 5172971f4c36..3cd4d51c247c 100644 --- a/drivers/phy/motorola/phy-mapphone-mdm6600.c +++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c @@ -629,7 +629,8 @@ static int phy_mdm6600_probe(struct platform_device *pdev) cleanup: if (error < 0) phy_mdm6600_device_power_off(ddata); - + pm_runtime_disable(ddata->dev); + pm_runtime_dont_use_autosuspend(ddata->dev); return error; } -- 2.35.1