From: Viresh Kumar <viresh.kumar@linaro.org>
To: Jie Deng <jie.deng@intel.com>
Cc: linux-i2c@vger.kernel.org,
virtualization@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, mst@redhat.com, wsa@kernel.org,
jasowang@redhat.com, wsa+renesas@sang-engineering.com,
andriy.shevchenko@linux.intel.com, conghui.chen@intel.com,
arnd@arndb.de, kblaiech@mellanox.com,
jarkko.nikula@linux.intel.com, Sergey.Semin@baikalelectronics.ru,
rppt@kernel.org, loic.poulain@linaro.org, tali.perry1@gmail.com,
u.kleine-koenig@pengutronix.de, bjorn.andersson@linaro.org,
yu1.wang@intel.com, shuo.a.liu@intel.com, stefanha@redhat.com,
pbonzini@redhat.com
Subject: Re: [PATCH v9] i2c: virtio: add a virtio i2c frontend driver
Date: Mon, 22 Mar 2021 13:27:00 +0530 [thread overview]
Message-ID: <20210322075700.gzxx6s3jrkv3sfai@vireshk-i7> (raw)
In-Reply-To: <dbb5dfe9-8ee6-e3f8-3681-d0ec83282930@intel.com>
On 22-03-21, 15:53, Jie Deng wrote:
> On 2021/3/22 14:41, Viresh Kumar wrote:
> I think your optimization has problems...
>
>
> > bool err_found = timeout;
> >
> > for (i = 0; i < nr; i++) {
> > /* Detach the ith request from the vq */
> > req = virtqueue_get_buf(vq, &len);
> >
> > /*
> > * Condition (req && req == &reqs[i]) should always meet since
> > * we have total nr requests in the vq.
> > */
> > if (!err_found &&
> > (WARN_ON(!(req && req == &reqs[i])) ||
> > (req->in_hdr.status != VIRTIO_I2C_MSG_OK))) {
> > err_found = true;
> > continue;
>
>
> Just continue here, the ith buf leaks ?
Ahh, this needs to be dropped. You are fight.
> > }
> >
> > i2c_put_dma_safe_msg_buf(reqs[i].buf, &msgs[i], err_found);
>
>
> i2c_put_dma_safe_msg_buf(reqs[i].buf, &msgs[i], !err_found); ?
Yes again, my mistake :)
--
viresh
next prev parent reply other threads:[~2021-03-22 7:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-22 13:35 [PATCH v9] i2c: virtio: add a virtio i2c frontend driver Jie Deng
2021-03-22 6:41 ` Viresh Kumar
2021-03-22 7:53 ` Jie Deng
2021-03-22 7:57 ` Viresh Kumar [this message]
2021-03-22 7:58 ` Viresh Kumar
2021-03-22 8:19 ` Michael S. Tsirkin
2021-03-22 8:28 ` Jie Deng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210322075700.gzxx6s3jrkv3sfai@vireshk-i7 \
--to=viresh.kumar@linaro.org \
--cc=Sergey.Semin@baikalelectronics.ru \
--cc=andriy.shevchenko@linux.intel.com \
--cc=arnd@arndb.de \
--cc=bjorn.andersson@linaro.org \
--cc=conghui.chen@intel.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=jasowang@redhat.com \
--cc=jie.deng@intel.com \
--cc=kblaiech@mellanox.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loic.poulain@linaro.org \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=rppt@kernel.org \
--cc=shuo.a.liu@intel.com \
--cc=stefanha@redhat.com \
--cc=tali.perry1@gmail.com \
--cc=u.kleine-koenig@pengutronix.de \
--cc=virtualization@lists.linux-foundation.org \
--cc=wsa+renesas@sang-engineering.com \
--cc=wsa@kernel.org \
--cc=yu1.wang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).