From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [PATCH v3 10/25] virtio: add API to enable VQs early Date: Mon, 13 Oct 2014 17:22:39 +1030 Message-ID: <8738asea14.fsf@rustcorp.com.au> References: <1413114332-626-1-git-send-email-mst@redhat.com> <1413114332-626-11-git-send-email-mst@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, kvm@vger.kernel.org, Christian Borntraeger , netdev@vger.kernel.org, virtualization@lists.linux-foundation.org, Paolo Bonzini , Amit Shah , v9fs-developer@lists.sourceforge.net, "David S. Miller" To: "Michael S. Tsirkin" , linux-kernel@vger.kernel.org Return-path: In-Reply-To: <1413114332-626-11-git-send-email-mst@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org List-Id: netdev.vger.kernel.org "Michael S. Tsirkin" 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 > Reviewed-by: Cornelia Huck OK, this all looks good, but I think we should do two things: 1) rename virtio_enable_vqs_early() to virtio_device_ready(). 2) Add a BUG_ON in the virtio_ring code to make sure device is ready before any ops are called. Cheers, Rusty.