From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: virtio-comment-return-1502-cohuck=redhat.com@lists.oasis-open.org Sender: List-Post: List-Help: List-Unsubscribe: List-Subscribe: MIME-Version: 1.0 References: <61930337391bdfd23ed164288d998c04177bc839.1603435652.git.jie.deng@intel.com> <20201023115932-mutt-send-email-mst@kernel.org> <20201027071957-mutt-send-email-mst@kernel.org> In-Reply-To: From: Paolo Bonzini Date: Tue, 10 Nov 2020 08:51:22 +0100 Message-ID: Subject: [virtio-comment] Re: [virtio-dev] Re: [PATCH v2] virtio-i2c: add the device specification Content-Type: multipart/alternative; boundary="00000000000093302205b3bbf2c2" To: Jie Deng Cc: virtio-comment@lists.oasis-open.org, Virtio-Dev , stefanha@redhat.com, Cornelia Huck , "Michael S. Tsirkin" List-ID: --00000000000093302205b3bbf2c2 Content-Type: text/plain; charset="UTF-8" It'd always be a write followed by a read. Usually the write provides the number of a register to be read. The opposite order does not make much sense. Paolo Il gio 5 nov 2020, 07:35 Jie Deng ha scritto: > > On 2020/10/31 21:58, Paolo Bonzini wrote: > > On 27/10/20 12:20, Michael S. Tsirkin wrote: > > The I2C doesn't support segments numbering and sorting. > So if one creates a multi-segment transaction, then he/she should keep the > segments in order. > > Thanks. > > Fine, but I see no flags to signal start/end of such a transaction. > > > > 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. > > For this reason, I would prefer to have at least support for > transactions with 1 write and 1 read segment to the same address (see my > other message). > > Paolo > > Then how to distinguish the order of the two segments if they are in one > request ? > We don't know this is a write followed by a read or a read followed by a > write in this case. > > However, if the request is the representation of only one segment of an > I2C transaction, > we can simply judge by the order of the requests in the virtqueue. > > Thanks > > --00000000000093302205b3bbf2c2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
It'd always be a write followed by a read. Usually th= e write provides the number of a register to be read.

=
The opposite order does not make much sense.

Paolo

Il gio 5 nov 2020, = 07:35 Jie Deng <jie.deng@intel.com= > ha scritto:
=20 =20 =20


On 2020/10/31 21:58, Paolo Bonzini wrote:
On 27/10/20 12:20, Michael S. Tsirkin wrote:
The I2C doesn't support segments numbering and sorting.
So if one creates a multi-segment transaction, then he/she should keep the
segments in order.

Thanks.
Fine, but I see no flags to signal start/end of such a transac=
tion.

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.

For this reason, I would prefer to have at least support for
transactions with 1 write and 1 read segment to the same address (see my
other message).

Paolo
Then how to distinguish the order of the two segments if they are in one request ?
We don't know this is a write followed by a read or a read followed by a write in this case.

However, if the request is the representation of only one segment of an I2C transaction,
we can simply judge by the order of the requests in the virtqueue.

Thanks


    
--00000000000093302205b3bbf2c2--