public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Sistare <steven.sistare@oracle.com>
To: Eugenio Perez Martin <eperezma@redhat.com>
Cc: virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	Si-Wei Liu <si-wei.liu@oracle.com>,
	Stefano Garzarella <sgarzare@redhat.com>
Subject: Re: [PATCH V2] vdpa: skip suspend/resume ops if not DRIVER_OK
Date: Tue, 13 Feb 2024 10:06:07 -0500	[thread overview]
Message-ID: <7de12bb2-30ed-4bd1-a9de-2032bcfef686@oracle.com> (raw)
In-Reply-To: <CAJaqyWeE3hE3Mv29TL8K6CHTncexdOZXgD+BoehRCamiGfeBcA@mail.gmail.com>

On 2/13/2024 9:58 AM, Eugenio Perez Martin wrote:
> On Tue, Feb 13, 2024 at 3:26 PM Steve Sistare <steven.sistare@oracle.com> wrote:
>>
>> If a vdpa device is not in state DRIVER_OK, then there is no driver state
>> to preserve, so no need to call the suspend and resume driver ops.
>>
>> Suggested-by: Eugenio Perez Martin <eperezma@redhat.com>"
>> Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
> 
> Reviewed-by: Eugenio Pérez <eperezma@redhat.com>
> 
> Please include a changelog from previous versions for the next series.
> 
> Thanks!

Will do, thanks - steve

>> ---
>>  drivers/vhost/vdpa.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
>> index bc4a51e4638b..aef92a7c57f3 100644
>> --- a/drivers/vhost/vdpa.c
>> +++ b/drivers/vhost/vdpa.c
>> @@ -595,6 +595,9 @@ static long vhost_vdpa_suspend(struct vhost_vdpa *v)
>>         const struct vdpa_config_ops *ops = vdpa->config;
>>         int ret;
>>
>> +       if (!(ops->get_status(vdpa) & VIRTIO_CONFIG_S_DRIVER_OK))
>> +               return 0;
>> +
>>         if (!ops->suspend)
>>                 return -EOPNOTSUPP;
>>
>> @@ -615,6 +618,9 @@ static long vhost_vdpa_resume(struct vhost_vdpa *v)
>>         const struct vdpa_config_ops *ops = vdpa->config;
>>         int ret;
>>
>> +       if (!(ops->get_status(vdpa) & VIRTIO_CONFIG_S_DRIVER_OK))
>> +               return 0;
>> +
>>         if (!ops->resume)
>>                 return -EOPNOTSUPP;
>>
>> --
>> 2.39.3
>>
> 

      reply	other threads:[~2024-02-13 15:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-13 14:25 [PATCH V2] vdpa: skip suspend/resume ops if not DRIVER_OK Steve Sistare
2024-02-13 14:58 ` Eugenio Perez Martin
2024-02-13 15:06   ` Steven Sistare [this message]

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=7de12bb2-30ed-4bd1-a9de-2032bcfef686@oracle.com \
    --to=steven.sistare@oracle.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=sgarzare@redhat.com \
    --cc=si-wei.liu@oracle.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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