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 77E63C05027 for ; Mon, 23 Jan 2023 10:48:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231815AbjAWKsN (ORCPT ); Mon, 23 Jan 2023 05:48:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231687AbjAWKsK (ORCPT ); Mon, 23 Jan 2023 05:48:10 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42D375FF9; Mon, 23 Jan 2023 02:48:06 -0800 (PST) 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 C4B1C60E0B; Mon, 23 Jan 2023 10:48:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 258D5C433D2; Mon, 23 Jan 2023 10:48:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674470885; bh=EbLSIJ6i7GwOGSxdBHyoeaEaC1aW5LUNC5uFiJBWGnU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cIgFONB7UJzp6T7unbq7UlEXNzP75qAszNGO4XIUgVjcV6cuLqfnfLJCZU8JLYghR BMGZtEW3XGI1T3ACINn33srDA8IIkp0MS0d6Oy0DUJNXHLgvDjYL3OCBeK/qJXcrh8 7wvvHels/bUJ2ddBWVIGRpSBEBXcRLOkdFA0bEfrI8Vcsu0ZEcZMOKyE2sKvuFDteX Vl/FYVrF0XJ4udBC/2/vmY9mZNyCJepoRDyGBQa0vb09AHetZS+pZe4UOS9MILNENq cb/HnqnPz4/iLIv8V6rPwEYyfTgb4ktV6fHmXEtwxGKIBG8QHzXqrKQjH+GIEHM/7Y cQ4b9fTghZe7Q== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1pJuMr-0000wR-Pj; Mon, 23 Jan 2023 11:48:02 +0100 Date: Mon, 23 Jan 2023 11:48:01 +0100 From: Johan Hovold To: Stephen Boyd Cc: stable@vger.kernel.org, Johan Hovold , linux-kernel@vger.kernel.org, patches@lists.linux.dev, Dmitry Baryshkov , Vinod Koul Subject: Re: [PATCH 5.15.y v2 5/5] phy: qcom-qmp-combo: fix runtime suspend Message-ID: References: <20230113204548.578798-1-swboyd@chromium.org> <20230113204548.578798-6-swboyd@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230113204548.578798-6-swboyd@chromium.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 13, 2023 at 12:45:48PM -0800, Stephen Boyd wrote: > 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 phy") > Reviewed-by: Dmitry Baryshkov > Signed-off-by: Johan Hovold > Link: https://lore.kernel.org/r/20221114081346.5116-6-johan+linaro@kernel.org > 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(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