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: 19585 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2028580wru; Mon, 14 Nov 2022 00:17:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf63fdE/9XItcAU/VMRXl4VJ1Y/v05b2ytk9BGPQ3bzEu5260BEA3GoZPcAWdKaFH38dughL X-Received: by 2002:a17:906:3e96:b0:78d:8bb6:ba7f with SMTP id a22-20020a1709063e9600b0078d8bb6ba7fmr10063766ejj.100.1668413838189; Mon, 14 Nov 2022 00:17:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668413838; cv=none; d=google.com; s=arc-20160816; b=aZEdi4sjbScUjj/YOyx5aHIlK3IisKwF2bNkq9GjGBRQrlnH3cxSK08c3g4C6uiM8d HT61DjqXrC6+QHM8eU7j+XAMCGSw3KbVIb+ibhLQC2Q5xJ9a6l6EVaimjv6hmyVvBPDv gRRL3ZXhZ5Sckp2jKyjZWzUXhpA5xlVo9x5lCpWo96uHUODmkpHxqu36URp2iYnVb1K2 slQeF8IA6dOipSUp/qbJiUQP7Lny5UOXeZvd1nA5bPPlH9dFXv5mFf3j4o/XW2kX1tab VoIlxCgT/c/m7u4nXpOo3CRq//q+B7SDp4KDaI4JdmLsyTANHHsCx1ermTH6MA78VcPg oplg== 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=gxaTpufT0sEezv4FcLCFZpPcsPRzuf9hI1sZZOMlNaw=; b=TauE1FBXnkUO6rBMJ9nwjkTkGEsGji4QyOPCFnffODxR/pEVmybHwbc0gcU3yzpfUy T3kkzGGVEelQU09L4WMOVvU0N+SF+RO9q4e3GKb7eeSb8Ns4xLil8fwD4/lCswVTKX5B zzbJ/9IST8rXklcAfFifo2gXhIF6pxkV9NT21XVP4rBmf3omFlKN6xgvfLObqMTewJGe 5goWFHJUkoCYLexydwLvM4hjeEk4vI1y3Ll28bbWFk465tcYQuIwCj/G15qmp717LwEE 3+rar8eja4hazBeYNKgIZYBOSTNaU6ajm2bKiIo7w1NtCuBQGqXKJZggL+FuEj0K2t3P HOHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P5Kbk1B8; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb36-20020a1709071ca400b007882926c090si10097280ejc.773.2022.11.14.00.16.53; Mon, 14 Nov 2022 00:17:18 -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=@kernel.org header.s=k20201202 header.b=P5Kbk1B8; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236254AbiKNIOc (ORCPT + 99 others); Mon, 14 Nov 2022 03:14:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236238AbiKNIOa (ORCPT ); Mon, 14 Nov 2022 03:14:30 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EC8F192A6; Mon, 14 Nov 2022 00:14:30 -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 B19D160F00; Mon, 14 Nov 2022 08:14:29 +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-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749458708475421919?= X-GMAIL-MSGID: =?utf-8?q?1749458708475421919?= 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;