From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: virtio-comment-return-1479-cohuck=redhat.com@lists.oasis-open.org Sender: List-Post: List-Help: List-Unsubscribe: List-Subscribe: References: <5d3d8a27893734be954ebbe560f638fbafb3429c.1603778046.git.jie.deng@intel.com> From: Jie Deng Message-ID: Date: Thu, 29 Oct 2020 15:38:09 +0800 MIME-Version: 1.0 In-Reply-To: Subject: Re: [virtio-comment] [PATCH v3] virtio-i2c: add the device specification Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US To: Paolo Bonzini , virtio-comment@lists.oasis-open.org, virtio-dev@lists.oasis-open.org Cc: mst@redhat.com List-ID: On 2020/10/29 4:10, Paolo Bonzini wrote: > On 27/10/20 07:00, Jie Deng wrote: >> +The driver queues requests to the virtqueue, and they are used by the >> +device. The request is the representation of one segment of an I2C >> +transaction. Each request is of form: >> + >> +\begin{lstlisting} >> +struct virtio_i2c_req { >> + le16 addr; >> + le16 flags; >> + le16 len; >> + u8 buf[]; >> + u8 status; >> +}; >> +\end{lstlisting} > Hi, > > one extremely common two-segment I2C transaction is not reproducible > with virtio-i2c. 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. > > Would it make sense to define the request like > > struct virtio_i2c_req { > le16 addr; > le16 written; > le16 read; > u8 bufwrite[]; > u8 status; > u8 bufread[]; > }; > > instead? > > Thanks, > > Paolo > Hi Paolo, I'm not sure why this two-segment I2C transaction is not reproducible ? my understanding is that we don't need to care about the START/STOP/RESTART conditions between virtio-i2c frontend and backend. These conditions only make sense when data is exchanged between master and slave devices, rather than virtio frontend and backend. Only the backend may need to consider these conditions when doing device emulation and exchanging data with its slave devices. It has nothing to do with the frontend. Is my understanding correct ? Thanks This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: virtio-comment-subscribe@lists.oasis-open.org Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org List help: virtio-comment-help@lists.oasis-open.org List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/