[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210629041017.dsvzldikvsaade37@vireshk-i7>
Date: Tue, 29 Jun 2021 09:40:17 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Wolfram Sang <wsa@...nel.org>, Arnd Bergmann <arnd@...db.de>,
Jie Deng <jie.deng@...el.com>,
Linux I2C <linux-i2c@...r.kernel.org>,
virtualization@...ts.linux-foundation.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
conghui.chen@...el.com, kblaiech@...lanox.com,
jarkko.nikula@...ux.intel.com,
Sergey Semin <Sergey.Semin@...kalelectronics.ru>,
Mike Rapoport <rppt@...nel.org>, loic.poulain@...aro.org,
Tali Perry <tali.perry1@...il.com>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
yu1.wang@...el.com, shuo.a.liu@...el.com,
Stefan Hajnoczi <stefanha@...hat.com>,
Paolo Bonzini <pbonzini@...hat.com>
Subject: Re: [PATCH v10] i2c: virtio: add a virtio i2c frontend driver
I will be replying here instead of replying to each and every msg :)
On 28-06-21, 16:58, Wolfram Sang wrote:
>
> > You can fine Viresh's vhost-user implementation at
> > https://lore.kernel.org/qemu-devel/cover.1617278395.git.viresh.kumar@linaro.org/t/#m3b5044bad9769b170f505e63bd081eb27cef8db2
>
> It looks OK so far; yet, it is not complete. But it might be bearable
> in the end.
While we are at it, this has been replaced by a Rust counterpart [1]
(as that makes it hypervisor agnostic, which is the goal of my work
here) and I need someone with I2C knowledge to help review it. It
should be okay even if you don't understand Rust a lot, just review
this file[2] which is where most of i2c specific stuff lies.
> > As you say, it does get a bit clumsy, but I think there is also a good argument
> > to be made that the clumsiness is based on the host Linux user interface
> > more than the on the requirements of the physical interface,
> > and that should not have to be reflected in the virtio specification.
>
> Makes sense to me.
>
> > Right, this one has come up before as well: the preliminary result
> > was to assume that this probably won't be needed, but would be easy
> > enough to add later if necessary.
>
> If adding support incrementally works for such an interface, this makes
> sense as well.
Yes, we don't support few of SMBUS transaction (the block ones) as you
specified.
> So, where are we?
The virtio specification is already merged and here is the latest
version [3].
> As I understand, this v10 does not support I2C transactions (or
> I2C_RDWR as you said).
I am not sure why you say I2C_RDWR isn't supported. The spec and Linux
driver (+ my Rust/qemu backend), they all support I2C_RDWR as well as
SMBUS. To clarify on an earlier point, every virtio transfer may
contain one or more struct i2c_msg instances, all processed together
(as expected).
If you see virtio_i2c_send_reqs() in this patch, you will see that it
converts a stream of i2c_req messages to their virtio counterparts and
send them together, consider it a single transaction.
> But you want to support all clients. So, this doesn't match, or?
--
viresh
[1] https://github.com/rust-vmm/vhost-device/pull/1
[2] https://github.com/rust-vmm/vhost-device/blob/5aa22c92faac84ab07b6b15a214513556e8b1d01/src/i2c/src/i2c.rs
[3] https://github.com/oasis-tcs/virtio-spec/blob/master/virtio-i2c.tex
Powered by blists - more mailing lists