Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2390483ioo; Sat, 28 May 2022 12:08:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfH0JDMKbkezmdG8+Gou80tvSK4lr1lYNIG0JhnGvg0bVW1OLJhOF01PlAlECPMBEZJeUb X-Received: by 2002:a17:90b:3902:b0:1e0:50ef:3ff3 with SMTP id ob2-20020a17090b390200b001e050ef3ff3mr14538635pjb.137.1653764925152; Sat, 28 May 2022 12:08:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653764925; cv=none; d=google.com; s=arc-20160816; b=ZZQLYaW7qM9nO+Fum+bJZu3AGr2oorBZPki/mdIuLIqA3QBREeHiImVb1EScGdTjmd LdkVp2qJaOtuWy163c5s3mSqqkmV5vjV5V6noqs6DtQJwVM5p67t/rSe6ZO17SpUmJmu V8J6pAUngm9ZIW2PB96vNHq8fv3JjyUoQzLdTkrmLcEvMB3FE9WO1KHJXY0f5PoV/yot fETf+DCbhp9xks2cpsjEViDXRmNlxCl3HSGX8gn5qfmUM7ge8++LhqO0IltxcRJv6mOA VXMUqplKcchXDax70d/FmtM1j7oODGYpv3Av5VznUKXf1mlq6berjr4otMz3aA0Ym38Q LfVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:cc:to:from:date:subject :message-id; bh=gg1D63nzohfCr+FCnF0zmXCdFNvQ3JgReqe/H0ywI5A=; b=dUq4G9JDtTJ8gyELHefdRjlE9WwnceaJPfMTro12I0kaSmxt5DFK3WYKkpbQe5PC1P AZiefDYKMOM2wOTxt6J7UrY+a7QU+jff98y1R+SgdINwgaKGJW1hapHRTOs0fS9CHKoD pJLdK842wOXZKaqN5y/tl8jYUCD1Wa2tWBMM/D4aP3sQAhqAWhI9c2y8q8R+sa5tys04 kk8NrikvcO9qKJVBPiz42hQfhA9oGv4tQa0t0CPuGWFi53oS7iWUVW3kdsfUSy7vyhjE xNibhc/gmLIPGWSY1U8S5fBuJIF7aMpQCKsWY0MA7XpvxWOTOPWjLuV87vI52R3tN1ul SSZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id l3-20020a170903244300b00154c1348e40si11204697pls.497.2022.05.28.12.08.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 12:08:45 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D7CF31EEF8; Sat, 28 May 2022 11:46:58 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346335AbiE0H36 (ORCPT + 99 others); Fri, 27 May 2022 03:29:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232620AbiE0H3y (ORCPT ); Fri, 27 May 2022 03:29:54 -0400 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5434FED736; Fri, 27 May 2022 00:29:53 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=xuanzhuo@linux.alibaba.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---0VEW4LRq_1653636588; Received: from localhost(mailfrom:xuanzhuo@linux.alibaba.com fp:SMTPD_---0VEW4LRq_1653636588) by smtp.aliyun-inc.com(127.0.0.1); Fri, 27 May 2022 15:29:49 +0800 Message-ID: <1653636572.3092504-1-xuanzhuo@linux.alibaba.com> Subject: Re: [PATCH V6 1/9] virtio: use virtio_device_ready() in virtio_device_restore() Date: Fri, 27 May 2022 15:29:32 +0800 From: Xuan Zhuo To: Jason Wang Cc: tglx@linutronix.de, peterz@infradead.org, paulmck@kernel.org, maz@kernel.org, pasic@linux.ibm.com, cohuck@redhat.com, eperezma@redhat.com, lulu@redhat.com, sgarzare@redhat.com, Vineeth Vijayan , Peter Oberparleiter , linux-s390@vger.kernel.org, mst@redhat.com, jasowang@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <20220527060120.20964-1-jasowang@redhat.com> <20220527060120.20964-2-jasowang@redhat.com> In-Reply-To: <20220527060120.20964-2-jasowang@redhat.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 27 May 2022 14:01:12 +0800, Jason Wang wrote: > From: Stefano Garzarella > > It will allow us to do extension on virtio_device_ready() without > duplicating code. > > 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 > Reviewed-by: Cornelia Huck > Signed-off-by: Stefano Garzarella > Signed-off-by: Jason Wang Reviewed-by: Xuan Zhuo > --- > drivers/virtio/virtio.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c > index ce424c16997d..938e975029d4 100644 > --- a/drivers/virtio/virtio.c > +++ b/drivers/virtio/virtio.c > @@ -526,8 +526,9 @@ int virtio_device_restore(struct virtio_device *dev) > goto err; > } > > - /* Finally, tell the device we're all set */ > - virtio_add_status(dev, VIRTIO_CONFIG_S_DRIVER_OK); > + /* If restore didn't do it, mark device DRIVER_OK ourselves. */ > + if (!(dev->config->get_status(dev) & VIRTIO_CONFIG_S_DRIVER_OK)) > + virtio_device_ready(dev); > > virtio_config_enable(dev); > > -- > 2.25.1 >