Message ID | 20230113204548.578798-6-swboyd@chromium.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp474470wrt; Fri, 13 Jan 2023 12:48:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXulolIrlae5yIwYpUmTO/2cNYQ85jzcC1JhUMhXaRGpzvsCZf5NfU7E50qgLwtSK4IZmX5o X-Received: by 2002:a17:902:784a:b0:193:3354:1c22 with SMTP id e10-20020a170902784a00b0019333541c22mr11479086pln.39.1673642913198; Fri, 13 Jan 2023 12:48:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673642913; cv=none; d=google.com; s=arc-20160816; b=XXI8gFCMe1DAB8IuVwyxescaH8dXiA1/aMUamIkzdrh0PRPLA9TU1uc8Y0W1MI/2k/ pLyS+p4ol469KAcOLg7WVIwwZNkFHqvkbbTk4dwDSjAsaH9eN2olsUsZQAR12oJyJSz/ ji6g2A47ifaCRdGK+aKz3UGEqCd/NnMKrVRx8zYy7H6f7Da7p25yk3FkLQi40XouhfPx x8voCwPhQ0G0qNgGDrIL8SFx382DYtgJWt0obnOmDgdnX9Jd/b85RR0zrGE9xuLH0gCQ AaGEEV68qHX+1Fc4Yn7W5EqtsX0lQQk1muYiNBZyd3JzKuvxq+UUmX3sk79zXg6WS81X eYiA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HBi2/qyUC845LFRzXkZZ02iiz+01kFcIC3Wu67immxs=; b=NCmFlP3x1pbc2pmDkImKW9RzkkHlyJiclq7k8LdcEEDVhTz+NrK40cBo8lqi8yiCDE F3x1SziarQR4IWJjwlUEQEg4uf2XoaFxdoQwPEarxHnVsat38DFO6UnBYbApAXKEC15D NREdGUPD2UAM6K4BYNUBLK2MDCiMIrA3Ca3V8TgwmM8aiiDIjEcecQtnZek/SsfuA6Sc mM/oDjoxs7atRLyowLdOe09QDpMVSaJoHSxdPFHCrAquK60htnGqmJlXmofOK+VgOq0F Q6BYCWa6storLtAuc/CN6S7Imlcp+suCm16hSCcl+sPy8NuOf+qpLQP5QkeZaP3NlLjZ ldIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kRx8bFUP; 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=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b18-20020a170902d31200b001926fcc7389si19842428plc.424.2023.01.13.12.48.20; Fri, 13 Jan 2023 12:48:33 -0800 (PST) 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=@chromium.org header.s=google header.b=kRx8bFUP; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231318AbjAMUqW (ORCPT <rfc822;andrewvogler123@gmail.com> + 99 others); 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; Fri, 13 Jan 2023 12:46:00 -0800 (PST) Received: by mail-pj1-x1029.google.com with SMTP id q23-20020a17090a065700b002290913a521so5884394pje.5 for <linux-kernel@vger.kernel.org>; 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-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 <swboyd@chromium.org> To: stable@vger.kernel.org Cc: Johan Hovold <johan+linaro@kernel.org>, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, Vinod Koul <vkoul@kernel.org> 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: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754941791057405673?= X-GMAIL-MSGID: =?utf-8?q?1754941791057405673?= |
Series |
phy: qcom-qmp-combo: Backport some stable fixes
|
|
Commit Message
Stephen Boyd
Jan. 13, 2023, 8:45 p.m. UTC
From: Johan Hovold <johan+linaro@kernel.org> 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 phy") Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20221114081346.5116-6-johan+linaro@kernel.org Signed-off-by: Vinod Koul <vkoul@kernel.org> [swboyd@chromium.org: Backport to pre-split driver] Signed-off-by: Stephen Boyd <swboyd@chromium.org> --- drivers/phy/qualcomm/phy-qcom-qmp.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
Comments
On Fri, Jan 13, 2023 at 12:45:48PM -0800, Stephen Boyd wrote: > From: Johan Hovold <johan+linaro@kernel.org> > > 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 phy") > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> > Signed-off-by: Johan Hovold <johan+linaro@kernel.org> > Link: https://lore.kernel.org/r/20221114081346.5116-6-johan+linaro@kernel.org > Signed-off-by: Vinod Koul <vkoul@kernel.org> > [swboyd@chromium.org: Backport to pre-split driver] > Signed-off-by: Stephen Boyd <swboyd@chromium.org> > --- > 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(struct qmp_phy *qphy) > static int __maybe_unused qcom_qmp_phy_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; This is still not correct as this code would now be executed also for PCIe and UFS PHYs, which wasn't the case before. > - > if (!qmp->init_count) { > dev_vdbg(dev, "PHY not initialized, bailing out\n"); > return 0; Johan
Quoting Johan Hovold (2023-01-23 02:48:01) > On Fri, Jan 13, 2023 at 12:45:48PM -0800, Stephen Boyd wrote: > > 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(struct qmp_phy *qphy) > > static int __maybe_unused qcom_qmp_phy_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; > > This is still not correct as this code would now be executed also for > PCIe and UFS PHYs, which wasn't the case before. Ah right. So weirdly, the conditional should be kept.
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(struct qmp_phy *qphy) static int __maybe_unused qcom_qmp_phy_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; @@ -5010,16 +5006,12 @@ static int __maybe_unused qcom_qmp_phy_runtime_suspend(struct device *dev) static int __maybe_unused qcom_qmp_phy_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;