* FAILED: Patch "virtio: reenable config if freezing device failed" failed to apply to 6.1-stable tree
@ 2024-03-27 12:12 Sasha Levin
2024-04-10 9:27 ` [PATCH 6.1.y] virtio: reenable config if freezing device failed David Hildenbrand
0 siblings, 1 reply; 3+ messages in thread
From: Sasha Levin @ 2024-03-27 12:12 UTC (permalink / raw)
To: stable, david
Cc: stable, Michael S. Tsirkin, Jason Wang, Xuan Zhuo, virtualization,
linux-kernel
The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From 310227f42882c52356b523e2f4e11690eebcd2ab Mon Sep 17 00:00:00 2001
From: David Hildenbrand <david@redhat.com>
Date: Tue, 13 Feb 2024 14:54:25 +0100
Subject: [PATCH] virtio: reenable config if freezing device failed
Currently, we don't reenable the config if freezing the device failed.
For example, virtio-mem currently doesn't support suspend+resume, and
trying to freeze the device will always fail. Afterwards, the device
will no longer respond to resize requests, because it won't get notified
about config changes.
Let's fix this by re-enabling the config if freezing fails.
Fixes: 22b7050a024d ("virtio: defer config changed notifications")
Cc: <stable@kernel.org>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20240213135425.795001-1-david@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
drivers/virtio/virtio.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
index f4080692b3513..f513ee21b1c18 100644
--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -510,8 +510,10 @@ int virtio_device_freeze(struct virtio_device *dev)
if (drv && drv->freeze) {
ret = drv->freeze(dev);
- if (ret)
+ if (ret) {
+ virtio_config_enable(dev);
return ret;
+ }
}
if (dev->config->destroy_avq)
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH 6.1.y] virtio: reenable config if freezing device failed
2024-03-27 12:12 FAILED: Patch "virtio: reenable config if freezing device failed" failed to apply to 6.1-stable tree Sasha Levin
@ 2024-04-10 9:27 ` David Hildenbrand
2024-04-11 7:44 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: David Hildenbrand @ 2024-04-10 9:27 UTC (permalink / raw)
To: stable; +Cc: David Hildenbrand, stable, Michael S. Tsirkin, Jason Wang,
Xuan Zhuo
Currently, we don't reenable the config if freezing the device failed.
For example, virtio-mem currently doesn't support suspend+resume, and
trying to freeze the device will always fail. Afterwards, the device
will no longer respond to resize requests, because it won't get notified
about config changes.
Let's fix this by re-enabling the config if freezing fails.
Fixes: 22b7050a024d ("virtio: defer config changed notifications")
Cc: <stable@kernel.org>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20240213135425.795001-1-david@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 310227f42882c52356b523e2f4e11690eebcd2ab)
Signed-off-by: David Hildenbrand <david@redhat.com>
---
drivers/virtio/virtio.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
index 828ced060742..1ef094427f29 100644
--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -489,13 +489,19 @@ EXPORT_SYMBOL_GPL(unregister_virtio_device);
int virtio_device_freeze(struct virtio_device *dev)
{
struct virtio_driver *drv = drv_to_virtio(dev->dev.driver);
+ int ret;
virtio_config_disable(dev);
dev->failed = dev->config->get_status(dev) & VIRTIO_CONFIG_S_FAILED;
- if (drv && drv->freeze)
- return drv->freeze(dev);
+ if (drv && drv->freeze) {
+ ret = drv->freeze(dev);
+ if (ret) {
+ virtio_config_enable(dev);
+ return ret;
+ }
+ }
return 0;
}
--
2.44.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 6.1.y] virtio: reenable config if freezing device failed
2024-04-10 9:27 ` [PATCH 6.1.y] virtio: reenable config if freezing device failed David Hildenbrand
@ 2024-04-11 7:44 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2024-04-11 7:44 UTC (permalink / raw)
To: David Hildenbrand
Cc: stable, stable, Michael S. Tsirkin, Jason Wang, Xuan Zhuo
On Wed, Apr 10, 2024 at 11:27:58AM +0200, David Hildenbrand wrote:
> Currently, we don't reenable the config if freezing the device failed.
>
> For example, virtio-mem currently doesn't support suspend+resume, and
> trying to freeze the device will always fail. Afterwards, the device
> will no longer respond to resize requests, because it won't get notified
> about config changes.
>
> Let's fix this by re-enabling the config if freezing fails.
>
> Fixes: 22b7050a024d ("virtio: defer config changed notifications")
> Cc: <stable@kernel.org>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Jason Wang <jasowang@redhat.com>
> Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> Signed-off-by: David Hildenbrand <david@redhat.com>
> Message-Id: <20240213135425.795001-1-david@redhat.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> (cherry picked from commit 310227f42882c52356b523e2f4e11690eebcd2ab)
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
> drivers/virtio/virtio.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
All now queued up,t hanks.
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-04-11 7:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-27 12:12 FAILED: Patch "virtio: reenable config if freezing device failed" failed to apply to 6.1-stable tree Sasha Levin
2024-04-10 9:27 ` [PATCH 6.1.y] virtio: reenable config if freezing device failed David Hildenbrand
2024-04-11 7:44 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.