From: Amos Kong <akong@redhat.com>
To: Amit Shah <amit.shah@redhat.com>
Cc: stable@vger.kernel.org, kvm@vger.kernel.org,
virtualization@lists.linux-foundation.org
Subject: Re: [PATCH v2] virtio-rng: fix stuck of hot-unplugging busy device
Date: Wed, 10 Sep 2014 14:12:57 +0800 [thread overview]
Message-ID: <20140910061257.GA30285@zen.redhat.com> (raw)
In-Reply-To: <20140910053454.GA29832@grmbl.mre>
On Wed, Sep 10, 2014 at 11:04:54AM +0530, Amit Shah wrote:
> Hi Amos,
>
> On (Tue) 09 Sep 2014 [19:14:02], Amos Kong wrote:
> > When we try to hot-remove a busy virtio-rng device from QEMU monitor,
> > the device can't be hot-removed. Because virtio-rng driver hangs at
> > wait_for_completion_killable().
> >
> > This patch exits the waiting by completing have_data completion before
> > unregistering, resets data_avail to avoid the hwrng core use wrong
> > buffer bytes. Before real unregistering we should return -ENODEV for
> > reading.
> >
> > When we hot-unplug the device, dd process in guest will exit.
> > $ dd if=/dev/hwrng of=/dev/null
> > dd: error reading ‘/dev/hwrng’: No such device
> >
> > Signed-off-by: Amos Kong <akong@redhat.com>
> > Cc: stable@vger.kernel.org
> > ---
> > V2: reset data_avail (Amit)
> > adjust unregister order
>
> Thanks, this looks good.
>
> Can you please split into two parts, the complete() in one, and the
> hwrng_register_done stuff into another?
I just posted the V3, split to two patches, and updated the commitlog
to describe why we need to return ENODEV for reading.
> Thanks,
>
> Amit
--
Amos.
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
WARNING: multiple messages have this Message-ID (diff)
From: Amos Kong <akong@redhat.com>
To: Amit Shah <amit.shah@redhat.com>
Cc: virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
stable@vger.kernel.org, rusty@rustcorp.com.au
Subject: Re: [PATCH v2] virtio-rng: fix stuck of hot-unplugging busy device
Date: Wed, 10 Sep 2014 14:12:57 +0800 [thread overview]
Message-ID: <20140910061257.GA30285@zen.redhat.com> (raw)
In-Reply-To: <20140910053454.GA29832@grmbl.mre>
On Wed, Sep 10, 2014 at 11:04:54AM +0530, Amit Shah wrote:
> Hi Amos,
>
> On (Tue) 09 Sep 2014 [19:14:02], Amos Kong wrote:
> > When we try to hot-remove a busy virtio-rng device from QEMU monitor,
> > the device can't be hot-removed. Because virtio-rng driver hangs at
> > wait_for_completion_killable().
> >
> > This patch exits the waiting by completing have_data completion before
> > unregistering, resets data_avail to avoid the hwrng core use wrong
> > buffer bytes. Before real unregistering we should return -ENODEV for
> > reading.
> >
> > When we hot-unplug the device, dd process in guest will exit.
> > $ dd if=/dev/hwrng of=/dev/null
> > dd: error reading ‘/dev/hwrng’: No such device
> >
> > Signed-off-by: Amos Kong <akong@redhat.com>
> > Cc: stable@vger.kernel.org
> > ---
> > V2: reset data_avail (Amit)
> > adjust unregister order
>
> Thanks, this looks good.
>
> Can you please split into two parts, the complete() in one, and the
> hwrng_register_done stuff into another?
I just posted the V3, split to two patches, and updated the commitlog
to describe why we need to return ENODEV for reading.
> Thanks,
>
> Amit
--
Amos.
next prev parent reply other threads:[~2014-09-10 6:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-09 11:14 [PATCH v2] virtio-rng: fix stuck of hot-unplugging busy device Amos Kong
2014-09-09 11:14 ` Amos Kong
2014-09-10 5:34 ` Amit Shah
2014-09-10 5:34 ` Amit Shah
2014-09-10 6:12 ` Amos Kong [this message]
2014-09-10 6:12 ` Amos Kong
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=20140910061257.GA30285@zen.redhat.com \
--to=akong@redhat.com \
--cc=amit.shah@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.