[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <409b6cc3-3339-61b2-7f42-0c69b6486bb3@intel.com>
Date: Fri, 2 Jul 2021 14:52:11 +0800
From: Jie Deng <jie.deng@...el.com>
To: Viresh Kumar <viresh.kumar@...aro.org>,
Wolfram Sang <wsa@...nel.org>, linux-i2c@...r.kernel.org,
virtualization@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org, mst@...hat.com, arnd@...db.de,
jasowang@...hat.com, andriy.shevchenko@...ux.intel.com,
yu1.wang@...el.com, shuo.a.liu@...el.com, conghui.chen@...el.com,
stefanha@...hat.com
Subject: Re: [PATCH v11] i2c: virtio: add a virtio i2c frontend driver
On 2021/7/2 12:55, Viresh Kumar wrote:
> On 01-07-21, 21:24, Wolfram Sang wrote:
>>> I just noticed this now, but this function even tries to send data
>>> partially, which isn't right. If the caller (i2c device's driver)
>>> calls this for 5 struct i2c_msg instances, then all 5 need to get
>>> through or none.. where as we try to send as many as possible here.
>>>
>>> This looks broken to me. Rather return an error value here on success,
>>> or make it complete failure.
>>>
>>> Though to be fair I see i2c-core also returns number of messages
>>> processed from i2c_transfer().
>>>
>>> Wolfram, what's expected here ? Shouldn't all message transfer or
>>> none?
>> Well, on a physical bus, it can simply happen that after message 3 of 5,
>> the bus is stalled, so we need to bail out.
> Right, and in that case the transfer will have any meaning left? I believe it
> needs to be fully retried as the requests may have been dependent on each other.
>
>> Again, I am missing details of a virtqueue, but I'd think it is
>> different. If adding to the queue fails, then it probably make sense to
>> drop the whole transfer.
> Exactly my point.
>
This is not efficient. If adding the ith request to the queue fails, we
can still send
the requests before it. We don't need to know if it fails here (adding
to the queue)
or there (later in the host). The "master_xfer" just need to return
final number of
messages successfully processed.
Powered by blists - more mailing lists