Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1881553lqa; Tue, 30 Apr 2024 01:52:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWfguORGQjR0ATu8VGL3N7sewV7kaH0G09GGjU80HBBifcvxuzgbS/fZ+5gXk2+zO9ILx9RrsE6YqZpbBxq15TgeUzGeCA68xajbBHmDg== X-Google-Smtp-Source: AGHT+IEs4LgFHnxMxtn4wuMX2g0Z/CCQIRpEdElyNszYnq/HtWN/4wORHWRVbDmMvqw4jqy3D1Oh X-Received: by 2002:a05:6512:2509:b0:51c:eeee:8679 with SMTP id be9-20020a056512250900b0051ceeee8679mr10229716lfb.56.1714467171602; Tue, 30 Apr 2024 01:52:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714467171; cv=pass; d=google.com; s=arc-20160816; b=pgOXOFlV7Ox3tttTF+mu9E2K4g31/CJOakLBo+cWoG7j3QmRWISRkcEDAvFzKJGupB w8Gnu9vAYAQ46uM8w4QAQpld91dKn1vbOQSt4dRIbuzs7g+T2Nxy/QZkruFLsVDsI1Uj lBcNRcN7sxBhLs/1a+LMTC5Ls1P4sKxx3vDuepzCmggXyAle0Wm+5Iy2s0PeqNb0pRTO A7MChJg58Ycw5QNreF/SlG+NowIGCq150aPWpIVqUGtZ0KQGaQBMWDVIxz1BEMZ+IdjY rVAr3UxIMA6gDAyUSqaHbiN6oA7Em6G7xCuzx8NNX1qPwv6Mjr0d5xh+OQcpezWxJqzj rwKw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/JIXMZ+tmEG/2vj3SvYBH4bXcI4VlX9A3+yAB/lRDd4=; fh=x+72fpK+lWWQ9QVz5UZDctMcwjMrfQIf28mnKFGdOqg=; b=r0wPlPdFbQ0ydn9iGf36vlsfSrTngPhQv6ky2YoBZNLEB87CdnG5QXBjWB+ZeKrymf 26559qPUx53hIdTG67gcnEuxEy+w+nwJMyhBbNvkSt5ff3Iu6ZQcl9UvKmGb61B5bRZE QdfhKq04e9MpnDw+MoRPn+sYFFXPGA4FCu5SvZHFBIuGIsJ0dOzNpTT0VKhzjQvMiXQp pAmk/APkETeMX7cLCWzEDUCfDHPkk3Ek7+nY5GLaxqj+QSvyjpQYq57E74IKX/NvaXvy RfqmVeEE/62cEdw6s4mL68ogqoxoMbVcCXMnGhdzfvg07LDbapoLJ6YFu3bj5rwbHlvl HRxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kkxaOIpz; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-163587-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163587-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id o13-20020a170906358d00b00a589557ea2esi7382130ejb.49.2024.04.30.01.52.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 01:52:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163587-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kkxaOIpz; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-163587-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163587-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 154E81F21B39 for ; Tue, 30 Apr 2024 08:52:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FC2C1836D1; Tue, 30 Apr 2024 08:50:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="kkxaOIpz" Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFE0F128366 for ; Tue, 30 Apr 2024 08:50:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714467015; cv=none; b=bfvenfTypc/Hq5hT6koo97Z6d3aCZ2i7e1SBRcaz9grsCqes7gbs8li9+gaukrJpBC66GahcWxNr03g06+9XeJ7klim0+eiSTwstk/gmqf44DNViP50N89nidXUoaSMD1mG7n2V2M4aBNbruqgfU8sf8mwZ8VnfniKn022afZz0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714467015; c=relaxed/simple; bh=7OkAqKieBSDhAhQDX4AtdgKVwzo06pSREmFyHqNCt8w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FK93mjKvt60FtTQhtzVGjJOXa7R0j4kqygu/MDAvowRNOuXyaO8VL/RbYoHAJWJLb/NkLU5yM6vaywwrMch3UuDVZ28BWub7hbwxRc8jQL9BdtwiK9Bvmu9BUohGITzJefFsJiwzBHxSxf7z9b+6o6okXJRrp5/lcXPqmrXqcaE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=kkxaOIpz; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-34da35cd01cso88874f8f.2 for ; Tue, 30 Apr 2024 01:50:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714467012; x=1715071812; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/JIXMZ+tmEG/2vj3SvYBH4bXcI4VlX9A3+yAB/lRDd4=; b=kkxaOIpzm9zXiCGjEXlBpxoQ5aSMhOLGIAUPTHc2N98i5oUnJRKAK/clHU4CGjsqQW NvvoYOXQlXc3G5OWMi0g8FUXfWpSEnO+E13jwUTfjIpODYl7n5pqaPEn/fHsboQQAv6I 8oaUt3eE9hxbgugdQ8pnzOOBBlEtobfWGtDIg5fLp1kvi7AhaH/k3gpim+kZ3BJPbosL vLkKJIgvm8pk5O4c8Rr2CKUF3/fQDGzpI5f80peLw5+VL7mnNe4Jh6buDWV3htPYYIhC MxipxldVdSeuTeNuS8ru/T2i9Xl0Q+I4EwCoP/WB3B8lSf1AUYaFUB2N7IpJJK5HBmX8 RdOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714467012; x=1715071812; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/JIXMZ+tmEG/2vj3SvYBH4bXcI4VlX9A3+yAB/lRDd4=; b=fOsSH8YrqObl6U72YCVjhKDiyCBtrOgB+gOejogEZuhRDDWs4jJ5MgrMld36Rva5C2 HU/VGfRp+P76XyN2m+iE/JtvZCySG3CoDnIj5walnL8y80ujgcOPGbt9gtFPJo4RgNcH mbORAI/X0sWEderrPiVxez07jJ6B0FHPD76FW5kQNv83hmt7kpwYd2vpHZ2RYQ6OEyqS RpwyrDj819C37/Di6cnR2BNsnnihCVk9EqAqFXVGdYZBlweGZHzoYWfkmDQSJqvcNTKS bRjnCsmBhmhe5yeX5vab8xHnB5ltbnv5Kj9N/FgKhmQ/8aswDw3gBvAjpmB0xPy9uZAG 665Q== X-Gm-Message-State: AOJu0YyyKV5uP/YwnpJai7gWHvUpKo9oFrqVBm5FZwiGDejTGaMZX/U5 ZYuR18m5MYH0rmKkxbk8ZMuK2mIV7gplOS3UUS+7LWGa5GvBHwJjXQI4wbH8lyY= X-Received: by 2002:adf:ffc3:0:b0:343:5cca:f7c7 with SMTP id x3-20020adfffc3000000b003435ccaf7c7mr11647674wrs.41.1714467012373; Tue, 30 Apr 2024 01:50:12 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id p18-20020a05600c1d9200b0041bab13cd60sm14590670wms.3.2024.04.30.01.50.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 01:50:11 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Viken Dadhaniya , stable@vger.kernel.org, Konrad Dybcio , Srinivas Kandagatla Subject: [PATCH 1/4] slimbus: qcom-ngd-ctrl: Add timeout for wait operation Date: Tue, 30 Apr 2024 09:50:04 +0100 Message-Id: <20240430085007.33607-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240430085007.33607-1-srinivas.kandagatla@linaro.org> References: <20240430085007.33607-1-srinivas.kandagatla@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1428; i=srinivas.kandagatla@linaro.org; h=from:subject; bh=nY3vC2NApvFywCNrd7bStLnbD2rZAm4vIaxy7vAQZe8=; b=owEBbQGS/pANAwAKAXqh/VnHNFU3AcsmYgBmMLC8SxSURhzONPVff35OPZek/+kuuoZAp69aR UmySsZApu6JATMEAAEKAB0WIQQi509axvzi9vce3Y16of1ZxzRVNwUCZjCwvAAKCRB6of1ZxzRV N3RVB/9+LfpdRucIlrq+JZtSTP2TjtKCnPXhPTQvLFsf3NK/9EU2mHVWKv4y+aBN83eoy2Ssg8Y /gkIlo6I4uxvVlXWnyJEfyZr3eJ2o3uFTOnWSjc/CzKJQBSfLhXfUjfuD+cMoSCpzgWE6O04Kw3 F6gQBP3lLrVVGXZpTGrTjsjOhJzxXXZElDJHI1W0wPkGTSPvLGiK4kIN0y5xOF1gEnYdIoxA6cr QTNRW6faVhXmscMIHC8UNEE1fRYlArKhkYFfHTt4L66oo03rWTKpKBPz/n0vcm9GjuxXjBoYtII BHMdCAnEZbnDpfHJcJSqhZHIRQHU2+QLuuiniI8hJMhJ0Syk X-Developer-Key: i=srinivas.kandagatla@linaro.org; a=openpgp; fpr=ED6472765AB36EC43B3EF97AD77E3FC0562560D6 Content-Transfer-Encoding: 8bit From: Viken Dadhaniya In current driver qcom_slim_ngd_up_worker() indefinitely waiting for ctrl->qmi_up completion object. This is resulting in workqueue lockup on Kthread. Added wait_for_completion_interruptible_timeout to allow the thread to wait for specific timeout period and bail out instead waiting infinitely. Fixes: a899d324863a ("slimbus: qcom-ngd-ctrl: add Sub System Restart support") Cc: stable@vger.kernel.org Reviewed-by: Konrad Dybcio Signed-off-by: Viken Dadhaniya Signed-off-by: Srinivas Kandagatla --- drivers/slimbus/qcom-ngd-ctrl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index efeba8275a66..a09a26bf4988 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1451,7 +1451,11 @@ static void qcom_slim_ngd_up_worker(struct work_struct *work) ctrl = container_of(work, struct qcom_slim_ngd_ctrl, ngd_up_work); /* Make sure qmi service is up before continuing */ - wait_for_completion_interruptible(&ctrl->qmi_up); + if (!wait_for_completion_interruptible_timeout(&ctrl->qmi_up, + msecs_to_jiffies(MSEC_PER_SEC))) { + dev_err(ctrl->dev, "QMI wait timeout\n"); + return; + } mutex_lock(&ctrl->ssr_lock); qcom_slim_ngd_enable(ctrl, true); -- 2.25.1