From mboxrd@z Thu Jan 1 00:00:00 1970 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 B212726F2BF for ; Tue, 23 Jun 2026 12:21:13 +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=1782217274; cv=none; b=fBC5URuohWyhfkd0h1XbKhzPwmjOj+kveodsvN2P1bvGchrfJKN7d3FJ5cSiHKzBTFghJzsP7lfnjWiecloVEqugqAV1LckrR6R9bFQqchJcNn5OujjtrLL4Zjw1q5CjZxR8d/bfUd+aEtkXYPoy5bQGQx+KLQXw3i1Yl0dkSmg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782217274; c=relaxed/simple; bh=Uisy2K09oTgbBqztVQlxgX7d4yg7HllsKs/lCKvqdFI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lbXFgaqG35Ee5NIQs5G8qaKuzYKI0R/R/eqeTLCOM6T7UddpRcxrNaVpb6rSiPGw4F8Wz5XDrD0TJxOvggLN/ujy1ESpo0NpeuLjQmjVIJ1v0KtO8JSdf2HkGhNu6CpwiOc9NQPmgPxd4mFGy+ciG+hpPArUWJ+x+7TvxG1rMs4= 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=h6Dplp4l; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=O5JMXYie; 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="h6Dplp4l"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="O5JMXYie" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65NBZLtx4017177 for ; Tue, 23 Jun 2026 12:21:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=0RnWoMIES/C zkhCcSsrHFJ9LX/JyT5AxMedV2CmbIQA=; b=h6Dplp4ljdptQgfUK5V2C5mLp4x af2n8dcAiyqdVAfwqqGG3GuI6/2JL1DygKH0XWGHK5khXCzA+EyhUV0g8GNKdz9O FBCfxiKNc9l/wubjXek2MK6sUq2P/H93HITVkwqAn3H9mPMAbxBWH4tUSpuFWfPV 7R9K2ijtYtqgBuLURQdWyOaLEZpAs82NRZaiqP8LXdLhOPDB9BP75tR/aVJ3IlW5 xr4eMMPBzxOcrrL4UouSQ6KCVHvCnt1pL4G71F0hm/HzYOK85o6W0T2KmZ3o7/2y ICYCviZ94Vk5vX92F1SV0UKY8dsJMTutI+r0NF4pjDB138rlixUMfZbMQrw== Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4eygkjj7xt-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 23 Jun 2026 12:21:12 +0000 (GMT) Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-8422ca754d8so4012161b3a.1 for ; Tue, 23 Jun 2026 05:21:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1782217270; x=1782822070; 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=0RnWoMIES/CzkhCcSsrHFJ9LX/JyT5AxMedV2CmbIQA=; b=O5JMXYieW99OR0/glNSGfEVvoE3XIlGkHOli8ThoCeKn/vk22GNvLQjUT0zRlx4IMc XuekdTJtt9vbpuUxPjkZE0gDn8Gsz4cyuk5WifoF4U/YEW5qKHcYZRMu4y3nAJJWsdcH GT3lj5My77H8Oy3sDBUTB1AQMucO/Y1uL0chUTNCFRSINf57u4J53VCS8H6XuI4sT3cE JaQNsSe5rJjb3obUS9tHangwsRwNDaNF9UFvBhc4vtbbgjVNNCp2BbAv+7T6uEaQspiz ysxQtgIcptOJviU0/Ko/RwFUkQOtseWmIEVQDH9yVQaLUW9kbjvQZPsY3riduHVGghLx 8GwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782217270; x=1782822070; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=0RnWoMIES/CzkhCcSsrHFJ9LX/JyT5AxMedV2CmbIQA=; b=dGtPHJitLGGW3BYLmGbYVVx48RteB0zcp/hv1Kayzkh3bsnpvXsBWc/fL8UB9Vhhbo iDeJL3paIN5amHHnS2nlfqNvUu9AErsAQN/sX01n3wRHPjIHKARPS+41wfL5+kNYBX1n WXSxeYwt7Nra/w7gAxvjIElvmMA2kKViifb0qthYci2hTCoQyAr39CAZVhoUSGHazgUz NARDZ6odaRzSV65npTnkayNZ8hmG+GVcB8ZRkPEzAfcjENH+rYLTxA8clgwrT61kI9pu KVkTZQFxEKziFJnXTW9ZqA0Lfb8KSoq+bukZ9wgMO2AmB7apli6ggh01jirkN/mOrnYX ML+w== X-Forwarded-Encrypted: i=1; AFNElJ88ufwHNk6VKJdrKqyUFHalpmHrkAN8hyL0MSUrxgL6itpQXB9XAo9smiuSm3XXIINh/lYUM+ogTic3xz0=@vger.kernel.org X-Gm-Message-State: AOJu0YwGHRjfBUbX2q2knUTR6D1O1X1kOMvWQIhraPq0A0A21wdpUXXv 9+pV1clITfIzlzufGfCmxCOanrYjO4FmdcC75GJTljPz3OtbxC58i2wYphMdCjrwew24l05yO2g Jwlfbn02B5hQv2IVexXGigX3P+mYlZ5bNiHKOE+VFmyRLZVtCu3yA0PjfoVjxFDsKWXM= X-Gm-Gg: AfdE7cmVyDwkewswRgONqe1PlWX/twPW/KoozSoRMVw6+QxEi8ZCDqCn2whRzXdIn4h GjSJWkbJ3z9MqKqrpWT/4HvQmI3xbQzC7gjxWlwEHXz2Wn5u6SGZir72U0yvEJBQK2VSG4gXXUg o3XaEn84MQDDdndijzKfXoD7up8fFWPcNWwbKssDDxqn6Iy8vxI4HGSfFfO4IScfK9XQFtUSA7J bpJE/cEcUjh1pWh6UFMARZhKKaqG+7OE4vlw+Nu7Nbq5v0AeWvjEGDcc0x+kgfYV+ksKo1liJfg EizpWV3Bv1d1FbzFs9Dl3VOlitZxuJuj30zXARX+rDGiGOHnoIbCoP1faqxHw0fuRZqrsnkLCdR XWVTf4mTPKnSSQX6b11VbIx5HnhUa+Q7+YW2jyg== X-Received: by 2002:a05:6a00:1408:b0:842:5b1e:5908 with SMTP id d2e1a72fcca58-84562535544mr19225477b3a.25.1782217270036; Tue, 23 Jun 2026 05:21:10 -0700 (PDT) X-Received: by 2002:a05:6a00:1408:b0:842:5b1e:5908 with SMTP id d2e1a72fcca58-84562535544mr19225423b3a.25.1782217269487; Tue, 23 Jun 2026 05:21:09 -0700 (PDT) Received: from hu-mojha-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84564e74646sm10171856b3a.29.2026.06.23.05.21.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jun 2026 05:21:09 -0700 (PDT) From: Mukesh Ojha To: Rob Clark , Will Deacon , "Joerg Roedel (AMD)" Cc: Robin Murphy , iommu@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mukesh Ojha Subject: [PATCH 3/8] iommu/qcom: Check pm_runtime_resume_and_get() return in probe Date: Tue, 23 Jun 2026 17:50:29 +0530 Message-ID: <20260623122034.1166295-4-mukesh.ojha@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260623122034.1166295-1-mukesh.ojha@oss.qualcomm.com> References: <20260623122034.1166295-1-mukesh.ojha@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjIzMDEwMSBTYWx0ZWRfXzgZb9I8acF6h GC8XPPpGrOAf9MkYGUyIhZV11k/R28rxmn0Y9flK4DnjozMAQCmDt2Ytj1HJknpZ2p0/IZFlnW9 A4x/wkvl2jx3pprm/dxxmEYgQ1f0+Ir3ii7df1umUBlN9hEPZJxDMG3EvKO+PdMRjikMZHayqi0 mMXQou5FBKUfULRsS/RWiEajI1KluVVbQ8apSlQpgrC2PnclJEkKlamHy742q36bpdJhO9XkHBw PYrKrfFnX5gRkhldSi/MMDNmwbAKPRNxoNVDIimlFzmTNsu+HUhUfh9VlaSLuUVV1nSS1n65auo okMby6GF/OCE0ACTiT58OckdIW9RbhHXyKyJ8D9AAyCrJ9+R1O4c5K+YTrQma6mPyvn3HnKqYJb tyf867D1Uh+Ee54GGsBELU4ICAq6rT03FP6JGKUv3oZSMsKxzOzNVSYzsQZQ4i1Xytcpqx7NqpW DTpMRCijsQDXHF55WKQ== X-Proofpoint-GUID: 5Pv-FYM2442SVG7jtQn9cQ6tj1QyEjua X-Authority-Analysis: v=2.4 cv=SoKgLvO0 c=1 sm=1 tr=0 ts=6a3a7a38 cx=c_pps a=m5Vt/hrsBiPMCU0y4gIsQw==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=uh9JkKNIBQsmCcNjqRkA:9 a=IoOABgeZipijB_acs4fv:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNjIzMDEwMSBTYWx0ZWRfXyvIRrX+hZ0tg 2yzOGdT8IjJTpBClQynxUSFuH8X2EL5rMjPKm/IKFHcG0hG/Xgbsaeg6PqZtNc9nIacFCPYVf1a 2ajp0cKN96b7FcA3kovuKeUDNl64imc= X-Proofpoint-ORIG-GUID: 5Pv-FYM2442SVG7jtQn9cQ6tj1QyEjua X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-23_03,2026-06-23_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 spamscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 clxscore=1015 adultscore=0 phishscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606230101 The SMMU_INTR_SEL_NS register write in qcom_iommu_device_probe() uses pm_runtime_get_sync() without checking the return value. If runtime resume fails the subsequent writel_relaxed() would access hardware with clocks potentially disabled. Switch to pm_runtime_resume_and_get() which handles the usage-count cleanup on failure, check the return value, and unwind the already registered iommu device on error. Signed-off-by: Mukesh Ojha --- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c index cb43276f4a39..4e714a8e1fac 100644 --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c @@ -859,13 +859,17 @@ static int qcom_iommu_device_probe(struct platform_device *pdev) } if (qcom_iommu->local_base) { - pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); + if (ret) + goto err_iommu_unregister; writel_relaxed(0xffffffff, qcom_iommu->local_base + SMMU_INTR_SEL_NS); pm_runtime_put_sync(dev); } return 0; +err_iommu_unregister: + iommu_device_unregister(&qcom_iommu->iommu); err_sysfs_remove: iommu_device_sysfs_remove(&qcom_iommu->iommu); err_pm_disable: -- 2.53.0