File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,14 @@ static void virtio_gpu_remove(struct virtio_device *vdev)
125
125
drm_dev_put (dev );
126
126
}
127
127
128
+ static void virtio_gpu_shutdown (struct virtio_device * vdev )
129
+ {
130
+ /*
131
+ * drm does its own synchronization on shutdown.
132
+ * Do nothing here, opt out of device reset.
133
+ */
134
+ }
135
+
128
136
static void virtio_gpu_config_changed (struct virtio_device * vdev )
129
137
{
130
138
struct drm_device * dev = vdev -> priv ;
@@ -159,6 +167,7 @@ static struct virtio_driver virtio_gpu_driver = {
159
167
.id_table = id_table ,
160
168
.probe = virtio_gpu_probe ,
161
169
.remove = virtio_gpu_remove ,
170
+ .shutdown = virtio_gpu_shutdown ,
162
171
.config_changed = virtio_gpu_config_changed
163
172
};
164
173
Original file line number Diff line number Diff line change @@ -407,6 +407,12 @@ static void virtio_dev_shutdown(struct device *_d)
407
407
if (!drv )
408
408
return ;
409
409
410
+ /* If the driver has its own shutdown method, use that. */
411
+ if (drv -> shutdown ) {
412
+ drv -> shutdown (dev );
413
+ return ;
414
+ }
415
+
410
416
/*
411
417
* Some devices get wedged if you kick them after they are
412
418
* reset. Mark all vqs as broken to make sure we don't.
Original file line number Diff line number Diff line change @@ -220,6 +220,8 @@ size_t virtio_max_dma_size(const struct virtio_device *vdev);
220
220
* occurs.
221
221
* @reset_done: optional function to call after transport specific reset
222
222
* operation has finished.
223
+ * @shutdown: synchronize with the device on shutdown. If provided, replaces
224
+ * the virtio core implementation.
223
225
*/
224
226
struct virtio_driver {
225
227
struct device_driver driver ;
@@ -237,6 +239,7 @@ struct virtio_driver {
237
239
int (* restore )(struct virtio_device * dev );
238
240
int (* reset_prepare )(struct virtio_device * dev );
239
241
int (* reset_done )(struct virtio_device * dev );
242
+ void (* shutdown )(struct virtio_device * dev );
240
243
};
241
244
242
245
#define drv_to_virtio (__drv ) container_of_const(__drv, struct virtio_driver, driver)
You can’t perform that action at this time.
0 commit comments