linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xianting Tian <xianting.tian@linux.alibaba.com>
To: Jason Wang <jasowang@redhat.com>,
	stefanha@redhat.com, sgarzare@redhat.com, davem@davemloft.net,
	kuba@kernel.org
Cc: kvm@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] vsock/virtio: set vsock frontend ready in virtio_vsock_probe()
Date: Tue, 20 Jul 2021 16:36:53 +0800	[thread overview]
Message-ID: <56bae568-34fc-4377-77cd-d3cf9f38a772@linux.alibaba.com> (raw)
In-Reply-To: <87deb4ff-c4f9-0a5e-e349-c1a8682a864e@redhat.com>

thanks for the findings.

Let me make furture patches to make consistent.

在 2021/7/20 下午3:54, Jason Wang 写道:
>
> 在 2021/7/20 下午3:13, Xianting Tian 写道:
>> Add the missed virtio_device_ready() to set vsock frontend ready.
>>
>> Signed-off-by: Xianting Tian <xianting.tian@linux.alibaba.com>
>> ---
>>   net/vmw_vsock/virtio_transport.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/net/vmw_vsock/virtio_transport.c 
>> b/net/vmw_vsock/virtio_transport.c
>> index e0c2c992a..dc834b8fd 100644
>> --- a/net/vmw_vsock/virtio_transport.c
>> +++ b/net/vmw_vsock/virtio_transport.c
>> @@ -639,6 +639,8 @@ static int virtio_vsock_probe(struct 
>> virtio_device *vdev)
>>         mutex_unlock(&the_virtio_vsock_mutex);
>>   +    virtio_device_ready(vdev);
>> +
>>       return 0;
>>     out:
>
>
> Just notice this:
>
> commit 5b40a7daf51812b35cf05d1601a779a7043f8414
> Author: Rusty Russell <rusty@rustcorp.com.au>
> Date:   Tue Feb 17 16:12:44 2015 +1030
>
>     virtio: don't set VIRTIO_CONFIG_S_DRIVER_OK twice.
>
>     I noticed this with the console device.  It's not *wrong*, just a bit
>     weird.
>
>     Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
>
> diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
> index b9f70dfc4751..5ce2aa48fc6e 100644
> --- a/drivers/virtio/virtio.c
> +++ b/drivers/virtio/virtio.c
> @@ -236,7 +236,10 @@ static int virtio_dev_probe(struct device *_d)
>         if (err)
>                 goto err;
>
> -       add_status(dev, VIRTIO_CONFIG_S_DRIVER_OK);
> +       /* If probe didn't do it, mark device DRIVER_OK ourselves. */
> +       if (!(dev->config->get_status(dev) & VIRTIO_CONFIG_S_DRIVER_OK))
> +               virtio_device_ready(dev);
> +
>         if (drv->scan)
>                 drv->scan(dev);
>
> So I think we need to be consistent: switch to use 
> virtio_device_ready() for all the drivers, and then we can remove this 
> step and warn if (DRIVER_OK) is not set.
>
> Thanks

  reply	other threads:[~2021-07-20  8:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20  7:13 [PATCH v2] vsock/virtio: set vsock frontend ready in virtio_vsock_probe() Xianting Tian
2021-07-20  7:54 ` Jason Wang
2021-07-20  8:36   ` Xianting Tian [this message]
2021-07-20 10:23 ` Stefan Hajnoczi
2021-07-20 10:56   ` Xianting Tian
2021-07-20 11:05   ` Xianting Tian
2021-07-20 13:12     ` Stefan Hajnoczi
2021-07-21  1:30       ` Xianting Tian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56bae568-34fc-4377-77cd-d3cf9f38a772@linux.alibaba.com \
    --to=xianting.tian@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=jasowang@redhat.com \
    --cc=kuba@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sgarzare@redhat.com \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).