From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx-relay47-hz3.antispameurope.com (mx-relay47-hz3.antispameurope.com [94.100.134.236]) (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 EF8A32DD5EB for ; Thu, 9 Oct 2025 13:27:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=94.100.134.236 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760016428; cv=pass; b=bBBnHsJvOj5HfwJIXJMY/Qg2FdU/nczVyxedpvd/gfMlEsMGXdqpoWfeYRLU/rUNfU22eyhvPDF8q1ESiaAkCP5TWLsNF3+sfn0tmLkpc7GL5tOV/WjTo8jtWTz4UzCcUjWP7goqh22gwUOoIfheopFq6Zis+ZIuq7FSjjyiJFI= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760016428; c=relaxed/simple; bh=EIeuNxi3tMWtVhd9APaLWB4XRSDsxAjUbTJq3XQbabw=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=ijO7gxaLWtv7GIZAK2nF8PyN2VP4oGMym/hdKr5YuJkTk/2mrvgHt+rVGUNWTpigUOuwKcGiQMC+J8avcK8gvqDBTjyW++Ss5qj1Qkuaeh3gwAB4YCd0r0TrtXiSvu+MEVRx7VDtYfcjaTed+sumhNIZ21BbVAeWVX/fQbxy3CY= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=h8pjj+mJ; arc=pass smtp.client-ip=94.100.134.236 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b="h8pjj+mJ" ARC-Authentication-Results: i=1; mx-gate47-hz3.hornetsecurity.com 1; spf=pass reason=mailfrom (ip=94.100.132.6, headerfrom=ew.tq-group.com) smtp.mailfrom=ew.tq-group.com smtp.helo=smtp-out01-hz1.hornetsecurity.com; dmarc=pass header.from=ew.tq-group.com orig.disposition=pass ARC-Message-Signature: a=rsa-sha256; bh=lyApDgL3svuRvTgcJBmdXkxs0NmIcK3pBr470hQHp5s=; c=relaxed/relaxed; d=hornetsecurity.com; h=from:to:date:subject:mime-version:; i=1; s=hse1; t=1760016385; b=XDqHJYoCDdveCBYZ9BPlCWymgP4626+qpHlYGxPoHTd9day/VlKp2wO69yexfVWy/eeZrEG4 rx+zcfykAwy3wPxEiEZ4hU+ZtTXgYoZWw2Q9BM+rZBtwBkm8A6E6lhewFultU20wuyyOo6hBG7+ VvMe9P6mghq/4S61QVIz8H4I7jy0slkJv4buu9vjynnCiTUAG/gQCv/+97dxnmjzT2U0G0SjUMK jfwoSd+bPqXOo9upfKRGgzSFSRpmUnVcZTJpvmrOc4r+bHwfflk4P0QRBEEZrL02f+KtWHC6aM7 JmNikYT16o5WobqVXTeaJKlVOeDsFRdaXTCxhNJj9vpEw== ARC-Seal: a=rsa-sha256; cv=none; d=hornetsecurity.com; i=1; s=hse1; t=1760016385; b=O2i/Hq5aCtrIU5+YBi+yM/ltvVULg4ef43TNUPO5C9dcusbg87qee+8AepMG/QBAG6z4Knco 4Jv34QDRr7C0kCDKfbtZqNfNPkAPbwJGyXUQeIXexe3QimG8+tpCM+saPaaCcfmvdHUSF1PXHRO OkOmgarzfRGNRqxMWNS4e9PXCX/HKetNoGygXCyyNlWT9XOAcOsG+b3HkcOyw2Sk2kt2JnZb+yS qtQO6F2k9/GO0yntM9F1zx2Kjhf6vdGqAqhxmltHufzr4XVJORPvvzthshGW/0PNlyIWb80AkBO b2W2rY/P6Kw25iaem/pjNCHMg/iuDfnwVHxXbq/Ae4oqg== Received: from he-nlb01-hz1.hornetsecurity.com ([94.100.132.6]) by mx-relay47-hz3.antispameurope.com; Thu, 09 Oct 2025 15:26:25 +0200 Received: from [192.168.153.128] (host-82-135-125-110.customer.m-online.net [82.135.125.110]) (Authenticated sender: matthias.schiffer@ew.tq-group.com) by smtp-out01-hz1.hornetsecurity.com (Postfix) with ESMTPSA id DCA48A41242; Thu, 9 Oct 2025 15:26:12 +0200 (CEST) Message-ID: Subject: Re: [PATCH v2 1/2] i2c: ocores: increase poll timeout to total transfer timeout From: Matthias Schiffer To: Andrew Lunn Cc: Peter Korsgaard , Andi Shyti , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux@ew.tq-group.com Date: Thu, 09 Oct 2025 15:26:12 +0200 In-Reply-To: <60744be2-1a22-4056-bf05-22f64fb8b484@lunn.ch> References: <51a72ceca0154d7be85c3cc67722e7dd0b364a2e.1760000254.git.matthias.schiffer@ew.tq-group.com> <60744be2-1a22-4056-bf05-22f64fb8b484@lunn.ch> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.3-0ubuntu1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-cloud-security-sender:matthias.schiffer@ew.tq-group.com X-cloud-security-recipient:linux-kernel@vger.kernel.org X-cloud-security-crypt: load encryption module X-cloud-security-Mailarchiv: E-Mail archived for: matthias.schiffer@ew.tq-group.com X-cloud-security-Mailarchivtype:outbound X-cloud-security-Virusscan:CLEAN X-cloud-security-disclaimer: This E-Mail was scanned by E-Mailservice on mx-relay47-hz3.antispameurope.com with 4cj9cj3JZ1z4MZvs X-cloud-security-connect: he-nlb01-hz1.hornetsecurity.com[94.100.132.6], TLS=1, IP=94.100.132.6 X-cloud-security-Digest:012c56644705e961c763b0351ba63189 X-cloud-security:scantime:2.683 DKIM-Signature: a=rsa-sha256; bh=lyApDgL3svuRvTgcJBmdXkxs0NmIcK3pBr470hQHp5s=; c=relaxed/relaxed; d=ew.tq-group.com; h=content-type:mime-version:subject:from:to:message-id:date; s=hse1; t=1760016385; v=1; b=h8pjj+mJ81QGldRwNsTTLyM9DOcrTMi6vMG/53lOZ1Nsbv0+7js+jZjjoI51655YS40mUPK6 yiqjCRTXrdPtz56VhXB8je7YNYsXcXR9tFAG8TfwgY+ECI3pirtsRH2DfypKpB4EqcBxBZrrpUl SaEN2zqcBqc99+8wGLR9BxBLiP7cO8Nvn9di4WMSNa6K7E6VqpJHlfl3Pzwvh/oNGuaLKC2K2nD VFyRViOautjyDeigNlEvs1oOcM5o5YS5yJTB1lnSI+W6kykUpYWpoL4GBAAFjDATw+w1oMBxQ0R Iz15v9weZYBllcR2ub5Zaz/9BzwDPXCAPs42kkpGm4j4w== On Thu, 2025-10-09 at 15:20 +0200, Andrew Lunn wrote: > On Thu, Oct 09, 2025 at 11:19:49AM +0200, Matthias Schiffer wrote: > > When a target makes use of clock stretching, a timeout of 1ms may not b= e > > enough. One extreme example is the NXP PTN3460 eDP to LVDS bridge, whic= h > > takes ~320ms to send its ACK after a flash command has been > > submitted. > >=20 > > The behavior in the regular case is unchanged, spinning for up to 1ms, > > but the open-coded poll loop is replaced with read_poll_timeout_atomic(= ) > > as suggested by Andrew Lunn. In cases where 1ms is not sufficient, > > read_poll_timeout() is used, allowing a total transfer time up to the > > timeout set in struct i2c_adapter (defaulting to 1s, configurable throu= gh > > the I2C_TIMEOUT ioctl). >=20 > Thanks >=20 > Did you test with CONFIG_DEBUG_ATOMIC_SLEEP enabled? I don't think it > is an issue, but the old code could be used in atomic context because > it never slept. I did not, but there is only one call chain ocores_xfer_core -> ocores_process_polling -> ocores_poll_wait -> ocores_wait, which is definit= ely not used in atomic context (in IRQ mode, ocores_xfer_core calls wait_event_timeout, which might_sleep()). Best, Matthias >=20 > Reviewed-by: Andrew Lunn >=20 > Andrew --=20 TQ-Systems GmbH | M=C3=BChlstra=C3=9Fe 2, Gut Delling | 82229 Seefeld, Germ= any Amtsgericht M=C3=BCnchen, HRB 105018 Gesch=C3=A4ftsf=C3=BChrer: Detlef Schneider, R=C3=BCdiger Stahl, Stefan Sch= neider https://www.tq-group.com/