Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4335485pxb; Tue, 2 Mar 2021 12:24:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzte+sSED+yndqaJDGmA/8UetFkdPlkZYPIiko+Lvde+fXW4sA++TkSZPXMGuFFcuHx8Eeb X-Received: by 2002:a17:906:380c:: with SMTP id v12mr22358958ejc.65.1614716649752; Tue, 02 Mar 2021 12:24:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614716649; cv=none; d=google.com; s=arc-20160816; b=jj8+97b8K+UqdQvFhY6U1iAjEMLV0THGkuPUmhhgwEZ/1G/BJM6m7ewiMtVF8dk70t ffoEZyyTJJYI+JWOVTCuWZzc5BmkCKbtNOU91md4AHfjr75b5PJKdqIWaGWEEURxhwZ1 nsdfvd4fIbA10dXjK13dAZJJFYm9vQ6ndAgAY8I1t+1Ot4rOCUt5mFw5XEKuFsdogZxL EgJffTod00pHf8wEovrVL00kD8/S6bcd+YLy4AsCrmdDltcgdX9X+hR2oCGIgOB51k1i PJg0sWZXZNy+UGmF6OEzsI48Q1ZMpxxHr9dnfnuoz17BAS1TuoX92pI0/OO4tNBMeptm C6Cg== 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=5wYZaEnwAqVbbp8B0+QBU0IRndFZm49vxUSUHZwmsFg=; b=xkG9MgQcCF+jMiOFSxvWzcU0+N62ef38Lk6F9bj1UBQvZnB9+t+bPmDBoWtbkmOqTw wK05GcGpJX+2bjRVG33sDnV3sJHlCSbuH4mX0s7D1eszVmJmWgnAIXdAdUA/FnvFGjd6 S6j8Kg/QPgMbQ/djTOr5sbHVrtSljpAj1JeFkJCNmAbRUonZfmtIdKjnAh5lkT2Qlhqo PAYn5rdcDGBevzGGmXoOEPFnjsQiIHugjUGSr6lqqaCMbBjwZ3EdZQZtBQeVTlMULpCW DlUYL5jVVSpJmBo5GiGshsgTTXPaEdVo+ARL1L+Ndi9pAsS4hQEgkI6chnuAiaEv3y6j pR7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BzAZUTsy; 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 g10si14699879edf.314.2021.03.02.12.23.43; Tue, 02 Mar 2021 12:24:09 -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=BzAZUTsy; 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 S1376737AbhCBHvR (ORCPT + 99 others); Tue, 2 Mar 2021 02:51:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1835949AbhCBHZr (ORCPT ); Tue, 2 Mar 2021 02:25:47 -0500 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4A3AC061756 for ; Mon, 1 Mar 2021 23:24:34 -0800 (PST) Received: by mail-pf1-x430.google.com with SMTP id w18so13258107pfu.9 for ; Mon, 01 Mar 2021 23:24:34 -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=5wYZaEnwAqVbbp8B0+QBU0IRndFZm49vxUSUHZwmsFg=; b=BzAZUTsyimLb0JLWMpsCWt5rf1w8ctown476IvdFZSem5oSmf1XMLF+SSRf5D4cdMv Rvx1zpCDGe/fMkBL61KWb/IVvKJBBxrvQrw+wa7q/1cbmWMC3Wh4NI3Lr0G3TMvv8fnm b6cA6knrE0Kun2mBSHD3HtJZ9se31V8wKXFYfXXE7Po/k+6OdoRrk2MIeeaHBAO9dHg0 4yOPNpQ+ooAmxa8f1Q3s516C18zeOcC+XaqoLC4rpwmlqbIMoeHIBNu+p4M/pgoUZs1W M1CHsnLI468pBY0cIo2ya7rOXMSRxYtTLjb/biv2lCQTppAtzrhrAhx4mTTpAnY7zA6e Bvbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5wYZaEnwAqVbbp8B0+QBU0IRndFZm49vxUSUHZwmsFg=; b=nXr6N/YuDxuezQkCExh/uWOgmU4vtp2MVvj9b7bP4Mr9UNIIqouXhWzBsTtU+3glEj TXLS4tgMOWyaPYxIF78TrCMLNtHtFPmiYAoTU7Tl0ux10xvaxpRowYvDWQzW332iAO/T KrWy2mMSnNiBfIUy+y2vTJJjhKqkpjG7e/GYmHfinlsVe0WTwVXldJdLph8bwMq+6E3c pQX/ZKvo581HydgIs0zxpCOD87a6zTsRb4/uh/+xSD31PNOfAGcZaP8FfzuiM1vX3rqu BpEx7RDG0q8qRWM5uy1IPc+zkwB8f6eL4MeBOT3m9UwaW4tM7ojsLzbz/gsRVOJOK5l3 0pmA== X-Gm-Message-State: AOAM533RaIXFzsF9pDJnd3s3U3BqamBrTvWG64A+x90rED4fwveEiS/Z n6k60oZYscoJ1YjF6EWNHKsWZg== X-Received: by 2002:a63:a22:: with SMTP id 34mr17028944pgk.328.1614669874042; Mon, 01 Mar 2021 23:24:34 -0800 (PST) Received: from localhost ([122.171.124.15]) by smtp.gmail.com with ESMTPSA id v4sm1846198pjo.32.2021.03.01.23.24.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Mar 2021 23:24:33 -0800 (PST) Date: Tue, 2 Mar 2021 12:54:31 +0530 From: Viresh Kumar To: Jie Deng Cc: linux-i2c@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, mst@redhat.com, wsa@kernel.org, jasowang@redhat.com, wsa+renesas@sang-engineering.com, andriy.shevchenko@linux.intel.com, conghui.chen@intel.com, arnd@arndb.de, kblaiech@mellanox.com, jarkko.nikula@linux.intel.com, Sergey.Semin@baikalelectronics.ru, rppt@kernel.org, loic.poulain@linaro.org, tali.perry1@gmail.com, u.kleine-koenig@pengutronix.de, bjorn.andersson@linaro.org, yu1.wang@intel.com, shuo.a.liu@intel.com, Paolo Bonzini Subject: Re: [PATCH v5] i2c: virtio: add a virtio i2c frontend driver Message-ID: <20210302072431.ml4veczbelyjbhkt@vireshk-i7> References: <00f826ffe1b6b4f5fb41de2b55ad6b8783b7ff45.1614579846.git.jie.deng@intel.com> <20210301115441.a4s5xzwm6d6ohz7f@vireshk-i7> <16efea9f-d606-4cf9-9213-3c1cf9b1a906@intel.com> <20210302034323.gkqymzngyqofrdsr@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02-03-21, 14:24, Jie Deng wrote: > Not for the full duplex. As Paolo explained in those links. > We defined a combined request called "write-read request" > > " > This is when a write is followed by a read: the master > starts off the transmission with a write, then sends a second START, > then continues with a read from the same address. I think above talks about the real I2C protocol at bus level ? > In theory there's no difference between one multi-segment transaction > and many single-segment transactions _in a single-master scenario_. > > However, it is a plausible configuration to have multiple guests sharing > an I2C host device as if they were multiple master. > > So the spec should provide a way at least to support for transactions with > 1 write and 1 read segment in one request to the same address. > " > From the perspective of specification design, it hopes to provide more > choices > while from the perspective of specific implementation, we can choose what we > need > as long as it does not violate the specification. That is fine, but what I was not able to understand was how do we get to know if we should expect both write and read bufs after the out header or only one of them ? I think I have understood that part now, we need to look at incnt and outcnt and make out what kind of transfer we need to do. - If outcnt == 1 and incnt == 2, then it is read operation. - If outcnt == 2 and incnt == 1, then it is write operation. - If outcnt == 2 and incnt == 2, then it is read-write operation. Anything else is invalid. Is my understanding correct here ? > Since the current Linux driver doesn't use this mechanism. I'm considering > to move > the "struct virtio_i2c_req" into the driver and use one "buf" instead. Linux can very much have its own definition of the structure and so I am not in favor of any such structure in the spec as well, it confuses people (like me) :). -- viresh