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 D29593B27EE for ; Thu, 21 May 2026 11:14:43 +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=1779362085; cv=none; b=NFU7Svdf31ZN+svSqASdHIkeljWGfNnkyzYncXt/qrj3QTouItRFgxptUZEiTcQSrgGmkmwlNjEtgyBdadO2Fw15riSqJEJ4vbJt1Pfcqz6jB9NrffbDp/KrcNcFob4IheCTr92d24FlE5uZDAwmyxpNkyfuFqLOCn/8ad5HHP8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779362085; c=relaxed/simple; bh=C1+cFaPFiKE4mgAzSG1N6mY7diKK/o7fD03Nl3zE8aE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=QHblwm53vHAfoP6O3Wbwc6QOIttHKow1YC9zQOuduwZjYEiiX9EqqdHWufjRT/L5FA4gsgPNhW+jY9aaiv5KmEgukBgDFLUcrpHjy99tDvPQVR8xFzAEX3wwQHqUSGaOc5hyfzo0iU+h0o4ljL5T61V8b5Ckrr6gwsUM5uF1MmQ= 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=hTwfCwhl; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=UcpNLLoW; 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="hTwfCwhl"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="UcpNLLoW" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64L99nZ73451416 for ; Thu, 21 May 2026 11:14:42 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= Tgpvgnbwwr5UBe0lC1Mf4Vi2XM398nJ8kTHxTpFW4hU=; b=hTwfCwhl2SgL0Wi+ /3yR49gIx/qT/qSo6EoxcIIlIv57BYlUishzWRZF2eeSUFTQ9ednQUI2SNub7Rip T8y3d+dzx811r0WU9fctsd+AMTU6lzMGur06QgZqwn9tqzM5iyx5FqAdg0nsSZSP MhCdyhaFj70KCut7YTkKuPahd09yU2wfkVBOhvyu6bqRja7ONA+/xoNqjFOSEtfJ K4ouj469BhQnYqSu2rmV298PfAp1TjXDDgrCvGvDQKq0V0NspZk0NE9hHm/tXDUh xSRLSb4NyGz6lwHIruHnMlxeHLptvtK3vsC3JUuUJl9uGvlqRQmCbVet4hTmMUD3 FvhBPA== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4e9y1h8hxe-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 21 May 2026 11:14:42 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-3663cbff31cso14791614a91.2 for ; Thu, 21 May 2026 04:14:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1779362082; x=1779966882; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Tgpvgnbwwr5UBe0lC1Mf4Vi2XM398nJ8kTHxTpFW4hU=; b=UcpNLLoWCZJLP0hPxWaEw04BjdJAY+2rPWVvqoIxpdikZeRgDjE8BUg3R49eB8BylQ m+5TbkXnXXlRM8WFe1BlvuARSXnKEVcNwU4adWm5df5LJuolY0OZAcIToPamdOpJJupL KQi3dsYHO52/rrBW/XhLc2GZIZzreRV1C+tb2O6BQfqObZbH8z3MaYAzik1oBE9IRcTN NwFPxYxBKb3V7Zb3KwcrjgXfH2U4F+FiQtIFsZWqrtKCg3LiIeSx6PWtUXC5G0KQvm88 O1y7gv+c5/C9uEXBQIPAj19EmSts0KZp5dDV6Hg380I4CYg0OU3BA92aYYNckcNSzp7L wyfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779362082; x=1779966882; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Tgpvgnbwwr5UBe0lC1Mf4Vi2XM398nJ8kTHxTpFW4hU=; b=SJK/v+0FZy+CnDxUlV56FQEHCuVyE6LwC8ODHxeh0VsvO2kJyUrzu6JtkaBOtLvrO+ UEInvcpP/IL6KkvJ78av69eHd1VGyGrsdv31IWtXkj6ph4hhDm40e9iRfJvB1tnkS2zv kURiA+DBU8eM1akDXZsnXMIMoSr2O8GqYNWGPrAdtdXscHPzCDI2mcF7NzdHYVkeBhkk A33Qxzzd9FUZiLgldTTl9d3M5RwVudVqbXKTRoHLPlcBzxX8heJ6Faa2q+hgqU4A3MPe /nFzaqfLqEe6q78jzDLXRymG8lNfPaJTn2gQgcSR2BbER3LggAjkkxX19z1zexFpOjkb QtIQ== X-Forwarded-Encrypted: i=1; AFNElJ/DkBr2xE8IVuwSqwgrq8NL3UPrmy4TmXqfPas2Xo5Vc5XN+lDKvXgc3p93OAKsTmu0q3W97DkFvQKORro=@vger.kernel.org X-Gm-Message-State: AOJu0YzLpwUkOwfLtEVHDfeKfwY75d2fxHISWrW4gbMfNxmH7GG0/lmO 99crZHVpfGNQrfXm8B8wWkuMT9z/CVLk+UKqaSeIBgtHjaJX3dE79JOb78fzKa9WWVp3l3i9g+p kryVtnTj+tg47wyIy1bq93TM/cydm7Yja/qH4f0FxN5t0/JtKrG9urqNjt95jE4VEoeA= X-Gm-Gg: Acq92OEoOCLI0PB6OgmkxxuFsFCz4Ba2HPB2wi6KnHl8oTh44W8IPXwms5RGvAAhHyz CI8Tn5CtnfxGlv3e1HoHJLdD/3YpZHIfHvNlaoCKS01q4xzjJVzGOaAx6aI4FvbKWw8jfAkjwzC 4zW7oCe+LCMHuFudimvTCQBSjfCxgZ6alnl9pmTy1ymqxFuYZM5Vhbs91bgdOQyhPGE6LAU6bbN /wz/8jdCot746B7W18xK425MnzmEi5tF1kI6smcAmySPZAPVEIQhjNni7b33Ny7uYI1N9amimjb KXPKnzE4i2TZL6JWaim4jbloNUxBSAgmxyIilDo/50fve2E+nxWHoYTXmEzSwXzBMoRVYcZdvsy 7svTOSxcFjRCPKMGSLbawg+9cWhTnJL8zLddVTH5vQdciECoXAVJkmXvu X-Received: by 2002:a17:90b:514b:b0:369:d22:4788 with SMTP id 98e67ed59e1d1-36a4575d7bemr2644428a91.25.1779362081609; Thu, 21 May 2026 04:14:41 -0700 (PDT) X-Received: by 2002:a17:90b:514b:b0:369:d22:4788 with SMTP id 98e67ed59e1d1-36a4575d7bemr2644391a91.25.1779362081192; Thu, 21 May 2026 04:14:41 -0700 (PDT) Received: from [10.217.219.207] ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36a5ae97051sm536922a91.0.2026.05.21.04.14.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 May 2026 04:14:40 -0700 (PDT) Message-ID: Date: Thu, 21 May 2026 16:44:27 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] i2c: imx: mark I2C adapter when hardware is powered down To: "Carlos Song (OSS)" , Mukesh Savaliya , "o.rempel@pengutronix.de" , "kernel@pengutronix.de" , "andi.shyti@kernel.org" , Frank Li , "s.hauer@pengutronix.de" , "festevam@gmail.com" , Carlos Song , Bough Chen Cc: "linux-i2c@vger.kernel.org" , "imx@lists.linux.dev" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" References: <20260520101504.2885873-1-carlos.song@oss.nxp.com> <4979e748-ce4e-4244-8906-e22a1e6472e7@oss.qualcomm.com> <22af0378-a3c9-4403-a0ee-da794847f41d@oss.qualcomm.com> Content-Language: en-US From: Mukesh Savaliya In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: PtXiytxWbALSNy4joCCcog5iGR401rZH X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTIxMDExMiBTYWx0ZWRfX0tjkiuc+7XUC Rk5rrW8gQ3Szv2c5+a4+VxHISMXWv4Vh2ZnIF5Bp0RcXDYBXOBgav6664wBZD2NE8/Tq9ifm19V /hLDFiBwBVeJ1tORkBQ8R2MLIBsMfhFhy/vehPn82spgzWcn9GUvsOhe1TVpWciZ7eVfKFk0w+S 5AwRPvzgDCoKntU66Sa5Ci8kMNq8cJxCoLt85JheZzSuZQ5CvhhLk9aDRWt9OaxMEiw5k0nxlXb sONbJ/JazLjlyEiWLBb+xgdGoQX3KCec2uhcajC7aPaJSadWv/JlfztVBg8ocsyg8Bmwp3y1CA8 XmD8UxtG1Vqp1zQR8PP2PBDcZSw4nRyozGm56a/LTT2RjBw+xOb+boOkGfv3I4bNv25VP3csD4x NfLHo6ItGRjWREpU2WaKBqO4mh/e4o3SOh/Fy5oVfeumakkVkZdctb0MiCy/kkaohJkTOlAlCkT NxNrpIi+RCJe6w7SqEA== X-Authority-Analysis: v=2.4 cv=YfyNIQRf c=1 sm=1 tr=0 ts=6a0ee922 cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=8AirrxEcAAAA:8 a=VwQbUJbxAAAA:8 a=pGLkceISAAAA:8 a=JfrnYn6hAAAA:8 a=5_mVXZLGvQfHWcJsArQA:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 a=ST-jHhOKWsTCqRlWije3:22 a=1CNFftbPRP8L7MoqJWF3:22 X-Proofpoint-GUID: PtXiytxWbALSNy4joCCcog5iGR401rZH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-21_01,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 phishscore=0 lowpriorityscore=0 adultscore=0 suspectscore=0 clxscore=1015 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605210112 On 5/21/2026 4:21 PM, Carlos Song (OSS) wrote: [...] >>>> -----Original Message----- >>>> From: Mukesh Savaliya >>>> Sent: Thursday, May 21, 2026 3:40 PM >>>> To: Carlos Song (OSS) ; >>>> o.rempel@pengutronix.de; kernel@pengutronix.de; >>>> andi.shyti@kernel.org; Frank Li ; >>>> s.hauer@pengutronix.de; festevam@gmail.com; Carlos Song >>>> ; Bough Chen >>>> Cc: linux-i2c@vger.kernel.org; imx@lists.linux.dev; >>>> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; >>>> stable@vger.kernel.org >>>> Subject: Re: [PATCH v3] i2c: imx: mark I2C adapter when hardware is >>>> powered down >>>> >>>> Hi Carlos, >>>> >>>> On 5/20/2026 3:45 PM, Carlos Song (OSS) wrote: >>>>> From: Carlos Song >>>>> >>>>> Mark the I2C adapter as suspended during system suspend to block >>>>> further transfers, and resume it on system resume. This prevents >>>>> potential hangs when the hardware is powered down but clients still >>>>> attempt >>>> I2C transfers. >>>>> >> what was the reason of this hang ? I was thinking you don't have interrupts >> working when client requested transfer but adapter was suspended. Please >> correct me if wrong. >> >> And it would be good to mention the actual problem and why/how it occurred. >>>> Code changes looks fine to me but have comment on commit log. >>>> >>>> It seems, you are adding support of _noirq() callbacks to allow >>>> transfers during suspend/resume noirq phase of PM. >>>> >>>> Would it make sense if you can write "Replace system PM callbacks >>>> with noirq PM callbacks" OR "Allow transfers during _noirq phase of >>>> the PM ops" instead of "mark I2C adapter when hardware is powered >> down" ? >>>> >>> >>> Hi, >>> >>> Thank you for your comments! >>> >>> But this patch is added is not for support noirq PM callback or transfer in noirq >> phase. >>> >> Okay, may be actual problem description can help me. >>> In fact, this fix is to mark the I2C adapter as suspended during >>> system noirq suspend to block further transfers, and resume it on >>> system noirq resume. This is to prohibit I2C device calling the I2C >>> controller after the system noirq suspend and before noirq resume, because at >> this time the I2C instance is powered off or the clock is disabled ... So I want to >> keep current commit. How do you think? >> completely Makes sense. Please help add how this problem occurred and why ? >> So the change/fix will be good to understand against it. > > Hi, > > In some I.MX platform, some I2C devices will keep a work queue all time, the work queue will > trigger I2C xfer every once in a while, but the work queue shouldn't be free in system suspend. > work queue has transfers queued even if system is suspended ? IMO, the client i2c devices should not let system go to suspend. > Within a very short time window, possibly from noirq_suspend to the system actually being suspended, > or possibly from the system starting to resume to before noirq_resume, this work queue will trigger an > I2C transfer, and at this time the I2C controller's clk and pinctrl have not yet been restored, reading and Right, this kind of explains the problem to me. I think you are trying to serve i2c transfers when your resources(clk, pinctrl) are not turned ON and also interrupt remains disabled. And that's why you need to add _noir() PM callbacks supports along with IRQF_NO_SUSPEND | IRQF_EARLY_RESUME flags. > writing I2C registers causes the system to hang. This patch make all I2C operations are performed in a safe > hardware state. > > Is it better if I add these comment to patch commit log? >>> if my latest comments makes sense against the issue, you may write accordingly. if i am wrong, then your explanation makes sense. Cause of the hang needs to be clearly mention int the commit log in your next patch. >>> Carlos Song >> >