From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 28371342173 for ; Tue, 21 Jul 2026 13:05:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784639159; cv=none; b=ibKWG4svFjYduHpZLgNL764WLGQVnej5MT6A+FAzjXDDKaMU2RFDCFgphKxISp/yoQBERyUGLPXH7XyWguz7oEmVQThclUsR1JZ6qf03MYEpdmxYbqBLRWFTlPvK09o8IQcyfhgFYTnd8TIu+P0i+58bBDDw3OFUrcD78Qaiaas= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784639159; c=relaxed/simple; bh=0fg/0n8jqlk1rTqLof5aMrLhYmwz4Lkt27r4G+FR9W8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=T9HquWhuBynNRmyas1iNabeCc4o3HVYx/1OOUFvlS1AbRKWZlD7vo6tyjG9lg/RxFMA4vWZ7OkLJE+d6YIVVtpgtC4yquMgnIkW+uk6xNtZl6z3KZPewWUCBdeVhxB6HOWy7kXL4n2B92advpNVR6ScB1jmrOklG89OEIxobtxo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=PCmwzvjZ; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=izzdLit2; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="PCmwzvjZ"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="izzdLit2" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66LAR8GP1134525 for ; Tue, 21 Jul 2026 13:05:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 0C9IgCI2fyKGPwADUG81tMOL7Xd+RLAneLurfpmZbVM=; b=PCmwzvjZJsGmSwHV GJjJJjGLkb4McjKi/J5CJfZeEjpDCBucAKtPx5c0yL87LUVSXFz2wggQNV6c6pw5 xYVrWJPengSkHx0T29xVbWbyXDvMNB/kypXUrb1AFQb71ptRfXMuc5ow0DEF53MA bKvK9J1BOqjAuVZa96oNvQPCa9nokb1xretPhtDQxeupRqEGlbks1mcDsUApfU8f BC+CmXtH/1k8Hqj30RBN7QIbKU8AJMqlaVgbVNHbxfGpF210U9aSGKcaMYmpCe08 RiDCSD1lGqnDYFfEU7uOsXHFpKAi1gZ1JjUPe7Y2TeEoaDuaGgTToIQo6ADwwQOM 4lUXiA== Received: from mail-vs1-f69.google.com (mail-vs1-f69.google.com [209.85.217.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fj0as2v22-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 21 Jul 2026 13:05:57 +0000 (GMT) Received: by mail-vs1-f69.google.com with SMTP id ada2fe7eead31-744c204396cso8602845137.2 for ; Tue, 21 Jul 2026 06:05:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784639152; x=1785243952; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=0C9IgCI2fyKGPwADUG81tMOL7Xd+RLAneLurfpmZbVM=; b=izzdLit2G//Zqy2bg1kqyfKX04meCEbqWm6APqTGhWLj3PeKUfiD/pPm7/QYEzSTos Y6PjR9XQ17adadwbdawoxWtRS448O1Z/qwbNZS+iIBZqOl3mno4JdthMTakMuAJ5TmkJ EGdoeH93vHSEb5SuMLvYEhQBO/urzK1AputhfNtR2moEDDtQmKLflWB39lpNArosXhIg V5bvctn9VqeOEuSjz7fnV4JU1+p0VSIaVpF19jozN7gMD4i3GLTygYegV9lbZGujkyLj 3YiSD1jaaMO0digocB/sluNMIlcYFhJc8oopv6FotGGEikb6WN8xmwitN8nEtiYbxd4Y 7GPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784639152; x=1785243952; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=0C9IgCI2fyKGPwADUG81tMOL7Xd+RLAneLurfpmZbVM=; b=Lero87DASHlgODzzsUWcF0PXEA++5d2a5xGT2OgFvxGFeJWfxdFbGk/Xgjw2IltzGn X4rniqkTb/tO9vOcnvqGhTykFnB0yEC7MYScrK8Nj1593WbdLeIUKhFPtAWHqldmMfLt vztCMVmwOxNy+BfnLej+0+p5n4fYJUm1lImwMsDKkPqx/YLACrHae0V5+Z+ZnI8sXi5B LU5pFB5kl9P4jyE+frjuknch0FWf4Zna3gLAZMAr1ZSS7L7CBYfa4XrHWpIC+c12ga2V 45cpy0MJXscV7I9WtbGFferTAJrDBuPcLEFSZwLMPuzRolLCbISlmKhjzwhI6zfTXL5c LPrA== X-Forwarded-Encrypted: i=1; AHgh+Rr1uCoSPQ+rOLEudt4wkhQYTcNBVuCvjoBRZ2aoH3Vv4GCwbxWzVf/xfacqQWuHnorh1ghzV5L9lo68R/0=@vger.kernel.org X-Gm-Message-State: AOJu0Yy3UbJR0nKSP8CtGdMW6zX/qV5lVncblE9vzDtKibY0/d/wQNM+ wderiiihXAW8mDbG1wJZDh4R9FF5+kufIBwesGS2fUj8DLWYzcuIr+8pHevM59y0Gd8xzEHy2M8 ugz25fGla07//0IoER/86Gl2NUOXSFsCNTVu/iJdb0m743Q7QhjkAs653tTvbRg6IUSw= X-Gm-Gg: AR+sD10DeL1RsmUrUKhAl0u/HZtLnFMyIkMkjMeh7NbHVx61SIsJnATm7KXvQ8EBBww zit/hEL/Nch6jToopfccHFZESEf4KQYuKIqUcR6JbPsb8+NX5zxI3tom0//orNPoxz10tlontee cW0tPPCsdiAZdRtDllOqaYEt/zENF3sEThdv0acrTZeVQ5dYg8+uzM5JFRhA0PcmRs7beoMiqhP naPY/PbGzbH/9hhkuExVehOYbT3/H/XJnRDb8WkTcBpE8o55EQvlsZmU9dHOIjLiAQwrVDL7+hk 4Ipnv1484+TW4k05waUhJcnMegZFwCMxroAIj6VHcrBes1xRXWSwSATEa1QkxRpEd9lCWxaQKnQ eZaWrD7Gwt0QQ0yrbEUF2uLyRVsFif4rtfYs2S3hmq7jV5m2UziGEa1IQsdmwvgTHXu5UcZeFlY U/fOd/0112TLDpPOVSmLzdCcZdxjb7wnAKOdqK1ieGj/C/KaQYpVQ= X-Received: by 2002:a05:6102:3f13:b0:745:6b08:c338 with SMTP id ada2fe7eead31-747534ca994mr7023313137.10.1784639151585; Tue, 21 Jul 2026 06:05:51 -0700 (PDT) X-Received: by 2002:a05:6102:3f13:b0:745:6b08:c338 with SMTP id ada2fe7eead31-747534ca994mr7023246137.10.1784639150566; Tue, 21 Jul 2026 06:05:50 -0700 (PDT) Received: from QCOM-eG0v1AUPpu.na.qualcomm.com ([2a01:e0a:830:450:751c:d61c:c91:60dd]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c17009ae04bsm591898066b.8.2026.07.21.06.05.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 06:05:49 -0700 (PDT) From: Loic Poulain Date: Tue, 21 Jul 2026 15:05:45 +0200 Subject: [PATCH v5 1/5] phy: qcom: qmp-combo: Prevent unnecessary PM runtime suspend at boot Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260721-qcom-usb-phy-fix-null-v5-1-a181e2adbd2d@oss.qualcomm.com> References: <20260721-qcom-usb-phy-fix-null-v5-0-a181e2adbd2d@oss.qualcomm.com> In-Reply-To: <20260721-qcom-usb-phy-fix-null-v5-0-a181e2adbd2d@oss.qualcomm.com> To: Vinod Koul , Neil Armstrong , Dmitry Baryshkov , Wesley Cheng Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Dmitry Baryshkov , Abel Vesa , Konrad Dybcio , Loic Poulain X-Mailer: b4 0.14.2 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIxMDEzOCBTYWx0ZWRfX0U89SifXi2Yd rRA3zxVxkyMonmPOsKrYtOofj4dXacFgalEzd8JGHfjVURvLdqaAnGL74TZyTCthtLplQBNoegJ N1YK89hcgftgRtnhWzoONPuB3AQ2B6weN/Hzg8ls5+NU2L2Vx5I7elqQniclAN2OXvdKnJJd+aQ BQCcXGZOBwBEo3vR457qgGhfHTniLjt65RjUqq2EQmbbRiuwoghwEAr16vlhR6nIsmMFQB5ImQi nkhaNDcVXtbIU9u+9XtekeOFECbS2ZZHQVkuMXA9XwICosU1behcuMgjvnNZ4v4PLmKgi0Y4MPv ix4mNA8OV+lYaIicvqP4lrYPjNZmYrp6l5ULHaz0Hs7SGgNpCwZfjmQuEfDn+eth6dRal10UFiL GZ8nvdh7vGy4taslW8GECtHOcOWKXIfZGDOGwHZNXrD3/DC6zMJ4K+9dQnuF464fgYLLD7U3/ds TqyjOcdyytLKi6rrj/w== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIxMDEzOCBTYWx0ZWRfX1Q0TCuV6W1b4 R0cUShCVaQ6Dfq8YYy0/FCv/oMH/zMO+32MW/Zr6IFDL3/h5+AXJA8+FzdQPNRmjDi0awB1aWAM 56S7WzmzJ3vHj8Zhxs3Way79eu7rtpY= X-Authority-Analysis: v=2.4 cv=DoFmPm/+ c=1 sm=1 tr=0 ts=6a5f6eb5 cx=c_pps a=5HAIKLe1ejAbszaTRHs9Ug==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=PcYcMbZi39MCwOMHHM8A:9 a=QEXdDO2ut3YA:10 a=gYDTvv6II1OnSo0itH1n:22 X-Proofpoint-GUID: qiny07-Ef6gQwKoxbC_gs6KaoTFwv3gh X-Proofpoint-ORIG-GUID: qiny07-Ef6gQwKoxbC_gs6KaoTFwv3gh X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-21_01,2026-07-20_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 phishscore=0 suspectscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607210138 Runtime PM has to be enabled before creating the PHYs, since phy_create() only enables runtime PM on the PHY devices if it is already enabled on this parent device. This opens a small window where the device can be runtime suspended after pm_runtime_enable() and before the later pm_runtime_forbid(), causing an unnecessary suspend/resume cycle while the PHYs are not yet registered. Take a runtime PM usage reference with pm_runtime_get_noresume() before enabling runtime PM and release it once the PHYs have been created to prevent the device from being runtime suspended during that window. Reviewed-by: Dmitry Baryshkov Reviewed-by: Abel Vesa Reviewed-by: Konrad Dybcio Signed-off-by: Loic Poulain --- drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c index cdcfad2e86b1d37650c4d7b0433319837ee9c9d4..affc8e040bb968a5b9d0b6f6fc2694c471368729 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c @@ -4934,10 +4934,16 @@ static int qmp_combo_probe(struct platform_device *pdev) if (ret) goto err_node_put; + /* + * Enable runtime PM before creating the PHYs, phy_create() only enables + * it on the PHY devices if already enabled on the parent. Hold a usage + * reference so callbacks cannot run until the PHY is ready. + */ + pm_runtime_get_noresume(dev); pm_runtime_set_active(dev); ret = devm_pm_runtime_enable(dev); if (ret) - goto err_node_put; + goto err_pm_put; /* * Prevent runtime pm from being ON by default. Users can enable * it using power/control in sysfs. @@ -4946,14 +4952,13 @@ static int qmp_combo_probe(struct platform_device *pdev) ret = qmp_combo_register_clocks(qmp, usb_np, dp_np); if (ret) - goto err_node_put; - + goto err_pm_put; qmp->usb_phy = devm_phy_create(dev, usb_np, &qmp_combo_usb_phy_ops); if (IS_ERR(qmp->usb_phy)) { ret = PTR_ERR(qmp->usb_phy); dev_err(dev, "failed to create USB PHY: %d\n", ret); - goto err_node_put; + goto err_pm_put; } phy_set_drvdata(qmp->usb_phy, qmp); @@ -4962,11 +4967,13 @@ static int qmp_combo_probe(struct platform_device *pdev) if (IS_ERR(qmp->dp_phy)) { ret = PTR_ERR(qmp->dp_phy); dev_err(dev, "failed to create DP PHY: %d\n", ret); - goto err_node_put; + goto err_pm_put; } phy_set_drvdata(qmp->dp_phy, qmp); + pm_runtime_put(dev); + if (usb_np == dev->of_node) phy_provider = devm_of_phy_provider_register(dev, qmp_combo_phy_xlate); else @@ -4977,6 +4984,8 @@ static int qmp_combo_probe(struct platform_device *pdev) return PTR_ERR_OR_ZERO(phy_provider); +err_pm_put: + pm_runtime_put_noidle(dev); err_node_put: of_node_put(usb_np); of_node_put(dp_np); -- 2.34.1