From nobody Mon Dec 1 22:37:12 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 E918E28151C for ; Sun, 30 Nov 2025 14:41:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764513682; cv=none; b=QLwLSLx6YyE/r7EPgAjlsCwVNkWN0xLsFIuEv3TW3irpnB4ffW4FUvee23lTx6PHzVPNBVBzOZuzyDsrTjCfIRBKSR3glfmIp+lyx99lAIokFNvdU05BlGwSb9xCiZTf2YhiCH1hlw9mHMVZ1CddowLxtcQB8ZNZ2G5Z2w7Yi5s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764513682; c=relaxed/simple; bh=bMnfCaKOnZ7aTE058jECxi+htUeiLDQ4JeZLEQgIPd8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ANBeF+9j+uRq3MpSvJ1g9/SeFR0oclnuHg2ZFKBNVEcvwk7sHUG850GbPRboQbpfFNUkiuFQjGogXP+q1RVJB5CjtJMq/haa3X0gjv2KR5KcOhbi8NkGTdS5naWcRYYk1I8+QxOl1rlrQz3BInt7dSQcAVQ2RAxNmgHH++SN8AY= 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=kqNm+jM7; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=HULdTF4h; arc=none smtp.client-ip=205.220.180.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="kqNm+jM7"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="HULdTF4h" 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 5AUEA1vV1977641 for ; Sun, 30 Nov 2025 14:41:19 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= Pd+Qv3QALgOY4Zp+I1aRJ5rzM+HK2hYhAaPQwHjRYiA=; b=kqNm+jM7Cso8AI/c QUzAnxiCAeXvb4JwaKXpOQml2rvES0yP5C5UepFAJEuzwKrxlLvIkS6UdGec8gYq O0cMeLf0qoynP244jCum5OAKOoTnQW1qM08ijkkApzpHllP5eGKXSDOnM/4L0IO+ RdkO029DtnJbkTkVwLCMiOGe8XPmrjylCqDfmOUd9iyCCe6RM7zXTVWQbXUEUjQd +lh5a1dPKbltL8Z0j/F6bL52hM8NDf20BHCB8DAhwl/JuGQ3bLQ/QhbTqeIvUqh2 yM0gn8cIDh5776PQj8Q7/m+rPsxVoaMKFVE8frCFuQxY0WqBP4o6hvrAbDs3afKi I4DD3A== Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4aqrwsta9g-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 30 Nov 2025 14:41:19 +0000 (GMT) Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-7a9fb6fcc78so2281147b3a.3 for ; Sun, 30 Nov 2025 06:41:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1764513679; x=1765118479; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Pd+Qv3QALgOY4Zp+I1aRJ5rzM+HK2hYhAaPQwHjRYiA=; b=HULdTF4h7pMEj8NkX8mLvcFCU85oe84YBHsmVIxmnIsKNjmhTyHwil0gl9RqSjMiqA 97z2320KIMMNl2yHA/odcd215sUi/Qb1XPLq+dDvL0j8KmuYGUsR/LchaTl7LpxrNFfi lZaDhzh4PmiTX6QLc/Y6IftqIbEsSP2RPk6Nz6yc+pKlwdiB/mqJbs0NVdNPeFUOdDux OAr5ztAaOcHciJTSPsmMjYf6sWtbcBb11aBavoDPue2ZD7P5CO1saCtftYFqhBA0OThE RDP83/X3iaYotMR5UghgWmEEKj60WLn/bMA1TGFvLmJiJqHVHLyQhLkqKMqxjuqLxAYe EkNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764513679; x=1765118479; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Pd+Qv3QALgOY4Zp+I1aRJ5rzM+HK2hYhAaPQwHjRYiA=; b=TnPpcIb2OedRr3JQZ/b2zsSDwbBLMk8a5ioVIU/1mYXw6GBwbQEoj59zYJcrSuCDKY evYjFjvWIwgGyOYgyJHNR8mzTab9EgVWHoIh9X44iXA0iPfUFD+SypiCTotl/ZQbBMIY ytadG1sBYU6A70H78N2PvnExjEfpeQucVLecTXMOI6O1n56u+CWjj9P99xphkIZuuHAm Pw6Y6Idy17GPxz/j6TQSCaxyNHMigixAOVvCos2QFp9KxfpNrWk/DhGTVNXsh30GfZBg M1ewWIqQPW2G4Z7WpQ/kDGspAdQ8HwR7326eEmBaHyFan48ip2GnMYM7N0DsN1e9UBAx oLeQ== X-Forwarded-Encrypted: i=1; AJvYcCXjrjL+xXj94KP1o8fhR+n3iQLRqxuagO/OPjN/erzQmKm8voOYlcTSFgCMOfzqFMSCEqjqSnZOUBkz3Ks=@vger.kernel.org X-Gm-Message-State: AOJu0YwrtQl+MygB2hp4JD5+vC58b/4V/wzGsyRsiN/VQfrSZn9iT7zf 21AtzuikAu7lMd5EFnErXX5bhqHqqIAMovwZxedNVWIyNd5gMTH49bblLEhp1MQQx1Z17vD+Yl6 IOKJD34YrtO6k/jWJJmZ2wKwWdLN46dWtL90hS0k9MyBnU1Z6xq9943YjUx35QOL9tcM= X-Gm-Gg: ASbGncvt7mePCnZRs8jAVbYfLKawVQI7QtSHO3pxMjzj8I5Qg8bb0lQ26MLXJOAXrZw xusAEnJf3g5bozYFRUuE5v0V3yepXpJ6G7op2FTbqB88MPS0OnTcc6/aDa+JjTPtlxo2m6Ts+xE +aA1yasYEJ1Rtte1F5Y6GWzEnKb9m6+21doKYx95GuAXCjvB0a0L9Z7gi0oBhWzknxA3PUWEFy3 s5yMlTJAlqfftPHnkDXWtDu4ifaSq81Don+883G9sMIBuOTJ1ha6MeCVrFj08VFBRg+ChIAzoac jZWy0DelU8J/rgn2fI7MKRZGkD9VN0MG+x3ZO/EoF+FZv3zJ10JNgASXhUQ2mgSJC+glYDgQBw1 LIRAzT00vTVYxil0NLHndsefsidEj5s8YOSBEJWENyoPKAg== X-Received: by 2002:a05:6a00:c83:b0:7b9:7f18:c716 with SMTP id d2e1a72fcca58-7ca8740ef7emr23213446b3a.1.1764513678612; Sun, 30 Nov 2025 06:41:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IEFooBrUHCXJXNh+hn4uuPyswxa69aKTdQI+xOphSuu/WoXXu0NsiSxAPQs59VloxTZP1PV1A== X-Received: by 2002:a05:6a00:c83:b0:7b9:7f18:c716 with SMTP id d2e1a72fcca58-7ca8740ef7emr23213429b3a.1.1764513678137; Sun, 30 Nov 2025 06:41:18 -0800 (PST) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7d54b003177sm5240065b3a.14.2025.11.30.06.41.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Nov 2025 06:41:17 -0800 (PST) From: Shivendra Pratap Date: Sun, 30 Nov 2025 20:11:04 +0530 Subject: [PATCH v10 3/3] firmware: qcom_scm: Use TASK_IDLE state in wait_for_wq_completion() 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: quoted-printable Message-Id: <20251130-multi_waitq_scm-v10-3-5a5f2f05a417@oss.qualcomm.com> References: <20251130-multi_waitq_scm-v10-0-5a5f2f05a417@oss.qualcomm.com> In-Reply-To: <20251130-multi_waitq_scm-v10-0-5a5f2f05a417@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Unnathi Chalicheemala , Shivendra Pratap , Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1764513668; l=1395; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=BmZ+WZn7jFHc45jlpLN3qi+ps/EFYUnGc0cv93TboQw=; b=1qa1ANAMPVU9NXxrmmx/zv0uZyl6UqzGMceDsVIO9uT49X04mshK+q+yrCPiZkstDhXCUzg6J s0XtSROXn4jAgdrUoXL9bp5BrtMN2uurOQKtcexU9etwNLm9Q2CtIOM X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTMwMDEyNiBTYWx0ZWRfXxj4pmC4WffRy 26uLofw5R4jFinWeY6z6psQlm8l9ksINAU7kkg5dgAqNgxkdQBpAk4c9kx65Vi0XUUuZZVlp1US S34iMuxYg/kqzbPl1AhlZSKJU7RRRkWyff1AVFH5sneLKeNpKElEfFKMwADtfXDsQbHFZD+Qyaz J4V1iKY6AqvnerZp9JzSaZf6NoBAC46kf/FjDCREcjDRHjg+Wiosf2pgyBhf+fuDwrn/lDIEG+O AUPFn0y2l9O/MkG/jtlpqD9T2kB2UtTwrQ26KPXjXtACLDp0DUhIeo5NfeIBSFOR6OMO92Z64Dh RLqoZQlQb+zTC9kxYsFDi5/4eP3hdTVoGOdcfVLZQhBNzVx/FefMFzHvXdDA807pBBXzjWL/fD0 dzwOx38ZohUN54XHprt1Re9HbXEsuQ== X-Proofpoint-ORIG-GUID: BpAEu1_D63V292yBaPrHg5WH52lm1dUc X-Authority-Analysis: v=2.4 cv=WONyn3sR c=1 sm=1 tr=0 ts=692c578f cx=c_pps a=rEQLjTOiSrHUhVqRoksmgQ==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=CXMSIrXqJIVyGMYrj-4A:9 a=QEXdDO2ut3YA:10 a=2VI0MkxyNR6bbpdq8BZq:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: BpAEu1_D63V292yBaPrHg5WH52lm1dUc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-28_08,2025-11-27_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 lowpriorityscore=0 bulkscore=0 suspectscore=0 impostorscore=0 spamscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511300126 From: Unnathi Chalicheemala When the kernel issues an SMC (Secure Monitor Call) and the firmware requests the kernel to wait, the waiting thread enters an uninterruptible (D) state. In case of an extended wait request by the firmware, any device suspend request, cannot proceed because of the thread stuck in D state. This blocks the device suspend. Replace wait_for_completion() with wait_for_completion_state(..., TASK_IDLE), so that the waiting thread, show up in TASK_IDLE state, instead of TASK_UNINTERRUPTIBLE (D state). This allows the thread to block until completion, without blocking the device suspend. Reviewed-by: Bartosz Golaszewski Signed-off-by: Unnathi Chalicheemala Signed-off-by: Shivendra Pratap --- drivers/firmware/qcom/qcom_scm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_= scm.c index ef3d81a5340512a79c252430db5f09cd8c253173..45951c04f377b725cdde4696d83= 4435abd92f015 100644 --- a/drivers/firmware/qcom/qcom_scm.c +++ b/drivers/firmware/qcom/qcom_scm.c @@ -2316,7 +2316,7 @@ int qcom_scm_wait_for_wq_completion(u32 wq_ctx) if (IS_ERR(wq)) return PTR_ERR(wq); =20 - wait_for_completion(wq); + wait_for_completion_state(wq, TASK_IDLE); =20 return 0; } --=20 2.34.1