From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 502B9C433FE for ; Mon, 30 May 2022 15:51:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236970AbiE3Pu5 (ORCPT ); Mon, 30 May 2022 11:50:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242893AbiE3Pu1 (ORCPT ); Mon, 30 May 2022 11:50:27 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B21D56F492 for ; Mon, 30 May 2022 08:15:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653923751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=12VfNwWXDrykTTd5k3EIeimf5dPLnKOI2VkXPTFFsm4=; b=dUkqr2tB/xOWzGRrcw9gfwd2Zq4MN+QPBi+uxIctXqEqWq4sd2XeJUEHOYAg0Dqp90JRMk 8708OXZrdcH9B8b2IiIgW2ymK7wGqvJ4v062R0clQhTu2HKeJr2UAdmN1TrgrMLewWSqJC KgavOxMazuA6tmwmyVILn2gfFM/0VRs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-279--p11x1JpOUyGCym6hs50Cw-1; Mon, 30 May 2022 11:15:50 -0400 X-MC-Unique: -p11x1JpOUyGCym6hs50Cw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 266B0811E80; Mon, 30 May 2022 15:15:50 +0000 (UTC) Received: from localhost (unknown [10.39.194.233]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C428F40CF8EE; Mon, 30 May 2022 15:15:49 +0000 (UTC) From: Cornelia Huck To: Jason Wang , mst@redhat.com, jasowang@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, peterz@infradead.org, paulmck@kernel.org, maz@kernel.org, pasic@linux.ibm.com, eperezma@redhat.com, lulu@redhat.com, sgarzare@redhat.com, xuanzhuo@linux.alibaba.com, Vineeth Vijayan , Peter Oberparleiter , linux-s390@vger.kernel.org Subject: Re: [PATCH V6 7/9] virtio: allow to unbreak virtqueue In-Reply-To: <20220527060120.20964-8-jasowang@redhat.com> Organization: Red Hat GmbH References: <20220527060120.20964-1-jasowang@redhat.com> <20220527060120.20964-8-jasowang@redhat.com> User-Agent: Notmuch/0.34 (https://notmuchmail.org) Date: Mon, 30 May 2022 17:15:48 +0200 Message-ID: <87v8tnt5jv.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 27 2022, Jason Wang wrote: > This patch allows the new introduced __virtio_break_device() to > unbreak the virtqueue. > > Cc: Thomas Gleixner > Cc: Peter Zijlstra > Cc: "Paul E. McKenney" > Cc: Marc Zyngier > Cc: Halil Pasic > Cc: Cornelia Huck > Cc: Vineeth Vijayan > Cc: Peter Oberparleiter > Cc: linux-s390@vger.kernel.org > Signed-off-by: Jason Wang > --- > drivers/virtio/virtio_ring.c | 22 ++++++++++++++++++++++ > include/linux/virtio.h | 1 + > 2 files changed, 23 insertions(+) > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > index 9d0bae4293be..9c231e1fded7 100644 > --- a/drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -2395,6 +2395,28 @@ void virtio_break_device(struct virtio_device *dev) > } > EXPORT_SYMBOL_GPL(virtio_break_device); > > +/* > + * This should allow the device to be used by the driver. You may > + * need to grab appropriate locks to flush the write to > + * vq->broken. This should only be used in some specific case e.g > + * (probing and restoring). This function should only be called by the Minor: "...some specific cases, e.g. probing and restoring." But no need to respin from my side. > + * core, not directly by the driver. > + */ Reviewed-by: Cornelia Huck