From patchwork Fri Nov 11 08:42:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 13039874 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 25A63C4167D for ; Fri, 11 Nov 2022 08:44:59 +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=M3UEEL4+erAnGvzZbRY2RO6M/bV+QX0riwNmy2p8ZEQ=; b=PWcL76Psv+fhE5 YiOQMtzLmAWrenfzoqKBPT3ZH0GCdfSDES0gy+7Ri23twrQoHHB93jlq/DFjX0ErN6qWdylDxZXKO gNqUA2yLiXRYJPeUtZuZ4kkih3X482foMR4nCXMklHvfH56OhsWvO7qH6MVKCnxYpWoYw6ZBI5d0q 581Zmf2iw7H7IKocvxj9NOl5fNp/RS4zvxr+d9eUkl5zXcl6VGWrRnyOL9VXnrcs+HPMvJVuaZgwC ol8ir7o8O/x2WyVz3OOJwafm4rnxQ90U1ema8JeySx5z2RUxwSPqGUgfs1zD3yvxrejOqDmrne7bD 09yr6xikA+0dr0lqi9pw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1otPek-00EIVf-FO; Fri, 11 Nov 2022 08:44:58 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1otPeh-00EISp-Cz for linux-phy@lists.infradead.org; Fri, 11 Nov 2022 08:44:56 +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 6BA7761EDC; Fri, 11 Nov 2022 08:44:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE389C433D6; Fri, 11 Nov 2022 08:44:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668156293; bh=n6gU/Kh4pLDrdvJwnrFedkFVS9iAnD1+wNhxscwN2M4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sc16wmgRz0fnc1vnv7vYp7ZAnYJnLymMZlmKpeukxR6m2NQUV9AzgSPA8ZwjLANLA miKXJ1rLB7NWLRM5G93LjMiWOQHIYCioqLs9+TutSTH/DJhCE6uUcwhUWAhkf9d/wY P3qceWqhcIT4+c9aZ30dRjDt314nQXW6zmKsZFHeUtlD2V8JbjYi5WlcX91l+AzXV/ iEl25p4WMthcHEJWzrB11LaGAn6c+JbDxVL64mlyIqQmj6A/vyV5AvmnXbG/4z3ETQ FE5+6RoTPSx0IOTHVzp8bRVeEFKJiLONEL0qqhJosqWyWrme9thwoE1fUaK4I+WEff 2Ovw58G6jlabg== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1otPeD-0002Mo-U1; Fri, 11 Nov 2022 09:44:25 +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 5/6] phy: qcom-qmp-combo: fix runtime suspend Date: Fri, 11 Nov 2022 09:42:54 +0100 Message-Id: <20221111084255.8963-6-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221111084255.8963-1-johan+linaro@kernel.org> References: <20221111084255.8963-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-20221111_004455_515374_816D1BB8 X-CRM114-Status: GOOD ( 13.51 ) 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: ac0d239936bd ("phy: qcom-qmp: Add support for runtime PM") Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov --- 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;