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 7CF52435EC4; Thu, 9 Jul 2026 13:47:17 +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=1783604839; cv=none; b=jaWBARqkWxE3920Wh/yH7Bm7aHJCmw/mSRpWHA85QHhlNw1ukYEOJIXnxtSrgAo+n1Ob/deqg9qLV6J6BlAXBownd56IuC6T36Bapf06aCaCM+0El9Czeml6r6NZ6Rj3+I3hbLS6rZfDoTEHWppd7p/+88H1vnZgIgHiv5sYJyY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783604839; c=relaxed/simple; bh=b5G3pq824rgDgJIxheSg/ZmnsBpdN5VzSalk6Zg6l1o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PoXXd1ZgogxTo28glTPFOubo6Kh2eWz/5uHrJ45uhQ9xaDxtnbBozSNR0q43jkIPA4/QHNo8LgjMHxe/7rROZMj5PDK+3Q4vNcsECemaoD5HmdUawDkwxfn3brcITCUd3ORJV4I197W9oSi+D3L9n3Ctr1QJ8oQH5DKS4q0HCis= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=dTIJ5mRW; 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=qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="dTIJ5mRW" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 669BNVnh1575751; Thu, 9 Jul 2026 13:47:11 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=kf2+xmIFZM5 pDRquKAFQ9+RwzhakCT7kPK0IXGe+uPY=; b=dTIJ5mRWxv7z+vaNTa1ryG/gtIK ZmDaU0QdccMxyxvsU/Qv+BZKXT6KDLyG9vTqeavpbsemOdZT9cZOCzE0y12RMKHD XnO/gOCdfeeGtG45oD51nT8fnUtTkTA2WdjUQ5GOA67l6zcXpzhiY2LdryDlJd1K QkPdiTBnN8GKg9hVKEDWKyWj3jrHRxqzjycd1X50VX95NTsWe5tppegId/ZL5TJk SM6gcHRS79qjCDnWr1ds10wy/CL3xroKFmUbtR2Pg1R5y+psAzxEzi91p5b8gzdf e/jPNY8CSUzZwmm38nC6bkoHanW3lPKfC+30sLKCZUUXZPeWwFer6R6yX7Q== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f9sqwcgu5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Jul 2026 13:47:11 +0000 (GMT) Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.18.1.7/8.18.1.7) with ESMTP id 669Dl7wg013912; Thu, 9 Jul 2026 13:47:08 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 4f6u8kn9k2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Jul 2026 13:47:07 +0000 (GMT) Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.1.12) with ESMTP id 669Dl7RL013906; Thu, 9 Jul 2026 13:47:07 GMT Received: from hu-devc-hyd-u24-a.qualcomm.com (hu-msavaliy-hyd.qualcomm.com [10.147.246.140]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 669Dl77h013903 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Jul 2026 13:47:07 +0000 (GMT) Received: by hu-devc-hyd-u24-a.qualcomm.com (Postfix, from userid 429934) id 323CE217C4; Thu, 9 Jul 2026 19:17:06 +0530 (+0530) From: Mukesh Kumar Savaliya To: Frank.Li@kernel.org, viken.dadhaniya@oss.qualcomm.com, andi.shyti@kernel.org, dmitry.baryshkov@oss.qualcomm.com, zhengxingda@iscas.ac.cn, kees@kernel.org, quic_jseerapu@quicinc.com, linux-arm-msm@vger.kernel.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org Cc: bjorn.andersson@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, Mukesh Kumar Savaliya , Aniket Randive Subject: [PATCH v7 1/2] i2c: qcom-geni: Handle runtime PM disabled state during early resume Date: Thu, 9 Jul 2026 19:16:22 +0530 Message-ID: <20260709134623.1724212-2-mukesh.savaliya@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260709134623.1724212-1-mukesh.savaliya@oss.qualcomm.com> References: <20260709134623.1724212-1-mukesh.savaliya@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-QCInternal: smtphost X-QCIntern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BRt/0= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-09_02,2026-07-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 bulkscore=0 phishscore=0 clxscore=1015 impostorscore=0 spamscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607090135 During the noirq resume phase, the GENI I2C controller may receive transfer requests before runtime PM has been fully restored. In this window pm_runtime_get_sync() can return -EACCES, causing transfers to fail even though the controller is in the process of resuming. Treat -EACCES as a transient condition and allow the transfer path to proceed while preserving existing error handling for other runtime PM failures. Also enable runtime PM in the resume_noirq callback when it remains disabled and allow the controller interrupt to remain active across system suspend/resume transitions by requesting it with IRQF_NO_SUSPEND and IRQF_EARLY_RESUME. These changes prevent spurious transfer failures during early resume and allow the adapter to become operational before the normal resume phase completes. Co-developed-by: Viken Dadhaniya Signed-off-by: Viken Dadhaniya Signed-off-by: Mukesh Kumar Savaliya Acked-by: Aniket Randive --- drivers/i2c/busses/i2c-qcom-geni.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c index 96dbf04138be..4bc00922cd97 100644 --- a/drivers/i2c/busses/i2c-qcom-geni.c +++ b/drivers/i2c/busses/i2c-qcom-geni.c @@ -917,6 +917,10 @@ static int geni_i2c_xfer(struct i2c_adapter *adap, gi2c->err = 0; reinit_completion(&gi2c->done); ret = pm_runtime_get_sync(gi2c->se.dev); + if (ret == -EACCES) { + dev_warn(gi2c->se.dev, "Runtime PM is disabled:%d\n", ret); + ret = 0; + } if (ret < 0) { dev_err(gi2c->se.dev, "error turning SE resources:%d\n", ret); pm_runtime_put_noidle(gi2c->se.dev); @@ -1115,7 +1119,8 @@ static int geni_i2c_probe(struct platform_device *pdev) return ret; /* Keep interrupts disabled initially to allow for low-power modes */ - ret = devm_request_irq(dev, gi2c->irq, geni_i2c_irq, IRQF_NO_AUTOEN, + ret = devm_request_irq(dev, gi2c->irq, geni_i2c_irq, + IRQF_NO_AUTOEN | IRQF_NO_SUSPEND | IRQF_EARLY_RESUME, dev_name(dev), gi2c); if (ret) return dev_err_probe(dev, ret, @@ -1223,7 +1228,12 @@ static int __maybe_unused geni_i2c_resume_noirq(struct device *dev) if (ret) return ret; + /* Enforced disable_depth = 0 to actually enable runtime PM during noirq phase */ + if (!pm_runtime_enabled(dev)) + pm_runtime_enable(dev); + i2c_mark_adapter_resumed(&gi2c->adap); + return 0; } -- 2.43.0