From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [PATCH] virtio_rpmsg: set DRIVER_OK before using device Date: Thu, 12 Mar 2015 11:35:49 +1030 Message-ID: <877funxbwy.fsf@rustcorp.com.au> References: <1425754898-32707-1-git-send-email-mst@redhat.com> <20150309084101.GC22567@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: 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 To: Ohad Ben-Cohen , "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org, "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , virtualization List-Id: virtualization@lists.linuxfoundation.org Ohad Ben-Cohen writes: > On Mon, Mar 9, 2015 at 10:41 AM, Michael S. Tsirkin wrote: >> On Sat, Mar 07, 2015 at 08:06:56PM +0100, Michael S. Tsirkin wrote: >>> virtio spec requires that all drivers set DRIVER_OK >>> before using devices. While rpmsg isn't yet >>> included in the virtio 1 spec, previous spec versions >>> also required this. >>> >>> virtio rpmsg violates this rule: is calls kick >>> before setting DRIVER_OK. >>> >>> The fix isn't trivial since simply calling virtio_device_ready earlier >>> would mean we might get an interrupt in parallel with adding buffers. >>> >>> Instead, split kick out to prepare+notify calls. prepare before >>> virtio_device_ready - when we know we won't get interrupts. notify right >>> afterwards. >>> >>> Signed-off-by: Michael S. Tsirkin >>> --- >> >> Ohad, can you review and ack pls? > > Sure, > > Acked-by: Ohad Ben-Cohen Applied. Thanks, Rusty. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751622AbbCLBPa (ORCPT ); Wed, 11 Mar 2015 21:15:30 -0400 Received: from ozlabs.org ([103.22.144.67]:42327 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750957AbbCLBP1 (ORCPT ); Wed, 11 Mar 2015 21:15:27 -0400 From: Rusty Russell To: Ohad Ben-Cohen , "Michael S. Tsirkin" Cc: "linux-kernel\@vger.kernel.org" , virtualization , "kvm\@vger.kernel.org" , qemu-devel@nongnu.org Subject: Re: [PATCH] virtio_rpmsg: set DRIVER_OK before using device In-Reply-To: References: <1425754898-32707-1-git-send-email-mst@redhat.com> <20150309084101.GC22567@redhat.com> User-Agent: Notmuch/0.17 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Thu, 12 Mar 2015 11:35:49 +1030 Message-ID: <877funxbwy.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ohad Ben-Cohen writes: > On Mon, Mar 9, 2015 at 10:41 AM, Michael S. Tsirkin wrote: >> On Sat, Mar 07, 2015 at 08:06:56PM +0100, Michael S. Tsirkin wrote: >>> virtio spec requires that all drivers set DRIVER_OK >>> before using devices. While rpmsg isn't yet >>> included in the virtio 1 spec, previous spec versions >>> also required this. >>> >>> virtio rpmsg violates this rule: is calls kick >>> before setting DRIVER_OK. >>> >>> The fix isn't trivial since simply calling virtio_device_ready earlier >>> would mean we might get an interrupt in parallel with adding buffers. >>> >>> Instead, split kick out to prepare+notify calls. prepare before >>> virtio_device_ready - when we know we won't get interrupts. notify right >>> afterwards. >>> >>> Signed-off-by: Michael S. Tsirkin >>> --- >> >> Ohad, can you review and ack pls? > > Sure, > > Acked-by: Ohad Ben-Cohen Applied. Thanks, Rusty. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVrim-0003lm-95 for qemu-devel@nongnu.org; Wed, 11 Mar 2015 21:15:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVrij-0003lw-3x for qemu-devel@nongnu.org; Wed, 11 Mar 2015 21:15:32 -0400 Received: from ozlabs.org ([103.22.144.67]:35356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVrii-0003jI-OG for qemu-devel@nongnu.org; Wed, 11 Mar 2015 21:15:29 -0400 From: Rusty Russell In-Reply-To: References: <1425754898-32707-1-git-send-email-mst@redhat.com> <20150309084101.GC22567@redhat.com> Date: Thu, 12 Mar 2015 11:35:49 +1030 Message-ID: <877funxbwy.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] virtio_rpmsg: set DRIVER_OK before using device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ohad Ben-Cohen , "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org, "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , virtualization Ohad Ben-Cohen writes: > On Mon, Mar 9, 2015 at 10:41 AM, Michael S. Tsirkin wrote: >> On Sat, Mar 07, 2015 at 08:06:56PM +0100, Michael S. Tsirkin wrote: >>> virtio spec requires that all drivers set DRIVER_OK >>> before using devices. While rpmsg isn't yet >>> included in the virtio 1 spec, previous spec versions >>> also required this. >>> >>> virtio rpmsg violates this rule: is calls kick >>> before setting DRIVER_OK. >>> >>> The fix isn't trivial since simply calling virtio_device_ready earlier >>> would mean we might get an interrupt in parallel with adding buffers. >>> >>> Instead, split kick out to prepare+notify calls. prepare before >>> virtio_device_ready - when we know we won't get interrupts. notify right >>> afterwards. >>> >>> Signed-off-by: Michael S. Tsirkin >>> --- >> >> Ohad, can you review and ack pls? > > Sure, > > Acked-by: Ohad Ben-Cohen Applied. Thanks, Rusty.