From nobody Tue Dec 2 01:07:14 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 C52972D7DEC for ; Sun, 23 Nov 2025 14:19:49 +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=1763907591; cv=none; b=sg5ld9yQZetal/wz/CqoyZxBlBRvgdCNM2E93r2bX96br2fPIFr+uFJ371VXSx6iM/eLA754d7tTBLHm6ya5FJbF3pI7pzNdeIT6JQea6gZYxBAOSZYvQ/rU9BtWPvNCY1tFHBUEPYzVjC+6y2xM466DqIKkdevloa4bmIFFqSo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763907591; c=relaxed/simple; bh=5rLIH0pbgZVGNRk8Y7MpYv7XibWR+Z+oJAscnT605F0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Je4PuuZoTn6cGxuOPuhMOK7bGh4ad4y0OgVAJmti1fmDRn3D6MKbPeQ0SEqeT9i03GtuVbsq2dN2EesPoQXutLGs7D1CtlsCUUCJOwQnDlf2TnrU6/Rb8go6ZAiQQTJ7PE4rtf6JNfmMbICbxXf6NaPjyQ+Y6X2sdkwi0QUIbhQ= 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=S2PF8B4p; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Ea54ub9t; 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="S2PF8B4p"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Ea54ub9t" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5AN9vN6f1306031 for ; Sun, 23 Nov 2025 14:19:48 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= tIUtGezLTYSmkaEQHiNfOZ5kJ5ICHqHIbG7wNlDi+U4=; b=S2PF8B4pKU/MWzM9 +h3RHovf/fzGplgwu0yaa7dgL4k9wpAOaMOAH4VTZybSP7c4lONxhq69gwOHscs9 z9hZDu2Q2nwBZflUSKhf49uLjSGEkLRNJO1ldamvOinCvk2joNRUV2pS/TdkxlgQ UlFFdK83/twIaC5LglI2kcwT5FmOrrdAFLWCQ8oEW3tqDuGinHqvrfSEkXOoqOYA UVU6yr+P9Mj8QT7/YDAYaM4ZY9Pj38YwFMr53BiEJreojVmyKpmV4X6/Uqi8h2HP 7CKAY29lgXY1R0Ol2AVLHLVyfoBvyMZStGGM6oNut9BGDrT4ZCcqexwxjcqeKUSA Y1S+3g== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ak69sjga1-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 23 Nov 2025 14:19:48 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-341cd35b0f3so4443769a91.0 for ; Sun, 23 Nov 2025 06:19:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1763907588; x=1764512388; 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=tIUtGezLTYSmkaEQHiNfOZ5kJ5ICHqHIbG7wNlDi+U4=; b=Ea54ub9tMH/xMh8CZrNVGpAhIWTnqE3HrVmEXU0clhx5XHqr4nb3NHIQH21e4ZS+f6 aP6/BHpDLIrb1lpWH4ywk9Di5dIV++QWPvIDlBMNRq8/RN9LPAgrD67JbaTOWhu2EadX vxBgyXHc2ZWSNEntbVSXw8UUo7WKu9L7ecipwVCv1R5EUNR2wKie/oersHIhXXEPDfod CphvGmZQZ0WcdzI055lkMrCxS8nE4n5Nrggnq73cUWsLZPDVuakd92xBMyKNB7bzmGx5 /IbbNs8L/18Gax0a8DvoDmGJmLwY+Xq2qEF5cbfZLeVeJPtGwp5VDQIOVXgmkVg+jYaS Ps3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763907588; x=1764512388; 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=tIUtGezLTYSmkaEQHiNfOZ5kJ5ICHqHIbG7wNlDi+U4=; b=uAGaR/g1+5KDxPjpLR8xaLIJY9hDHBhMjVTFjGJuvfHTZTQy4Lw2zRWl9OH2msfhbl WG8VaV6mG2iehSReKBtedaxc9vdVb6spVL/4kQ6X8KJMZhEscIOPMQuAC+Jgk3ZVXTP9 OEnbGxEN0yBRE4XLX5TSi/VG4uibhHT7FTYesNu41DEeo086HtEV7cR8HOqC0oviC+8s 6WzRBodHEg47WVTw+G9ZvjjTUTAEbiZxlxKHnIzYA9fPmIRe1tMtcTAsuEgXMSDLfymN 1NLpu6Qk0iUywz9HN5okGGhjn6y+tMYcwPm90NS8nhOcn+CbF/lbTZCWll8f2G8RXYUQ axsw== X-Forwarded-Encrypted: i=1; AJvYcCW6QW71FzEnyM572ihZQ8DeW1l3J037KXD1B2D8HGS6xoVR1KzybfdNyL1T9xRa/0UpgqLjDVXYnjxGLJQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzZFuXw6PoE4RvDXquo1NSxTNJcdc2DfkA45U24MWrke7XoGT+V nko8b7Ubv19zMkqxFtV46t5tDtosQRKmYiMSvjtV1A/cAw1HTrRMffpEB4Tou1itKXjV7HcbjAE cRCJKQjzS1Gr5ODD/l31SzYREa0w8lfKwV5W+ggIKMyICUALfz3lP2+KldjqIPgdeiGk= X-Gm-Gg: ASbGnctvXYCRVv6HUjfW2Su5RNqSGM971hPeDUWnDX02oJ0MzAt6jht2Rq8VuzZ4+C0 4aSI2XwWLJzLu3VxEGP7iVd2Q13VlqGwQNO3zkZ6ZaBT5c/sZttPEjggb4rK2V016RJp96cZEls pueL7BwAH2v4ZKyHGDTlIf3DXw1Q3Ehj0n1P0RncQQHqCZRG9+btDSck1gq673Leh5K72ENmyz9 LB2ep6P04QmVnGcuN5EfFVO7E56rSRes+B4hlb23RC0KH7O6By+l9sihlW+dI/3uH7NCyGVnyI9 IDb0RMZ6Oji1QegcojmnxBccYHUTu0vMr8U1btTVXFDZHw0QpaMdaP7mtqYezFtD+2u0ZsmRr4u pZlGRkI5u6+ESbBdNuIxGvpTczyWblmbFcsqftQ6aW2B89Q== X-Received: by 2002:a17:90b:3bc4:b0:343:7410:5b66 with SMTP id 98e67ed59e1d1-347298a9f91mr11492035a91.11.1763907587750; Sun, 23 Nov 2025 06:19:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IE8+iw9JEE8KL8V2QvoLa7/4Y0GF8+Y5R2fOPNQ23o+4pOOjfTQhH5KQZFUI73ZVRLcgefsQw== X-Received: by 2002:a17:90b:3bc4:b0:343:7410:5b66 with SMTP id 98e67ed59e1d1-347298a9f91mr11492011a91.11.1763907587170; Sun, 23 Nov 2025 06:19:47 -0800 (PST) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-345af0ca952sm10135992a91.0.2025.11.23.06.19.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Nov 2025 06:19:46 -0800 (PST) From: Shivendra Pratap Date: Sun, 23 Nov 2025 19:49:32 +0530 Subject: [PATCH v9 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: <20251123-multi_waitq_scm-v9-3-0080fc259d4d@oss.qualcomm.com> References: <20251123-multi_waitq_scm-v9-0-0080fc259d4d@oss.qualcomm.com> In-Reply-To: <20251123-multi_waitq_scm-v9-0-0080fc259d4d@oss.qualcomm.com> To: Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Unnathi Chalicheemala , Shivendra Pratap X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1763907576; l=1328; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=muVZyS/ZI96TOitovzS/6m9ldXptICgjgmgqz4hzF0Y=; b=sh5nb3RAWPn/vaCaXuixCnnOdhSzRgbViCdbwqzaXFqPjzk3iUKqKJtvTHcNrWUZnjNn17DYE mB3ruW6MV+wAP6IWDAlf6ipRG/K77DQ971d5glZJ1FWjbv1AL6L+E82 X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=PNMCOPqC c=1 sm=1 tr=0 ts=69231804 cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=CXMSIrXqJIVyGMYrj-4A:9 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 X-Proofpoint-ORIG-GUID: 7vl2tqS9_v4ervEvacxtQZMgh4X_FDbK X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTIzMDEyOSBTYWx0ZWRfX6frlIsvGGpik x15ZaX1KbEQhRGXrZjcnDm8Zo1lyzO4XuyYOiFDtPF9pD1I9WUGrT+wcm9UOJR+le3zhHap3Gcs Oop0B8Ao0Md4ZChN8RLGNpFeZ9Vc79Qi48pNR9O6niHUvzaAyR0Q3KNNozRmFnzd8rqsPMZ0YuP YXZ7BDEUbaKTPMbuORLSrnK9nxOWVqSoRfInukvotnMQ/1Apz8C5iS8S3qyOOaJDnZma3CxXfhj 8bH8b5E313faUZJbsPDkMUUxssGdSS8C7Lds8TJ5KB26ZLXOd2z0dIhafidlpcOAM50EFF+buQu /XwFQ1L0cuDvrIPAVnLEOiQIcizzokUXnxkycAja+sBW3TGjQaJuAj5FHJACzb5Towqir7fuSQ3 F92nB8ICpe9fv7KdmP+KDKaxa8uyVw== X-Proofpoint-GUID: 7vl2tqS9_v4ervEvacxtQZMgh4X_FDbK 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-23_05,2025-11-21_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 spamscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 clxscore=1015 phishscore=0 suspectscore=0 adultscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511230129 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. Signed-off-by: Unnathi Chalicheemala Signed-off-by: Shivendra Pratap Reviewed-by: Bartosz Golaszewski --- 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 149c2ccec2a5ff77054178fa021fd0b721d9f8d7..dfe0410fa9f965b16f8b0a9d98f= 3046e80b8b97b 100644 --- a/drivers/firmware/qcom/qcom_scm.c +++ b/drivers/firmware/qcom/qcom_scm.c @@ -2320,7 +2320,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