lkml.org 
[lkml]   [2014]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 10/25] virtio: add API to enable VQs early
On Mon, Oct 13, 2014 at 05:22:39PM +1030, Rusty Russell wrote:
> "Michael S. Tsirkin" <mst@redhat.com> writes:
> > virtio spec 0.9.X requires DRIVER_OK to be set before
> > VQs are used, but some drivers use VQs before probe
> > function returns.
> > Since DRIVER_OK is set after probe, this violates the spec.
> >
> > Even though under virtio 1.0 transitional devices support this
> > behaviour, we want to make it possible for those early callers to become
> > spec compliant and eventually support non-transitional devices.
> >
> > Add API for drivers to call before using VQs.
> >
> > Sets DRIVER_OK internally.
> >
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
>
> OK, this all looks good, but I think we should do two things:
>
> 1) rename virtio_enable_vqs_early() to virtio_device_ready().

I considered this, I was concerned that the usage isn't clear from name:
- this has to be called before VQs are used
- this is optional, happens automatically after probe

device_ready seems to imply driver is fully initialized,
if it was it could just call probe.

But it's easy enough to make the change, so I'll go ahead and
post V4. It will be up to you which one to apply then.

> 2) Add a BUG_ON in the virtio_ring code to make sure device is ready
> before any ops are called.
>
> Cheers,
> Rusty.

On kick? This seems too expensive, especially considering that
we don't track the status.

Anyway, can be a patch on top?

--
MST


\
 
 \ /
  Last update: 2014-10-13 10:03    [W:0.174 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site