From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 6E41440097F for ; Fri, 24 Jul 2026 11:56:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784894174; cv=none; b=CneiND6pIWQ7kglW3HmQ97Ajumfik+oZ706O3DPmeRnqZVFmWXq06sEfxpkv1xDNniy3Sdho4aORaT5haJW5QnT9cCqfof03u5oBoDobwujh0ELpdjxYeldKMzdbm7ntjwfy8OabNlOsaVsCh4D7EYntFEU2WzT3aghGSi7u18Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784894174; c=relaxed/simple; bh=z9lFTn32Qc43wkSOIQTlmrTywIBYvKWuzcjZ7S38Z98=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=SUTKo5hMp9PhvSEmuIn5Aw0hylyJgiSUGhZG+QbQz+4wnseBYSWR/Ol1jjBzg7WK+5PFZzHgJkOPvlMI1O44Wamv0DvqR8i5GNBD7cOmMjpqYduwRimLXX7dR8ZNkg6AtCDKubON5Nq2s5uxHDnq+GANXvnzYKZogcfOVke6lvM= 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=XIysdfK3; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=HU/dxerR; arc=none smtp.client-ip=205.220.168.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="XIysdfK3"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="HU/dxerR" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66OAE4Vp2256610 for ; Fri, 24 Jul 2026 11:56:11 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= 4FZCLWX2ZlTuYRJjs7RINJ3Ro3/TskrzAG3MYdafhbU=; b=XIysdfK3kruzDMiB KljiOD6Lv5g2bJWfdDjv7P7wq2pRQFu8NgvpZNiDbeQlEjAkb8++Tw0BH0h9SziF YH6fmRRJZ41ZaWqrP6mZOEM2hb0J+EJ6VEnLZ8EXLo6kWRdgPIBFZ61jgXfpNLuX HQxjtv5QMiyeSGMj1td7TuAQGLRa0MWOqVVJdRX3/FANPvjJXeMp3rjku+G4cfkM fHf97TWcTl98XTw7srmLh2fdDF+A4hzQ444D5lhVM/GblZnpUMxoglcrRtbEak7G BLeOQQr2tvH+7aDe0fdFWDcYrXLD8lhs5XUrOx+JSYZ1g+KmanJcoI8wK4QgZI3l C/ORZw== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fkusrthku-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 24 Jul 2026 11:56:11 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2cf1c86963bso15291155ad.0 for ; Fri, 24 Jul 2026 04:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784894171; x=1785498971; darn=vger.kernel.org; h=content-transfer-encoding:content-type: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 :content-type; bh=4FZCLWX2ZlTuYRJjs7RINJ3Ro3/TskrzAG3MYdafhbU=; b=HU/dxerRVx440Tp7FGYDY2i+vmkr85ZVK8WbZtsDclb1VoJGd/l7JhkYkLxOcl+Non jyAAJNUlRyVuNFwAkpHwHKfyoNx/iFMS4nAWGkEfg+pnNWRYXQzhbq34CNS75sqPmj0P o1qD422dQ8KvM9y/k8TRRD89MO7v8de48Z1LQcTBkkJWSK0Nya8G1eQy5JJFDe9Iy/Wb /jYPZTXU9estAO2Sf8cdEGFHsBSI7zfDB40nysKoz/ap0gmCWu4priwP6qtUcB/gMl3p 9qlPMkTplUY6vcOAoEJywkbKKiwyOG6Nc6o3GeqbknGzz8xnDqN31wSoVq+NVBTyDBXy V/6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784894171; x=1785498971; h=content-transfer-encoding:content-type: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:content-type; bh=4FZCLWX2ZlTuYRJjs7RINJ3Ro3/TskrzAG3MYdafhbU=; b=bv6kybt5By9UhtIJepneKyo9njKVd67SvOE1xAMiM1F5g085GXOEYPNozdc5EzBOpP U8879zc4aRlVzJZEtOfsqcW4i7cXM4PxJzsaB/xAiSLhmDXl6/whlR5SrwceXp3xJpVC HIwnP2Jf3Xtj4fWfKH20PC4KalO42qvnutD2Ld7Q/cBDElxY7yiRwXMRu+uhXr23AS7w w8tgcl6Ws/Vahkicj6mTT6zOW46dTe/zdcLh2Zeo9eeiIckYwqW+S/HeQUeq6KWOZUP/ ZkC9wU4TSOOO5ZudnMM056JvmVOegtcoxZH6iXjrBpCuVCgtvtpkZfKpzo/gJ30fnQUq hlPQ== X-Forwarded-Encrypted: i=1; AHgh+RpYYticAt2XwMd6TE/ito0wkRBVMCNX21t74J7NaJpzj+YeXYMfaxy+xnLT/F04/mT3XD0JxW27aepPfD8=@vger.kernel.org X-Gm-Message-State: AOJu0YwFB3GGdO/rt7+4WaGi+IwibRbXHiyM7b7FoGoG08lUUf1NdlfC kXPIpVeSK9V76a/gE4aP/Hc/vT5eApHIkWlFlQJ/z0f9l2rOm0+mJNUdXDgvQZCQcyGxSetbIFX C+vLQ2m9UxC39s8/4CTXqdF6GkKuUEK0EvXV64+VOoSmNb9BmGxQA+vJseaXAQi9hcKY= X-Gm-Gg: AR+sD137IKWTxO81s335mCTQFA/HDQvAGzhiY4NHFDCsZ4w35+oOAhgTGVX+3hTnmSF viNjzqzpVFKqAp6vOs+ixpdwDWVTm/MTdAvXdduJqUhN0lt6lwFLVzpPliJVR3IW2b0y46MRKIg XyctTsZOA+0/DeaKziPPXeTKnUui9xntROU2PAOS5UYSVVRqEBEcEOtcvQDEF8WFVJWXGBo08sB peIOhGWnjMSdUdjOBxUUr9YXmEVn3lvpaKzK6Lg01fXx5QGAn1tGWP6LPIyk3SdBvcrWJC7ZfHU Olg+60WHm4zT/gvv+kx94l7hYiPBye73HSbvjPPA13sMcH3jC71kO+th6KyRu3ugIuM9bz/MyUs DErsd8NO0bEx1S3an/FpZJQ+UNQi2X4TF X-Received: by 2002:a17:902:e810:b0:2c0:d94f:50c7 with SMTP id d9443c01a7336-2cfd70df94amr2289345ad.7.1784894170666; Fri, 24 Jul 2026 04:56:10 -0700 (PDT) X-Received: by 2002:a17:902:e810:b0:2c0:d94f:50c7 with SMTP id d9443c01a7336-2cfd70df94amr2289115ad.7.1784894170214; Fri, 24 Jul 2026 04:56:10 -0700 (PDT) Received: from [10.217.218.21] ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf8efa38c1sm51344745ad.8.2026.07.24.04.56.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Jul 2026 04:56:09 -0700 (PDT) Message-ID: <23edc4b0-c5cc-4c54-91ed-a7bea945e680@oss.qualcomm.com> Date: Fri, 24 Jul 2026 17:26:06 +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 v6 0/2] i2c: Add dynamic transfer timeout based on message length and frequency To: Mukesh Savaliya , Andi Shyti , Viken Dadhaniya Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org References: <20260720-master-v6-0-671261b05c61@oss.qualcomm.com> Content-Language: en-US From: Aniket RANDIVE In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI0MDEwOCBTYWx0ZWRfX9BnbFxGnG9F3 7cFM2QqLZmlogM6bfYT5zAPIqnaxB0epkKH9hQRPJnSQMyWDq9bOVH20p72hoBp0IP078SjA/oi rd9uc9uWXHIcQ0SaxPZFKF17Ef/pvBw= X-Proofpoint-ORIG-GUID: _WO_Li6hlEldxBuT8cX-1um633r51bOY X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI0MDEwOCBTYWx0ZWRfX+8wsgchd568M bCin5hp3qREaB7r+fwOdPivFBPfdsqADOJWYgbIxA0+CU2DUAVGY5boqXO+Hv2O8OVC3u0TVmp4 0zQAtsd90/PcS9FKVFQa3L4H5ia5i0m7kfo6YmMjry1H5uM/afXMgPQ63KHeDHc7AQdDZM/ZGlg pLe2oKtW+1UW7ixSixo8PXIvq3VUzxlXX+O2SV9TNo3CoyTnZDnMdN5MgmBAgQdaqPChGFdacPe WKBFrUxMqj+KD4NtSiYCPX6Krmf5nieurxSztZpom0yvjRm7igQJEg2kataNEcwjg/CBNlaVVll 22bSsnjo7OQCU63PCc1fCEDdfsDJ9kIY5O8AGML0iwmTtfK3HGpzHXJF9+r5qgorm43OSWKHdBr s4pfVuhhJdQOqT0+dlPw8H9KhbDAWERtppYw1Jkp6tZr1O3csQBuaHM/GkFXlUleO1RrJOfTVEu nVOj7bvenIIY+FDtkVQ== X-Authority-Analysis: v=2.4 cv=PtejqQM3 c=1 sm=1 tr=0 ts=6a6352db cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=Y4WXMNEb7aBAyCZDk4MA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-GUID: _WO_Li6hlEldxBuT8cX-1um633r51bOY 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-24_02,2026-07-22_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 spamscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607240108 On 7/22/2026 10:55 AM, Mukesh Savaliya wrote: > > > On 7/20/2026 5:11 PM, Aniket Randive wrote: >> The I2C core and most controller drivers use a static 1-second timeout >> for all transfers regardless of message length or bus frequency.  This >> causes unnecessarily long delays on error paths for short transfers, and >> may be tight for very long transfers at low bus frequencies. >> > OR can be more than 1 sec for big transfer at low frequency. Hence > better to make it generic saying depends on data length and frequency > which you have mentioned. So limit it that. >> This series introduces a generic helper in i2c-core that computes a > generic helper function I will update the comment. Thanks, Aniket >> transfer-specific timeout and stores it in the standard adap->timeout >> field, making the dynamic value visible to the core retry loop in >> __i2c_transfer() as well as to the driver's own wait sites. >> >> The helper accepts a safety coefficient and a minimum floor as parameters > what's the policy to accept ? i think should explain here. > read from dtsi or hard coded ? Agreed. The policy is still being discussed (hard-coded vs driver-supplied vs DT based values). Once we converge on an approach with the other reviewers and maintainers, I'll update the commit message to reflect the final decision and rationale. Thanks, Aniket >> so each driver retains control over its own timing policy without those >> values becoming public API. >> >> The second patch converts the Qualcomm GENI I2C controller to use this >> helper.  The 10x safety margin over the theoretical wire time and the >> 300ms minimum floor (to budget for clock stretching) remain private to >> the qcom-geni driver. > geni i2c driver I will update the comment. Thanks, Aniket >> >> Changes in v6: >> - Split into two patches: core helper + driver consumer >> - Moved timeout calculation to i2c-core as i2c_update_timeout(), which >>    writes directly into adap->timeout so all consumers of that field >>    (including the __i2c_transfer() retry loop) benefit automatically > please Add suggested-by: dmitry guzman < > > Also add reviewer into to/cc list specifically. I will add the tag in next patch. Thanks, Aniket >> - Driver supplies safety coefficient and minimum floor as parameters, >>    keeping I2C_TIMEOUT_SAFETY_COEFFICIENT and I2C_TIMEOUT_MIN_USEC >>    internal to i2c-qcom-geni.c >> - Compute timeout once per batch in geni_i2c_xfer() using max message >>    length, all internal wait sites read adap->timeout directly >> >> Link: https://lore.kernel.org/r/20260715101805.3615166-1- >> aniket.randive@oss.qualcomm.com >> >> Signed-off-by: Aniket Randive >> --- > > [...] >> >