public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org
Subject: Re: [PATCH] virtio_balloon: set DRIVER_OK before using device
Date: Thu, 5 Mar 2015 09:39:05 +0100	[thread overview]
Message-ID: <20150305083905.GA11474@redhat.com> (raw)
In-Reply-To: <877fuwjgqw.fsf@rustcorp.com.au>

On Thu, Mar 05, 2015 at 01:24:47PM +1030, Rusty Russell wrote:
> "Michael S. Tsirkin" <mst@redhat.com> writes:
> > virtio spec requires that all drivers set DRIVER_OK
> > before using devices. While balloon isn't yet
> > included in the virtio 1 spec, previous spec versions
> > also required this.
> >
> > virtio balloon might violate this rule: probe calls
> > kthread_run before setting DRIVER_OK, which might run
> > immediately and cause balloon to inflate/deflate.
> >
> > To fix, call virtio_device_ready before running the kthread.
> >
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> 
> Replied, CC'd stable.

Did you mean applied?

> Thanks,
> Rusty.
> 
> 
> > ---
> >  drivers/virtio/virtio_balloon.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
> > index 5a6ad6d..6a356e3 100644
> > --- a/drivers/virtio/virtio_balloon.c
> > +++ b/drivers/virtio/virtio_balloon.c
> > @@ -508,6 +508,8 @@ static int virtballoon_probe(struct virtio_device *vdev)
> >  	if (err < 0)
> >  		goto out_oom_notify;
> >  
> > +	virtio_device_ready(vdev);
> > +
> >  	vb->thread = kthread_run(balloon, vb, "vballoon");
> >  	if (IS_ERR(vb->thread)) {
> >  		err = PTR_ERR(vb->thread);
> > -- 
> > MST

  reply	other threads:[~2015-03-05  8:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04 13:14 [PATCH] virtio_balloon: set DRIVER_OK before using device Michael S. Tsirkin
2015-03-05  2:54 ` Rusty Russell
2015-03-05  8:39   ` Michael S. Tsirkin [this message]
2015-03-09  7:03     ` Rusty Russell

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=20150305083905.GA11474@redhat.com \
    --to=mst@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox