From nobody Mon Sep 15 07:39:22 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA144C3DA78 for ; Fri, 13 Jan 2023 20:46:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231282AbjAMUqW (ORCPT ); Fri, 13 Jan 2023 15:46:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231241AbjAMUqB (ORCPT ); Fri, 13 Jan 2023 15:46:01 -0500 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54CB86F97C for ; Fri, 13 Jan 2023 12:46:00 -0800 (PST) Received: by mail-pj1-x1029.google.com with SMTP id q23-20020a17090a065700b002290913a521so5884394pje.5 for ; Fri, 13 Jan 2023 12:46:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HBi2/qyUC845LFRzXkZZ02iiz+01kFcIC3Wu67immxs=; b=kRx8bFUPs6e81RW6/OJxTlgFo1g1CRAgsbMtDsiYYz1TT8RfZ5L10WQk0D1yMzb6oz 1SPZhnB2GsQ9u9XBeFaUxrlxcIU6mAsuURwLUKKIkirlrAt5lGd7cOQJUibEOaodzeu2 douiBjk0yrxsKBHiaoNilKGx0iiaJybztmtqE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HBi2/qyUC845LFRzXkZZ02iiz+01kFcIC3Wu67immxs=; b=e0jR5sOokWgZF2j+W3RqPOQIp/uonxTRQVp1mSioBMQ8SGA7Q8QZ/2pRPLUq5LRCJC aLtI2Ki2Dj1rDcMbEdDmFkHxJO/Ne56MMLgtbQ/oyWJY9HXu9urxjM/LSr8bdsntJB7B 2oX+GQKnlEklZjZVra6tpzC5/X8AfJLRfPtAV7VBkDnOEIy/rrQeTvv3l6BEapfL7klM 7wQNnUhqdrrnny9wnli+7s61P40/9FNUuAmdjWKSWJT7+IHdw6l3O1skLvJE55NrGzYQ 01SCG/5dLRpeGIFMzf7BbbXAOQ7tjh98+tKNGes+Bepo6RIsFbRxo0oHK69cNqdrfi8a LFGg== X-Gm-Message-State: AFqh2kq52hjWF4iht5KeKyxWVy/LMBCBfKbvu9Jm+bgEyVmpXwiE+zLl qAgRAjUsmStMmQVdkjiP60fkow== X-Google-Smtp-Source: AMrXdXsf6LhytMMpI9hgTdoKV3tVJYPmL/AlUKNgDNZqknFWYgZVH1aN/OnaJq2PKABVv+k5Fo8pIQ== X-Received: by 2002:a17:902:c454:b0:192:b52f:33bb with SMTP id m20-20020a170902c45400b00192b52f33bbmr9843370plm.45.1673642759860; Fri, 13 Jan 2023 12:45:59 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:11a:201:4652:3752:b9b7:29f9]) by smtp.gmail.com with ESMTPSA id f21-20020a170902e99500b001945b984341sm4010081plb.100.2023.01.13.12.45.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 12:45:59 -0800 (PST) From: Stephen Boyd To: stable@vger.kernel.org Cc: Johan Hovold , linux-kernel@vger.kernel.org, patches@lists.linux.dev, Dmitry Baryshkov , Vinod Koul Subject: [PATCH 5.15.y v2 5/5] phy: qcom-qmp-combo: fix runtime suspend Date: Fri, 13 Jan 2023 12:45:48 -0800 Message-Id: <20230113204548.578798-6-swboyd@chromium.org> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog In-Reply-To: <20230113204548.578798-1-swboyd@chromium.org> References: <20230113204548.578798-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Johan Hovold commit c7b98de745cffdceefc077ad5cf9cda032ef8959 upstream. 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 ph= y") Reviewed-by: Dmitry Baryshkov Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20221114081346.5116-6-johan+linaro@kernel.o= rg Signed-off-by: Vinod Koul [swboyd@chromium.org: Backport to pre-split driver] Signed-off-by: Stephen Boyd --- drivers/phy/qualcomm/phy-qcom-qmp.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy= -qcom-qmp.c index b8646eaf1767..64a42e28e99f 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c @@ -4985,15 +4985,11 @@ static void qcom_qmp_phy_disable_autonomous_mode(st= ruct qmp_phy *qphy) static int __maybe_unused qcom_qmp_phy_runtime_suspend(struct device *dev) { struct qcom_qmp *qmp =3D dev_get_drvdata(dev); - struct qmp_phy *qphy =3D qmp->phys[0]; + struct qmp_phy *qphy =3D qmp->usb_phy; const struct qmp_phy_cfg *cfg =3D qphy->cfg; =20 dev_vdbg(dev, "Suspending QMP phy, mode:%d\n", qphy->mode); =20 - /* Supported only for USB3 PHY and luckily USB3 is the first phy */ - if (cfg->type !=3D PHY_TYPE_USB3) - return 0; - if (!qmp->init_count) { dev_vdbg(dev, "PHY not initialized, bailing out\n"); return 0; @@ -5010,16 +5006,12 @@ static int __maybe_unused qcom_qmp_phy_runtime_susp= end(struct device *dev) static int __maybe_unused qcom_qmp_phy_runtime_resume(struct device *dev) { struct qcom_qmp *qmp =3D dev_get_drvdata(dev); - struct qmp_phy *qphy =3D qmp->phys[0]; + struct qmp_phy *qphy =3D qmp->usb_phy; const struct qmp_phy_cfg *cfg =3D qphy->cfg; int ret =3D 0; =20 dev_vdbg(dev, "Resuming QMP phy, mode:%d\n", qphy->mode); =20 - /* Supported only for USB3 PHY and luckily USB3 is the first phy */ - if (cfg->type !=3D PHY_TYPE_USB3) - return 0; - if (!qmp->init_count) { dev_vdbg(dev, "PHY not initialized, bailing out\n"); return 0; --=20 https://chromeos.dev