Re: [PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-10 Thread Jie Deng
On 2021/3/10 16:27, Arnd Bergmann wrote: On Wed, Mar 10, 2021 at 4:59 AM Jason Wang wrote: On 2021/3/10 10:22 上午, Jie Deng wrote: On 2021/3/4 17:15, Jason Wang wrote: +} + +if (msgs[i].flags & I2C_M_RD) +memcpy(msgs[i].buf, req->buf, msgs[i].len); Sorry if I

Re: [PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-10 Thread Arnd Bergmann
On Wed, Mar 10, 2021 at 4:59 AM Jason Wang wrote: > On 2021/3/10 10:22 上午, Jie Deng wrote: > > On 2021/3/4 17:15, Jason Wang wrote: > >> > >> > >>> +} > >>> + > >>> +if (msgs[i].flags & I2C_M_RD) > >>> +memcpy(msgs[i].buf, req->buf, msgs[i].len); > >> > >> > >> Sorry if

Re: [PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-09 Thread Jason Wang
On 2021/3/10 10:22 上午, Jie Deng wrote: On 2021/3/4 17:15, Jason Wang wrote: +    } + +    if (msgs[i].flags & I2C_M_RD) +    memcpy(msgs[i].buf, req->buf, msgs[i].len); Sorry if I had asked this before but any rason not to use msg[i].buf directly? The msg[i].buf is p

Re: [PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-09 Thread Jie Deng
On 2021/3/4 17:15, Jason Wang wrote: +    } + +    if (msgs[i].flags & I2C_M_RD) +    memcpy(msgs[i].buf, req->buf, msgs[i].len); Sorry if I had asked this before but any rason not to use msg[i].buf directly? The msg[i].buf is passed by the I2C core. I just noticed tha

Re: [PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-05 Thread Jie Deng
On 2021/3/5 15:23, Jason Wang wrote: +    virtqueue_kick(vq); + +    time_left = wait_for_completion_timeout(&vi->completion, adap->timeout); +    if (!time_left) { +    dev_err(&adap->dev, "virtio i2c backend timeout.\n"); +    ret = -ETIMEDOUT; +    goto err_unlock_free; So

Re: [PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-04 Thread Viresh Kumar
On 05-03-21, 15:00, Jie Deng wrote: > On 2021/3/5 11:09, Viresh Kumar wrote: > > On 05-03-21, 09:46, Jie Deng wrote: > > > On 2021/3/4 14:06, Viresh Kumar wrote: > > > > > + mutex_lock(&vi->i2c_lock); > > > > I have never worked with i2c stuff earlier, but I don't think you need > > > > a lock

Re: [PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-04 Thread Jason Wang
On 2021/3/5 1:47 下午, Jie Deng wrote: On 2021/3/4 17:15, Jason Wang wrote: On 2021/3/4 9:59 上午, Jie Deng wrote: Add an I2C bus driver for virtio para-virtualization. The controller can be emulated by the backend driver in any device model software by following the virtio protocol. The devi

Re: [PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-04 Thread Jie Deng
On 2021/3/5 11:09, Viresh Kumar wrote: On 05-03-21, 09:46, Jie Deng wrote: On 2021/3/4 14:06, Viresh Kumar wrote: depends on I2C as well ? No need that. The dependency of I2C is included in the Kconfig in its parent directory. Sorry about that, I must have figured that out myself. (Though

Re: [PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-04 Thread Jie Deng
On 2021/3/4 17:15, Jason Wang wrote: On 2021/3/4 9:59 上午, Jie Deng wrote: Add an I2C bus driver for virtio para-virtualization. The controller can be emulated by the backend driver in any device model software by following the virtio protocol. The device specification can be found on https:

Re: [PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-04 Thread Viresh Kumar
On 05-03-21, 09:46, Jie Deng wrote: > On 2021/3/4 14:06, Viresh Kumar wrote: > > depends on I2C as well ? > No need that. The dependency of I2C is included in the Kconfig in its parent > directory. Sorry about that, I must have figured that out myself. (Though a note on the way we reply to messag

Re: [PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-04 Thread Jie Deng
On 2021/3/4 14:06, Viresh Kumar wrote: Please always supply version history, it makes it difficult to review otherwise. I will add the history. drivers/i2c/busses/Kconfig | 11 ++ drivers/i2c/busses/Makefile | 3 + drivers/i2c/busses/i2c-virtio.c | 289

Re: [PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-04 Thread Jason Wang
On 2021/3/4 9:59 上午, Jie Deng wrote: Add an I2C bus driver for virtio para-virtualization. The controller can be emulated by the backend driver in any device model software by following the virtio protocol. The device specification can be found on https://lists.oasis-open.org/archives/virtio-

Re: [PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-03 Thread kernel test robot
Hi Jie, Thank you for the patch! Yet something to improve: [auto build test ERROR on wsa/i2c/for-next] [also build test ERROR on vhost/linux-next linux/master linus/master v5.12-rc1 next-20210303] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch,

Re: [PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-03 Thread Viresh Kumar
On 04-03-21, 09:59, Jie Deng wrote: > Add an I2C bus driver for virtio para-virtualization. > > The controller can be emulated by the backend driver in > any device model software by following the virtio protocol. > > The device specification can be found on > https://lists.oasis-open.org/archive

Re: [PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-03 Thread kernel test robot
Hi Jie, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on wsa/i2c/for-next] [also build test WARNING on vhost/linux-next linux/master linus/master v5.12-rc1 next-20210303] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting

Re: [PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-03 Thread kernel test robot
Hi Jie, Thank you for the patch! Yet something to improve: [auto build test ERROR on wsa/i2c/for-next] [also build test ERROR on vhost/linux-next linux/master linus/master v5.12-rc1 next-20210303] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch,

[PATCH v6] i2c: virtio: add a virtio i2c frontend driver

2021-03-03 Thread Jie Deng
Add an I2C bus driver for virtio para-virtualization. The controller can be emulated by the backend driver in any device model software by following the virtio protocol. The device specification can be found on https://lists.oasis-open.org/archives/virtio-comment/202101/msg8.html. By followi