From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.180.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796036466; b=xLUZGt/w7fK4C1JdIzVY5sgqmEr0k+GcSTyans2fbqvR75G9a3GJUGzpZAOVWq9zb8AD cCo/luAp02Y8mOAmhOuuVkdkq1zev2kv/slJwCZoia+W8rpKa0Z5DwxvmOYSHa8Zp/bVX lYnrkOK8Xb+L0CiZZ3mgFBk07BR63XOYi5+6ahutj+AeogfmvdSL1X03XS+ds+xBbJUAS v+PQvo6JQt9nFlH6ACga0GkdNlsboaOIGy1LiZLEwvR3W14sSuBWY86tgWQV794S+Dd2F noLDH8OBzxMNW5K2NKSwzKhUaWROOVDF6Ma2T4LHN3P9ehLXyZgQ9q/cIIXR1P26ekw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796036466; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:Message-ID: Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-Proofpoint-GUID:X-Proofpoint-Spam-Info: X-Authority-Analysis:X-Proofpoint-Spam-Details-Enc: X-Proofpoint-ORIG-GUID:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=1uRIJNWtxP5KLEVLzwh1iCi1r0+MOKlC4ZfYmiQTOKk=; b=fx6IwIYz/1/SB8QMVNu200dihRKnnxudwHO/YwM5Y72335VdIVnQhvTLdCUiBt4TXnaX DCUvlddr60KqsHNUtotVBGFRDZaTSNIYUqCOFSVEle9aGh4szdqepPsUckWo00Tf8jq6K ML9DAxIxH8WUaSPC0Ld2d8r59vjgUkIppZSOg1Lj93Ujh3iNCX2O59Cr8EN4MuFabWD6d SHNCGe+1Ysg4AT1ymf0MCHcFqf6KzeJtHNYBb/JoiiRhpW/0m6UKNqPpF+mcrGc75V84z TJ9/AljR+ol/G5MyjzvmEkUxNlrlU3ErZ483zDTZZJ1dQLsJ/zlbdzBqUaiPjujekYQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=k2MKXolz; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=GvIw3izY; arc=none smtp.remote-ip=205.220.180.131 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F728606A33A for ; Mon, 30 Nov 2026 11:01:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7F728606A33A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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.a=rsa-sha256 header.s=qcppdkim1 header.b=k2MKXolz; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=GvIw3izY Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AU9UwrM2375833 for ; Mon, 30 Nov 2026 11:01:02 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= 1uRIJNWtxP5KLEVLzwh1iCi1r0+MOKlC4ZfYmiQTOKk=; b=k2MKXolzck+hAVfw k3f88XXYSyPSmNK84P1Bom74vPEzWo1T0Y3w8PH+z2AQH4mUJNs8+BUXj+DMnzEm 1QL8PDN51JlI7i4wfML5mZZBykTebJZSxWIgvNzf+rhE32gnvNOIxQxSDGkH1fY/ reqNu06cjjFepQ+RwtvBaBwLfpepmc/6tJDuqHn00Om0crpmUzfoeHcjCNC1WNzX LLl0FXbnR1e6BolhldpIxuWs0N2qsKgbLKD3XllwkmCVamM2eMKnq4UC2M+x6fLo MhDOaiRtxmhFdc4KOVMMPX78lKFmXaIiFc2RSwb+uqAYeGOszJg7YcSpVkwmkRZ6 hl8GUw== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4j96c0rdqn-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 30 Nov 2026 11:01:01 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-3b40e7f4fa2so13138763a91.2 for ; Mon, 30 Nov 2026 03:01:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796036460; x=1796641260; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=1uRIJNWtxP5KLEVLzwh1iCi1r0+MOKlC4ZfYmiQTOKk=; b=GvIw3izYebOnY3RRnYmyibJrn3NfLWT3imh+4zwVGv8Te3DbfvYyGOtz1YmdeSmO5u VYEBI+cq+yy0Y16uuQCtz5NXR/PQKYcnS6FP8A2Eaf/pDZTXhqoXHpOVmTT0NLH0XwVt wfBW3+YgevWWSKA9ZitYrhRYCwNB6XDAdJKiY6Khw3YiFCJKy3cDLCeMOsXSh1uGyKib HiHYB1hwkuKGo12srEK7s3i1IsBL0XjoYN4gvK4wBQya1qXqH0MmxAguJH7P63tm1X7Y eFic31/opPDO1RgELtv9azCFt9Dj96WhVJdKS3lI4epThSn+sofVWXLsRRzMbuiZt+Sr 59oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796036460; x=1796641260; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=1uRIJNWtxP5KLEVLzwh1iCi1r0+MOKlC4ZfYmiQTOKk=; b=MRBHCiWcC/J9LU7vXi3IapeWxHkXJkWtIGlBkfiLJQq5O425lj8ZymXQxitGoIGmaj skDo+QXRDv4MxuJRskdPdWiTK1SEQfw+3DrMFC/9JEIq9edivsuWhS66k1r4wYUhYEIB nQwqpmoKJVLmn3SKFCjbPJ9ns2E3KkWhSWtTs8imRSoKQbbZ5hZV2wj/p/2Vl2l/7ijj OVG3i2zTy8pZ5/ouQW5FSobOtjc8HskOauWh1f2hFb4zZRJXoX9xx7BLFDuE7epyc9w2 kK2+PX6HpJl3REGzzXpMXmibY2GxPdKPGR3XaDGf2vu2FCCLqpP1kRl9jzSKTFicibD2 OssQ== X-Forwarded-Encrypted: i=1; AL+hErGjas1q8Fa1C3szFTaxIXNYW8rlTYTR70CxUGlqvikqV56m3EWi7SD+rhr9Gl9nLwTpvCGWbqnVOpL5heE=@vger.kernel.org X-Gm-Message-State: APuU4Z8gZrNHDwodYS38zXCcR8l0TyD4ec281gALcBbfOu8S542JvTqf KM/OPb3NLorVg9dsGCWs8YPnPAicdH0qpcfEYsNaPvgvoVm93ggzeG8cIsTLoZaVjds+RuQaN24 Timp4DtMl16b6aMeAan572mM3+6tai76iJPWCfnAJwH2hQcLYBJLLUl5Ll1qwFkDrRXo= X-Gm-Gg: AZFdTZf/1iEJawgfmm3EFzUQjLsf9pi6CaxoAvtkCer2xv6OA7Rgs8H4jwxDM1uCNw8 QgN4qfMhOy6AmN2Sk7YxXKPEY6dqmh6yoFcB48DAEVQ6bpmkhytytXMUXfjrqGnIfri96SR+074 ZWOnU/CJLYbEeHCCS7ihjo+hVyAy+r4xJvW2/m3gqST/KWzKOA6Kb82Wu8SXj9LSoxZ2At69qYV Lwi9mfSzamXb0jlUB7Sea3FIgzSEGEUhhlklhvQVFG9MefMzV9xzCLmbZ1bL/6CLj6JlL4DX0PD 6PHf5RBuHu+En1ghG4IRJS5KEufH8WeJi9lTCJnsuLpVMAp008YyKa/AE9gjQqYACuNxZTgCZnx OLfIqzbW99GQUvttKR0X956Iepvj17XypWcTIY1Ujnc3C0EdESGHodW2+aE+SraWdpU7c2/Vm0f cGHA== X-Received: by 2002:a17:90b:4fcf:b0:3b5:728d:2d18 with SMTP id 98e67ed59e1d1-3b5728d2e6amr4725259a91.2.1796036460323; Mon, 30 Nov 2026 03:01:00 -0800 (PST) X-Received: by 2002:a17:90b:4fcf:b0:3b5:728d:2d18 with SMTP id 98e67ed59e1d1-3b5728d2e6amr4725132a91.2.1796036459197; Mon, 30 Nov 2026 03:00:59 -0800 (PST) Received: from [10.218.10.142] ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b41ad0b2c4sm51923149a91.4.2026.11.30.03.00.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2026 03:00:58 -0800 (PST) Message-ID: <1cfd168f-325a-4d2d-b79f-3f79d14a03de@oss.qualcomm.com> Date: Mon, 30 Nov 2026 16:30:54 +0530 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/2] phy: qcom: qmp-combo: Add PM suspend/resume callbacks To: Manivannan Sadhasivam Cc: Vinod Koul , Kishon Vijay Abraham I , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org References: <20261113103111.156476-1-prashanth.k@oss.qualcomm.com> <20261113103111.156476-3-prashanth.k@oss.qualcomm.com> <179578690105.13164.10122053052435645688.b4-reply@b4> Content-Language: en-US From: Prashanth K In-Reply-To: <179578690105.13164.10122053052435645688.b4-reply@b4> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: goLuZMqPKPAI26lgbB0DCrqIIqxRHdyB X-Proofpoint-Spam-Info: AW1haW4tMjYxMTMwMDA0MyBTYWx0ZWRfXwOdb2Gvt64m9 49L58Oc3lAGrjBAbRJTyHlbQMR/PbyEHaq0a+CAy3qASjyIxQVuCy9HNzbGDiXKfdGvD/+o+RbW xjaVezwjnQGLzIOR6XTsCLy4ORt5j7Q= X-Authority-Analysis: v=2.4 cv=OvnaWC/t c=1 sm=1 tr=0 ts=6b0d576d cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=zJRp6_cAMcgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=c92rfblmAAAA:8 a=EUspDBNiAAAA:8 a=aUfI303XAKCfRJQOB4MA:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 a=GvGzcOZaWPEFPQC_NcjD:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTMwMDA0MyBTYWx0ZWRfX3SoAUQhBWjRj 4p0ABXLKLNZ+U80c+AzUy/0exUzxcLyzoJM/z06U3UydQ2ZEDCA8cMLDGD2TH0htaaf1kvXehZ0 0lANKUAXpuRA0xFlIFUxyTW7dZBozZdFpJzZCMajpNfS2qclwi5uRWullERDh0reClFMxmqzK/Q ODHpXH4hRnU7BZNKBJ8ct8TDHagtsPICbkGNT2Ht++nsI9syTONo3I+JwzcERzwUiIaAmn6T5Bi k1laDmuV00oRzkhZpFFXZFzX5rcE49CY8+sYVxbKHYqnV7JI8sb41G7Ufi/pSYuey71/SbSJWjc zwpER6aWZXUTjEoiiQahD6fhlVwgOPGFH/ZvkFxDV+ruB4Zxjcyr4Tr/sZ+9IYnIe4LRZ90vudP p6ft7G+3X1EZUVCAzP1okoCBjVL/mjSOzyrwiYmghHaHTW9Z0nHtIZOnEz9ak/CzmcetgT9eX5T KWzd/NdwvlAdwy2s4NA== X-Proofpoint-ORIG-GUID: goLuZMqPKPAI26lgbB0DCrqIIqxRHdyB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-30_03,2026-11-27_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 spamscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611300043 On 11/27/2026 7:11 PM, Manivannan Sadhasivam wrote: > On 2026-11-13 16:01 +0530, Prashanth K wrote: >> Currently when we perform system suspend, the phy clocks aren't >> turned off leading to power leakage. Prevent this by adding PM >> suspend/resume callbacks for the qmp-combo-phy which toggles >> clocks on/off correspondingly. >> >> While at it, add mutex guard in runtime_suspend/resume in order >> to prevent any race between RT operations and phy_init/exit(), >> as it can lead to unclocked register access crash, underflowing >> the clock enable counts. >> > > I don't see how this race can happen. https://sashiko.dev/#/patchset/20261022104321.306679-1-prashanth.k@oss.qualcomm.com?part=1 This was suggested by sashiko, and later Konrad also suggested to throw a mutex guard for safety. Its true that we havent seen any issues for now, but it would be safter to have a mutex to avoid concurrency. > >> Signed-off-by: Prashanth K >> --- >> drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 7 ++++++- >> 1 file changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c >> index 187f0cd11f6c..65d280f45db1 100644 >> --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c >> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c >> @@ -4717,6 +4717,8 @@ static int __maybe_unused qmp_combo_runtime_suspend(struct device *dev) >> >> dev_vdbg(dev, "Suspending QMP phy, mode:%d\n", qmp->phy_mode); >> >> + guard(mutex)(&qmp->phy_mutex); >> + >> if (!qmp->init_count) { >> dev_vdbg(dev, "PHY not initialized, bailing out\n"); >> return 0; >> @@ -4737,6 +4739,8 @@ static int __maybe_unused qmp_combo_runtime_resume(struct device *dev) >> >> dev_vdbg(dev, "Resuming QMP phy, mode:%d\n", qmp->phy_mode); >> >> + guard(mutex)(&qmp->phy_mutex); >> + >> if (!qmp->init_count) { >> dev_vdbg(dev, "PHY not initialized, bailing out\n"); >> return 0; >> @@ -4761,6 +4765,7 @@ static int __maybe_unused qmp_combo_runtime_resume(struct device *dev) >> static const struct dev_pm_ops qmp_combo_pm_ops = { >> SET_RUNTIME_PM_OPS(qmp_combo_runtime_suspend, >> qmp_combo_runtime_resume, NULL) >> + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) > > Same comment as patch 1. > > - Mani Yea, that sounds better, will do that. - Prashanth K