Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4776556iob; Mon, 9 May 2022 01:03:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKSPWS+D33apXlSB/1zBQKX5S191VUxhEgH4W5QwszvFz66RX+rvilULnD70BixbC2GRzH X-Received: by 2002:a05:6e02:e11:b0:2cc:3377:416 with SMTP id a17-20020a056e020e1100b002cc33770416mr6103199ilk.308.1652083421275; Mon, 09 May 2022 01:03:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652083421; cv=none; d=google.com; s=arc-20160816; b=alVKkMfeaeAY9f9BdpxqYy7bBdAe2T/XzJ5Q5A8zg2snwMzNXhqBfM1EzdDrbjNGJ6 9WMuFOVRlGZf0XNtA4SPTWKELJwxHJTDxahoyL0Qhp8CrE1ZjJQeEaBN7HHngDaNzbpy 8jFfYhBRAcgYlkF3W9yfWtQ+g0WkLItFVSN5VAX1joke2VQSN4abHhHat+ixKWkb2I/a 34ML+FAsQtu1f8PuD6UEzV/i9hXeSGa0TuYqdLHecBf9kiKnnn3q8jpWbb6/+9e6HagY txms/poXe+ryxFbXy8KkARMsccOPw3zpQIGf9xSZWPslYFFOEyqwcRZPmyt+GQV2LrKS aOiw== 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=Aa29ZNHjnMccYUWb4MaEeVcplvNkXodxL36nVpSvxbaBzc5pt98/U2vZerigjNwvzJ Ivrusp0PDFrVKnB86m7D5GSmIm+TUXAgyLTun2vE17hKXbD2HE7wU7bDVUCFFcGJVOy9 mc3q/6sf1YLcOSIe/jATANXvYr5tZIpNdNEazZwu+0u6V4L5DD/DbiGztsooNBhPOQVj jVFczEcv3dLaU9dMSSObL4d+xZGJDSiLpw+ZbZ3mVRn9CU2AcX4Zdfg9hwwSp4BVvQNJ 3eCCSmgZJARY4nQs2oKozmn8Y2EPxV+Dr+TsSDOy7Eto+wMv7K5cdmS1y0JY4zXlUHB4 Vy9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kO18R6A8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i130-20020a6bb888000000b0065a414bc0c1si6634574iof.27.2022.05.09.01.03.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 01:03:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kO18R6A8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BE2391D8B46; Mon, 9 May 2022 00:55:04 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355819AbiEDRWk (ORCPT + 99 others); Wed, 4 May 2022 13:22:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355809AbiEDREn (ORCPT ); Wed, 4 May 2022 13:04:43 -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 4B71B49925; Wed, 4 May 2022 09:53:25 -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 D0D23B827AB; Wed, 4 May 2022 16:53:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E068C385AF; Wed, 4 May 2022 16:53:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683202; bh=fiEjsMwi+sx83CopIVwfDXjNiCaih6WW+Reo85LpXa0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kO18R6A8uUU/ci6pJnyth9QU+F8C7QE1EiNul4e0ix2Tmat11iK6EzmmC8EIKvaat LGSwTf2/95/bB/4xTj7op5Ng7iWQkE9UgaJqFj2dshlRf8OQzeV4iYF8JHNZsyeey7 dVQnI9RnNtDQEy5P/Cc+pE/FFSqbMym1f8mj7Ne4= 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.15 067/177] phy: mapphone-mdm6600: Fix PM error handling in phy_mdm6600_probe Date: Wed, 4 May 2022 18:44:20 +0200 Message-Id: <20220504153059.048746597@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504153053.873100034@linuxfoundation.org> References: <20220504153053.873100034@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=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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