Thread (11 messages) 11 messages, 4 authors, 2021-07-02

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

From: Viresh Kumar <viresh.kumar@linaro.org>
Date: 2021-07-01 06:18:52
Also in: linux-i2c, lkml

On 01-07-21, 14:10, Jie Deng wrote:
I think a fixed number of sgs will make things easier to develop backend.
Yeah, but it looks awkward to send a message buffer which isn't used
at all. From protocol's point of view, it just looks wrong/buggy.

The backend can just look at the number of elements received, they
can either be 2 (in case of zero-length) transfer, or 3 (for
read/write) and any other number is invalid.
If you prefer to parse the number of descriptors instead of using the msg
length to

distinguish the zero-length request from other requests, I'm OK to set a
limit.
My concern is more about the specification here first.
if (!msgs[i].len) {
    sg_init_one(&msg_buf, reqs[i].buf, msgs[i].len);

    if (msgs[i].flags & I2C_M_RD)
        sgs[outcnt + incnt++] = &msg_buf;
    else
        sgs[outcnt++] = &msg_buf;
}
quoted
quoted
+#ifdef CONFIG_PM_SLEEP
You could avoid this pair of ifdef by creating dummy versions of below
routines for !CONFIG_PM_SLEEP case. Up to you.

Thank you. I'd like to keep the same.
Sure.

-- 
viresh
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help