From patchwork Mon Nov 14 08:13:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 13041922 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A2C7BC4321E for ; Mon, 14 Nov 2022 08:14:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3wEiSgoVKvvqTlyoUa+e+mGO3YqOsozaDyYVVrqjFPM=; b=xW19BaeQQgsP85 4JxgUbTk/Gt1i71xbns3XtF7i5E6BPxEN1r6oGJJJrvkVt71kOFwWnnNcxrnnLilPD34silEfGHCr FhcaNXlnDP5MzRLuWUtY8cxUD3B+KF3uR4PSXsBgRkY5+24VxZblxolaISHbeNglX0hHDk2rEa60G 2rM6admNJ1voE6E5FtVTkBX3QkYQRXGBCwHtr2XBpKJ80EH8blmMwVPxKJeOaW4wFOAvMq0hw3pQ/ YZQsjtM3EhR1B7Ca8eCELhfQu+miNkRE+GsgCVfe0z19seoxfE6GJ/Re01/hLGSwv2FYZ0lgpEXQZ a/1iIQngvZn/DgvuI1YQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouUbx-00Ght3-1W; Mon, 14 Nov 2022 08:14:33 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouUbv-00Ghra-9Y for linux-phy@lists.infradead.org; Mon, 14 Nov 2022 08:14:32 +0000 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 2D65C60ED4; Mon, 14 Nov 2022 08:14:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C0BEC433B5; Mon, 14 Nov 2022 08:14:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668413669; bh=sMPgZqnKL8DZFPSpZhcVt+oCxA6lY/wiRJ9lZ5hP80s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P5Kbk1B8IjHv5mNuLCt4FhSSHLIhTYnLzgiPCLmAVqcLIg71E/DNtrRgHapGFQb6D UTiawCT7xwGOtuJ+YrhvJvVKbpl34+4YSjxLMVmuMUwjXsk8xwS8UzV81sA2cu2UdE 91Lg7+OvckU37z6WP2RI2NLb3IViOkln3p3DoNTsODiaaHMtemQ122qnR3QdEv2btY A5SFIp0EKxZ4xGSCH1hKoyXzp6e707hgWH5HCrk+VSBL5l9qQL7J4vncGpGPB4Z2H0 LpbZFZNLCaT6qvLdYg8u0F3ZGZ/X/Es5Fyz1uUAGOEsj/C/EwjFN+sAn6YUs2qveg2 zvWAyym4c/UlQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1ouUbN-0001L8-1X; Mon, 14 Nov 2022 09:13:57 +0100 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v2 5/6] phy: qcom-qmp-combo: fix runtime suspend Date: Mon, 14 Nov 2022 09:13:45 +0100 Message-Id: <20221114081346.5116-6-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221114081346.5116-1-johan+linaro@kernel.org> References: <20221114081346.5116-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221114_001431_406247_A596FCC1 X-CRM114-Status: GOOD ( 13.68 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Drop the confused runtime-suspend type check which effectively broke runtime PM if the DP child node happens to be parsed before the USB child node during probe (e.g. due to order of child nodes in the devicetree). Instead use the new driver data USB PHY pointer to access the USB configuration and resources. Fixes: 52e013d0bffa ("phy: qcom-qmp: Add support for DP in USB3+DP combo phy") Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold --- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c index 17707f68d482..fde30205f332 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c @@ -2207,15 +2207,11 @@ static void qmp_combo_disable_autonomous_mode(struct qmp_phy *qphy) static int __maybe_unused qmp_combo_runtime_suspend(struct device *dev) { struct qcom_qmp *qmp = dev_get_drvdata(dev); - struct qmp_phy *qphy = qmp->phys[0]; + struct qmp_phy *qphy = qmp->usb_phy; const struct qmp_phy_cfg *cfg = qphy->cfg; dev_vdbg(dev, "Suspending QMP phy, mode:%d\n", qphy->mode); - /* Supported only for USB3 PHY and luckily USB3 is the first phy */ - if (cfg->type != PHY_TYPE_USB3) - return 0; - if (!qmp->init_count) { dev_vdbg(dev, "PHY not initialized, bailing out\n"); return 0; @@ -2232,16 +2228,12 @@ static int __maybe_unused qmp_combo_runtime_suspend(struct device *dev) static int __maybe_unused qmp_combo_runtime_resume(struct device *dev) { struct qcom_qmp *qmp = dev_get_drvdata(dev); - struct qmp_phy *qphy = qmp->phys[0]; + struct qmp_phy *qphy = qmp->usb_phy; const struct qmp_phy_cfg *cfg = qphy->cfg; int ret = 0; dev_vdbg(dev, "Resuming QMP phy, mode:%d\n", qphy->mode); - /* Supported only for USB3 PHY and luckily USB3 is the first phy */ - if (cfg->type != PHY_TYPE_USB3) - return 0; - if (!qmp->init_count) { dev_vdbg(dev, "PHY not initialized, bailing out\n"); return 0;