From: Greg Kroah-Hartman Date: Thu, 11 Apr 2024 07:51:05 +0000 (+0200) Subject: 6.1-stable patches X-Git-Tag: v4.19.312~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dbe3e56919ee40697548a83fa7bdf025a553c22b;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: virtio-reenable-config-if-freezing-device-failed.patch --- diff --git a/queue-6.1/series b/queue-6.1/series index 9aecfe73a60..f6afdfc4c9d 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -74,3 +74,4 @@ gcc-plugins-stackleak-avoid-.head.text-section.patch revert-scsi-sd-usb_storage-uas-access-media-prior-to-querying-device-properties.patch revert-scsi-core-add-struct-for-args-to-execution-functions.patch scsi-sd-usb_storage-uas-access-media-prior-to-querying-device-properties.patch +virtio-reenable-config-if-freezing-device-failed.patch diff --git a/queue-6.1/virtio-reenable-config-if-freezing-device-failed.patch b/queue-6.1/virtio-reenable-config-if-freezing-device-failed.patch new file mode 100644 index 00000000000..c8afa07b91f --- /dev/null +++ b/queue-6.1/virtio-reenable-config-if-freezing-device-failed.patch @@ -0,0 +1,55 @@ +From 310227f42882c52356b523e2f4e11690eebcd2ab Mon Sep 17 00:00:00 2001 +From: David Hildenbrand +Date: Tue, 13 Feb 2024 14:54:25 +0100 +Subject: virtio: reenable config if freezing device failed + +From: David Hildenbrand + +commit 310227f42882c52356b523e2f4e11690eebcd2ab upstream. + +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: +Cc: "Michael S. Tsirkin" +Cc: Jason Wang +Cc: Xuan Zhuo +Signed-off-by: David Hildenbrand +Message-Id: <20240213135425.795001-1-david@redhat.com> +Signed-off-by: Michael S. Tsirkin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/virtio/virtio.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +--- a/drivers/virtio/virtio.c ++++ b/drivers/virtio/virtio.c +@@ -489,13 +489,19 @@ EXPORT_SYMBOL_GPL(unregister_virtio_devi + 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; + }