Skip to content

Commit abdeb4f

Browse files
benzearichardweinberger
authored andcommitted
um: virtio_uml: move device breaking into workqueue
We should not be calling virtio_break_device from an IRQ context. Move breaking the device into the workqueue so that it is done from a reasonable context. Fixes: af9fb41 ("um: virtio_uml: Fix broken device handling in time-travel") Signed-off-by: Benjamin Berg <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent 8e9cd85 commit abdeb4f

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

arch/um/drivers/virtio_uml.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ static void vhost_user_check_reset(struct virtio_uml_device *vu_dev,
170170

171171
vu_dev->registered = 0;
172172

173-
virtio_break_device(&vu_dev->vdev);
174173
schedule_work(&pdata->conn_broken_wk);
175174
}
176175

@@ -1138,6 +1137,15 @@ void virtio_uml_set_no_vq_suspend(struct virtio_device *vdev,
11381137

11391138
static void vu_of_conn_broken(struct work_struct *wk)
11401139
{
1140+
struct virtio_uml_platform_data *pdata;
1141+
struct virtio_uml_device *vu_dev;
1142+
1143+
pdata = container_of(wk, struct virtio_uml_platform_data, conn_broken_wk);
1144+
1145+
vu_dev = platform_get_drvdata(pdata->pdev);
1146+
1147+
virtio_break_device(&vu_dev->vdev);
1148+
11411149
/*
11421150
* We can't remove the device from the devicetree so the only thing we
11431151
* can do is warn.
@@ -1268,8 +1276,14 @@ static int vu_unregister_cmdline_device(struct device *dev, void *data)
12681276
static void vu_conn_broken(struct work_struct *wk)
12691277
{
12701278
struct virtio_uml_platform_data *pdata;
1279+
struct virtio_uml_device *vu_dev;
12711280

12721281
pdata = container_of(wk, struct virtio_uml_platform_data, conn_broken_wk);
1282+
1283+
vu_dev = platform_get_drvdata(pdata->pdev);
1284+
1285+
virtio_break_device(&vu_dev->vdev);
1286+
12731287
vu_unregister_cmdline_device(&pdata->pdev->dev, NULL);
12741288
}
12751289

0 commit comments

Comments
 (0)