Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2183810iob; Thu, 5 May 2022 18:17:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZ6XwpHBI57gwyx0YxJGXYdjuTE8ZSd5QdWl6djtwnQrF6YXM4SCzAjQvd/lWeOS9gU18f X-Received: by 2002:a05:6402:2790:b0:427:d09b:df82 with SMTP id b16-20020a056402279000b00427d09bdf82mr1000239ede.151.1651799854725; Thu, 05 May 2022 18:17:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651799854; cv=none; d=google.com; s=arc-20160816; b=Zrk97JZnZ4rBy2C4GqtXBJr0vaAN/PwNGTccxUsdr7vpNn/m8rwgNNmrgABBbm3Q1l uzA5bf3BoLssDOSCvjlH+akeLhjXY/n0Ly2aMvL2cW3pJ6qGLzJfnuSoEkcmmoIZj7cg PRjD8YN7TyqIJLpwPf1wkHeQi/allVXaVcTGs9omsuUteN5j2krO/feqvn46+DKkrhpn 6obcu2jSaRV2oJQwTo9QhmPOiDHjHlITUHQOtvZaeWFdJTVhHtMUugx8bBIryjoyuJac ndJfPVoepMfZCTBrSQF291PnJgLia9YY1VVVa1/aWn/mts+jYsQ7af4dSSHr5U5NV9/b lWHw== 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=RrphFA+uBvDgxBSW7yRabvbrW1MjX8fU7dfPQ6+AdeY=; b=mrJUURK6DsiDsgTPOdfGRExEBbKdv3n1/MsB1GFYpPmyf+Kyrh6EA1ZR3PXrAPZDzZ NVY1v8wrUhK5Y8rMa34G5Zy6oj0ESmf1XpgmFCuLxa7lQVla1DCswhDTZ/5cJfWVYubA EIZWOm6J5Q2ZZsMXTQI+iE5p9wOdsyN9JPGRnDbKjcRstZ5BkkO9cnrXrVVUB99aLGsR yXMgNUAg4O6K5AZ5+Q6U+OLn0ddAfm1gvkrIIPIGyBWHqeCjum7odrU7CVU0uV5MVfc6 V2Tf4L17VTpus2/D75PpCEOds6trFCWru2V1i5EnBODfLWLyOQOkq3sextGuodXtrKOx ltGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JsAKJtso; 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 12-20020a50874c000000b00423d766ff2asi3187021edv.216.2022.05.05.18.17.03; Thu, 05 May 2022 18:17: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=@linuxfoundation.org header.s=korg header.b=JsAKJtso; 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 S1353488AbiEDQy1 (ORCPT + 99 others); Wed, 4 May 2022 12:54:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353853AbiEDQwf (ORCPT ); Wed, 4 May 2022 12:52:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96FB047550; Wed, 4 May 2022 09:48:43 -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 dfw.source.kernel.org (Postfix) with ESMTPS id A51ED61777; Wed, 4 May 2022 16:48:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF766C385A5; Wed, 4 May 2022 16:48:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651682922; bh=BVm3wbMWu41GHADlE1qYcgzajVQUgdW6Zs3t/71kNkw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JsAKJtsoedjE39uwDsE6ZNu8R0z7AnLPwh77cbJgJmuZ1hlNvS+AdQ+ys6aFbWQJg bY7m5ghqMq4Q048yrGzgneAP8vzQ/jc7E4us6anDUEjX+mwVlwrECzHXxfe4Etdqln pO6G450MeFF8h07TbAR4jUSDKtCfukPODlCYCsoo= 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.4 40/84] phy: mapphone-mdm6600: Fix PM error handling in phy_mdm6600_probe Date: Wed, 4 May 2022 18:44:21 +0200 Message-Id: <20220504152930.658970309@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504152927.744120418@linuxfoundation.org> References: <20220504152927.744120418@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 94a34cf75eb3..39d13f7e4cf3 100644 --- a/drivers/phy/motorola/phy-mapphone-mdm6600.c +++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c @@ -628,7 +628,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