File tree 3 files changed +18
-0
lines changed 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,14 @@ static void virtio_gpu_remove(struct virtio_device *vdev)
128
128
drm_dev_put (dev );
129
129
}
130
130
131
+ static void virtio_gpu_shutdown (struct virtio_device * vdev )
132
+ {
133
+ /*
134
+ * drm does its own synchronization on shutdown.
135
+ * Do nothing here, opt out of device reset.
136
+ */
137
+ }
138
+
131
139
static void virtio_gpu_config_changed (struct virtio_device * vdev )
132
140
{
133
141
struct drm_device * dev = vdev -> priv ;
@@ -162,6 +170,7 @@ static struct virtio_driver virtio_gpu_driver = {
162
170
.id_table = id_table ,
163
171
.probe = virtio_gpu_probe ,
164
172
.remove = virtio_gpu_remove ,
173
+ .shutdown = virtio_gpu_shutdown ,
165
174
.config_changed = virtio_gpu_config_changed
166
175
};
167
176
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