Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1172711rdb; Mon, 19 Feb 2024 06:38:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUMPPcI/FWoMNIPFxtLiAvGjSj5HewfJY0reRQSs0ceFJIIrehMDFrz8SsBkj8BTK/6c9DOmv6u4/R7BpLooV1cvMUkZMseObfSQvK6Gw== X-Google-Smtp-Source: AGHT+IHayS4m8oAfjD92VKzt5b9b8F5M1Fi8Eii1PEUG+AzmTXVVXQcJNHwZnYpY1KOEXMkDdsVV X-Received: by 2002:a17:90a:f28e:b0:299:4a63:9e50 with SMTP id fs14-20020a17090af28e00b002994a639e50mr5517152pjb.14.1708353526437; Mon, 19 Feb 2024 06:38:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708353526; cv=pass; d=google.com; s=arc-20160816; b=UL8yqnJy/p/MU+8Z+oftZ/Pnnu2RJZp+rweeYyPBfugquGREvY/eGXZ39CbrGPOOjR sv72ygfALRu0+OaPm4lg4q782KytSqjlrnhkauWV56379I5KZZWISKBkF9Q4js/sQCnU Rs1eh1+lWeeRqGFLpx4zmdewqjMdsg9zO6eRRdjYNXuFrtfOnsQ30DdxM2xqDjM9P9c5 kugY/GrBlbXXfydodog5qHl9RckBGu5MPBrt+AaMiLP98CG9ptn//50TnYitpBKa4wk6 NoFxNtOIn7Du13oK++/vVm7n/+MeAZO2i/W7ClxkibRFeblYnKPwzfwqFJrteQseVbmk SqAA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:to:cc:subject:from:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=ho99GpsLlVyNLlIgL8EaDAIa0KDiU9hFswI4+siTcPE=; fh=VxiA6NlNkYG7yRJR7zgUocvd5D+8Kt6BSDV3aFo6BHE=; b=pL1UvSflDc/UtAlIrz0wnT/98Q7qWOReB6hwscmSrKbb72VdDJcn9CvyNvFSVzEpFJ oa40Fhukp3T9IFvqyJEk7Ei9oxvPCKkQh6LyiO49gQLW491FdLf2hq+TNxKLVxR4wbvx UIo6TAKJg8XrnuHKywLP7hNjsO+/XhbzgG22anpI4S/aPPegAZ+RxIX/klxSqDg4+nxX uE7Okzf3T56SZ2CkNvPrdkCwfNQ64tf4EuqAlRiGULZX86VHQXAE3IdXMOcG0yahkgep b0Q+ropDk82Jt2uIjjQ1dKJkdtzkuRBzIX0a3J16kA/zXPqmVpJjBSMzrcoEgD4bwsMQ Ehsw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=OUDi4Zxa; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-71490-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71490-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id nu11-20020a17090b1b0b00b002993e504be9si3151670pjb.183.2024.02.19.06.38.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 06:38:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71490-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=OUDi4Zxa; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-71490-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71490-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 260612828BB for ; Mon, 19 Feb 2024 14:38:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 847E41EA71; Mon, 19 Feb 2024 14:38:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="OUDi4Zxa" Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (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 7E0DF1DDF5; Mon, 19 Feb 2024 14:38:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708353516; cv=none; b=Ik4+S8qJW51ge5YpTHzMGacxC5ho84OXaJ6U3ezfS9F9xbziEIXK17Udf7wjfyFfY44geTZo6HXRK2KJxwYJ6CT/J6JnVoEHNcU/EMRrXoAPr0qucUeatxORrt6mDKp/Mzm+PEg5kLKC9FLFJAZ6BeVrlHhkpfO+91oWFGL2ktE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708353516; c=relaxed/simple; bh=ho99GpsLlVyNLlIgL8EaDAIa0KDiU9hFswI4+siTcPE=; h=Mime-Version:Content-Type:Date:Message-Id:From:Subject:Cc:To: References:In-Reply-To; b=t/ZmuMAcyLDeqpVz4gOBXI/kmTTgYdEUNbx2n3PWOSJwqM1QbwgqnZF1TvIGznma/ggDzBXGE26puTJzZ20H/FIoNpVaoAvON2p9h+bSZvbViMNzJtpaP7kFdMpseDO8vjoUN9TSdY/jjPxzdDHM7N6AqIS+qAU8yVDWXl8BPTU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=OUDi4Zxa; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id EE72D40005; Mon, 19 Feb 2024 14:38:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708353512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ho99GpsLlVyNLlIgL8EaDAIa0KDiU9hFswI4+siTcPE=; b=OUDi4ZxaIhTt1u8DggtUyFiE7laXFp1LMYDlweFfiFHd0tfpYX7mHqH7Hrn759Ms4+WFcl 1I28IJOXMLeugQrQlIEoUrsZrW/PCQBQszp3kgxN5Zi5YrsJKSjfKVQ4TyLgNHN8IAqkB5 h8x/sFG6VWbSvAPfIhaZNHoYOB4KnJdgggHtqDmUCclr/aZLxgp7rey+wH2pz3F18YSHYm pc1h9QelXEzlsmK8avvDC2KR4hb12hBMtI5dXKXC6Jnwt+MZZCdMLcb0NTdGkKqfXnOSxV /iB1kete3Nj+MxB2XboCloOKyq+EzCl9C9p1onama0jCU/A9mQLU03LBiuIS2g== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 19 Feb 2024 15:38:31 +0100 Message-Id: From: =?utf-8?q?Th=C3=A9o_Lebrun?= Subject: Re: [PATCH 08/13] i2c: nomadik: replace jiffies by ktime for FIFO flushing timeout Cc: "Andi Shyti" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "Thomas Bogendoerfer" , , , , , , "Gregory Clement" , "Vladimir Kondratiev" , "Thomas Petazzoni" , "Tawfik Bayouk" To: "Linus Walleij" X-Mailer: aerc 0.15.2 References: <20240215-mbly-i2c-v1-0-19a336e91dca@bootlin.com> <20240215-mbly-i2c-v1-8-19a336e91dca@bootlin.com> In-Reply-To: X-GND-Sasl: theo.lebrun@bootlin.com Hello, On Mon Feb 19, 2024 at 3:21 PM CET, Linus Walleij wrote: > On Thu, Feb 15, 2024 at 5:52=E2=80=AFPM Th=C3=A9o Lebrun wrote: > > > The FIFO flush function uses a jiffies amount to detect timeouts as the > > flushing is async. Replace with ktime to get more accurate precision > > and support short timeouts. > > > > Signed-off-by: Th=C3=A9o Lebrun > > Excellent patch. Thanks. > Reviewed-by: Linus Walleij Somewhat related to this patch: while writing it, I noticed the total timeout of flush_i2c_fifo() is 10 times the timeout. Without this series, this means 10*200ms of busywaiting! If you have an opinion on a more sensible option for this I could add a patch to my V2. I don't know enough to pick a sensible value. I'm unsure if it makes sense that the timeout of flush_i2c_fifo() is a multiple of the transfer timeout. Does it make sense that those two timeouts are correlated? Big thanks for your review, -- Th=C3=A9o Lebrun, Bootlin Embedded Linux and Kernel engineering https://bootlin.com