Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1078195pxb; Tue, 9 Nov 2021 04:54:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0MI3Dm7Toa/oSrEbVj11mzUPmIoysqzvJ8xqwaSCb6qRNhxXGSrsiGV1x+gN0lmN/zLFC X-Received: by 2002:a17:906:168e:: with SMTP id s14mr9328903ejd.340.1636462458000; Tue, 09 Nov 2021 04:54:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636462457; cv=none; d=google.com; s=arc-20160816; b=gWyrZj7ZiRLoFULuVF9nR6F8y2cAOTPJOmAfUE5ycDNb2fAvoYAorGwyR5oxvjeqa8 DCoWiCSC9hUhPj7Ma99ehTIZbojyeAgCoBmWj4xuZUMusNxOb7tFTbAiclJqamRbhkiB Otv9xRN3XAgKA7v7Ktqshv1EmteP6ryxgY0szBnZxbxZN+0g7kcptfYN8dllF1mdzQXZ MNJrWC4TzdcsZzXHtPvtjRJtWY+urTw96gbSf5NqASKJo9DvnoZh6PxVHZ3i9haACKfz RP6vrlj9nTc81vF/UsvFoy+XHZEwqCsHEcbOaB9RgnDD3zZZOaeJu85lOPZUN1sTKE8s 9sJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=JkapuSwOnwxCbVYO9bfegcqw8wgDzralipX1H1BuD5E=; b=txSNTh8mOacJqaRNkzoaPfpU5c1U3YPlwsfINuFh6YyciyC5vxVPcx+AkEcAmztp9v KJO/4mmxlPJ9BS2adU7jg1nX76J+pgy6kY5hwZ++hilRdIjqqrSrmNHMPmiz38OXZLcf 783Jz+4beJuLaMcDSvdwnmx/lLofkppUQmJPQfzwity+QT5LmOPFDREg4VTJcDRWRJXI QoEBmQOXvewudNS5ozgIAeDubSocEJZOTkMXFcIyArngqBXVo9b20dx+U+OTnbyijdfx HzDCJIzNrXyvHxJEiBWryfpkperzvzgxtzfBu9Hiv2G6z3vyC2unS4Upf84JmbbGRKQF aq5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Oq8Hop7U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z19si32587308edc.419.2021.11.09.04.53.51; Tue, 09 Nov 2021 04:54:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Oq8Hop7U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229832AbhKIEzK (ORCPT + 99 others); Mon, 8 Nov 2021 23:55:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242867AbhKIEzJ (ORCPT ); Mon, 8 Nov 2021 23:55:09 -0500 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87612C061766 for ; Mon, 8 Nov 2021 20:52:24 -0800 (PST) Received: by mail-pf1-x42e.google.com with SMTP id 127so18313403pfu.1 for ; Mon, 08 Nov 2021 20:52:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JkapuSwOnwxCbVYO9bfegcqw8wgDzralipX1H1BuD5E=; b=Oq8Hop7UfqF6odaW6RoWQK/Dre2F5iWQRWQwE0ryorhq4KCyAzFVrKhpsKLelcCOLT eLaYcntMkP6D9l28kM3sfnjAoF0i4Dvr9OmjjZOTULC8HzEQysGVQnjrb3i+Q98U2OAk l5M4aVtDq7IlqDrbuwHzqPEsEQwrt5EMFmspVurem58kicyZcN4ZnLTNTy7G1Hsil7FD Zt60JANYdAcZ6/mS6y4fb+NsObX+3f0QIYGPkDzjNbPIOwh0TVqaIuEkaBIwYR6M5QpF cdmJ0JaW8GIpsnOkUlIIm2RItYNV/lYlysK6ElrG0MLDNtWOU603v7S6lGADLyH/FYYR kfgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=JkapuSwOnwxCbVYO9bfegcqw8wgDzralipX1H1BuD5E=; b=6b1sZbgom0GdeTplQLZaqKgLRtrXGgOK9yXVEOdHEPG/7T3qABwyqoRqABm977lfpT +J77bYoazRhMsEVsKNOrmMANnyNIgZDoYyrh4JVjrPTB9ZqNtlybsk2cS4AQTmk+qVXd MfWgXMCEPFUrlsObs0r1JJeDQ1hSEdaEfb+V7DrKrSF/kf6es0MGAMCZSlzbxx2nKWIG cN/fh0XsobXcKIyH+ckyb2Y4WE5hOd+LoWWXJBUnTg9ithmDfoeBI7T/WHifo0osvRyF 5R3EJL10B6XRp+hJtWLG8Kz9QMaVf0wTQBydWzty+iYmi7bK1v4a6CidqdtWTIxY1x2C G+0A== X-Gm-Message-State: AOAM532JIQDZd620S1RARoEMYMny4G//CDxSim/jcpfSdUroWZO9JyQV 9CVrK/lz+yN450760OXxdYeNxw== X-Received: by 2002:a05:6a00:230d:b0:49f:b8ad:ae23 with SMTP id h13-20020a056a00230d00b0049fb8adae23mr5043480pfh.80.1636433543998; Mon, 08 Nov 2021 20:52:23 -0800 (PST) Received: from localhost ([223.226.77.81]) by smtp.gmail.com with ESMTPSA id na13sm976263pjb.11.2021.11.08.20.52.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 20:52:23 -0800 (PST) Date: Tue, 9 Nov 2021 10:22:21 +0530 From: Viresh Kumar To: Vincent Whitchurch Cc: "Chen, Conghui" , "Deng, Jie" , Greg KH , Wolfram Sang , "virtualization@lists.linux-foundation.org" , "linux-i2c@vger.kernel.org" , "linux-kernel@vger.kernel.org" , kernel Subject: Re: [PATCH 1/2] i2c: virtio: disable timeout handling Message-ID: <20211109045221.xd6apt473jannag2@vireshk-i7> References: <20211020064128.y2bjsbdmpojn7pjo@vireshk-i7> <01d9c992-28cc-6644-1e82-929fc46f91b4@intel.com> <20211020105554.GB9985@axis.com> <20211020110316.4x7tnxonswjuuoiw@vireshk-i7> <20211029122450.GB24060@axis.com> <8592a48d-0131-86bf-586a-d33e7989e523@intel.com> <20211103063745.utpphthou4angs4s@vireshk-i7> <20211103144241.GA27285@axis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211103144241.GA27285@axis.com> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03-11-21, 15:42, Vincent Whitchurch wrote: > The suggested timeout is not meant to take into account the overhead of > virtualization, but to be used by the virtio device as a timeout for the > transaction on the I2C bus (presumably by programming this value to the > physical I2C controller, if one exists). > > Assume that userspace (or an I2C client driver) asks for a timeout of 20 > ms for a particular transfer because it, say, knows that the particular > connected I2C peripheral either responds within 10 ms to a particular > register read or never responds, so it doesn't want to waste time > waiting unnecessarily long for the transfer to complete. > > If the virtio device end does not have any information on what timeout > is required (as in the current spec), it must assume some high value > which will never cause I2C transactions to spuriously timeout, say 10 > seconds. > > Even if the virtio driver is fixed to copy and hold all buffers to avoid > memory corruption and to time out and return to the caller after the > requested 20 ms, the next I2C transfer can not be issued until 10 > seconds have passed, since the virtio device end will still be waiting > for the hardcoded 10 second timeout and may not respond to new requests > until that transfer has timed out. Okay, so this is more about making sure the device times-out before the driver or lets say in an expected time-frame. That should be okay I guess. -- viresh