Re: [virtio-dev] Re: [virtio-comment] [PATCH v4] virtio-i2c: add the device specification

2020-11-19 Thread Jie Deng
On 2020/11/19 23:55, Paolo Bonzini wrote: On 19/11/20 02:41, Jie Deng wrote: No, the kick is only an advice.  The device is allowed to poll on the ring and ignore kicks completely, for example. Paolo Understood. But I saw your proposal can only group two segments "write-read". What if we

Re: [virtio-dev] Re: [virtio-comment] [PATCH v4] virtio-i2c: add the device specification

2020-11-19 Thread Paolo Bonzini
On 19/11/20 02:41, Jie Deng wrote: No, the kick is only an advice.  The device is allowed to poll on the ring and ignore kicks completely, for example. Paolo Understood. But I saw your proposal can only group two segments "write-read". What if we have segments more than two ? for example,

Re: [virtio-dev] Re: [virtio-comment] [PATCH v4] virtio-i2c: add the device specification

2020-11-18 Thread Jie Deng
On 2020/11/18 16:22, Paolo Bonzini wrote: On 18/11/20 03:06, Jie Deng wrote: Can the "kick" be used for grouping ?  I mean when a write and a read are sent by one kick at a time, they will be treated as one transaction by default if the host has such a feature bit. No, the kick is only an ad

Re: [virtio-dev] Re: [virtio-comment] [PATCH v4] virtio-i2c: add the device specification

2020-11-18 Thread Paolo Bonzini
On 18/11/20 03:06, Jie Deng wrote: Can the "kick" be used for grouping ? I mean when a write and a read are sent by one kick at a time, they will be treated as one transaction by default if the host has such a feature bit. No, the kick is only an advice. The device is allowed to poll on the

Re: [virtio-dev] Re: [virtio-comment] [PATCH v4] virtio-i2c: add the device specification

2020-11-17 Thread Jie Deng
On 2020/11/17 16:23, Gerd Hoffmann wrote: On Tue, Nov 17, 2020 at 02:55:14PM +0800, Jie Deng wrote: On 2020/11/16 16:16, Paolo Bonzini wrote: On 16/11/20 03:12, Jie Deng wrote: Fore example, the frontend may kick the sequence "write read read ..." to the backend at a time. The segments can

[virtio-dev] Re: [virtio-comment] [PATCH v4] virtio-i2c: add the device specification

2020-11-17 Thread Jie Deng
On 2020/11/17 23:59, Paolo Bonzini wrote: On 17/11/20 09:23, Gerd Hoffmann wrote: That is not enough.  You also need that for the transactions.  If the driver sends a write and a read message the device needs to know whenever that is one or two transactions.  So if you want continue with the i

[virtio-dev] Re: [virtio-comment] [PATCH v4] virtio-i2c: add the device specification

2020-11-17 Thread Paolo Bonzini
On 17/11/20 09:23, Gerd Hoffmann wrote: That is not enough. You also need that for the transactions. If the driver sends a write and a read message the device needs to know whenever that is one or two transactions. So if you want continue with the i2c_msg list idea you need some way to group y

[virtio-dev] Re: [virtio-comment] [PATCH v4] virtio-i2c: add the device specification

2020-11-17 Thread Gerd Hoffmann
On Tue, Nov 17, 2020 at 02:55:14PM +0800, Jie Deng wrote: > > On 2020/11/16 16:16, Paolo Bonzini wrote: > > On 16/11/20 03:12, Jie Deng wrote: > > > Fore example, the frontend may kick the sequence "write read read > > > ..." to the backend at a time. > > > > > > The segments can be aggregated in

[virtio-dev] Re: [virtio-comment] [PATCH v4] virtio-i2c: add the device specification

2020-11-16 Thread Jie Deng
On 2020/11/16 16:16, Paolo Bonzini wrote: On 16/11/20 03:12, Jie Deng wrote: Fore example, the frontend may kick the sequence "write read read ..." to the backend at a time. The segments can be aggregated into "i2c_msg list" and sent to the hardware at a time by the backend. The host nati

[virtio-dev] Re: [virtio-comment] [PATCH v4] virtio-i2c: add the device specification

2020-11-16 Thread Paolo Bonzini
On 16/11/20 03:12, Jie Deng wrote: Fore example, the frontend may kick the sequence "write read read ..." to the backend at a time. The segments can be aggregated into "i2c_msg list" and sent to the hardware at a time by the backend. The host native drivers will finally send these segments u

[virtio-dev] Re: [virtio-comment] [PATCH v4] virtio-i2c: add the device specification

2020-11-15 Thread Jie Deng
Hi Michael and Paolo, Have you reached an agreement on the design of "virtio_i2c_req" ? Personally, I think the design in v4 can already handle the multi-segment transactions between frontend and backend. Fore example, the frontend may kick the sequence "write read read ..." to the backend a

[virtio-dev] Re: [virtio-comment] [PATCH v4] virtio-i2c: add the device specification

2020-11-12 Thread Jie Deng
On 2020/11/12 16:54, Michael S. Tsirkin wrote: On Thu, Nov 12, 2020 at 09:51:17AM +0800, Jie Deng wrote: On 2020/11/10 18:59, Paolo Bonzini wrote: On 10/11/20 11:33, Michael S. Tsirkin wrote: Sorry I didn't reply last week, but I really would prefer if virtio-i2c supported write-read transac

[virtio-dev] Re: [virtio-comment] [PATCH v4] virtio-i2c: add the device specification

2020-11-12 Thread Michael S. Tsirkin
On Thu, Nov 12, 2020 at 09:51:17AM +0800, Jie Deng wrote: > > On 2020/11/10 18:59, Paolo Bonzini wrote: > > On 10/11/20 11:33, Michael S. Tsirkin wrote: > > > > Sorry I didn't reply last week, but I really would prefer if virtio-i2c > > > > supported write-read transactions. > > > > > > And I thi

[virtio-dev] Re: [virtio-comment] [PATCH v4] virtio-i2c: add the device specification

2020-11-11 Thread Jie Deng
On 2020/11/10 18:59, Paolo Bonzini wrote: On 10/11/20 11:33, Michael S. Tsirkin wrote: Sorry I didn't reply last week, but I really would prefer if virtio-i2c supported write-read transactions. And I think an easier way is to allow multi-segment transactions probably using the stop flag. Y

[virtio-dev] Re: [virtio-comment] [PATCH v4] virtio-i2c: add the device specification

2020-11-10 Thread Paolo Bonzini
On 10/11/20 11:33, Michael S. Tsirkin wrote: Sorry I didn't reply last week, but I really would prefer if virtio-i2c supported write-read transactions. And I think an easier way is to allow multi-segment transactions probably using the stop flag. You cannot always be sure that the host would

[virtio-dev] Re: [virtio-comment] [PATCH v4] virtio-i2c: add the device specification

2020-11-10 Thread Michael S. Tsirkin
On Tue, Nov 10, 2020 at 09:05:47AM +0100, Paolo Bonzini wrote: > On 10/11/20 08:31, Jie Deng wrote: > > virtio-i2c is a virtual I2C adapter device. It provides a way to flexibly > > communicate with the I2C slave devices from the guest. This patch adds > > the specification for this device. > > Sor

[virtio-dev] Re: [virtio-comment] [PATCH v4] virtio-i2c: add the device specification

2020-11-10 Thread Paolo Bonzini
On 10/11/20 08:31, Jie Deng wrote: virtio-i2c is a virtual I2C adapter device. It provides a way to flexibly communicate with the I2C slave devices from the guest. This patch adds the specification for this device. Sorry I didn't reply last week, but I really would prefer if virtio-i2c support