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 @@ -57,6 +57,14 @@ static void virtio_gpu_remove(struct virtio_device *vdev)
57
57
drm_put_dev (dev );
58
58
}
59
59
60
+ static void virtio_gpu_shutdown (struct virtio_device * vdev )
61
+ {
62
+ /*
63
+ * drm does its own synchronization on shutdown.
64
+ * Do nothing here, opt out of device reset.
65
+ */
66
+ }
67
+
60
68
static void virtio_gpu_config_changed (struct virtio_device * vdev )
61
69
{
62
70
struct drm_device * dev = vdev -> priv ;
@@ -88,6 +96,7 @@ static struct virtio_driver virtio_gpu_driver = {
88
96
.id_table = id_table ,
89
97
.probe = virtio_gpu_probe ,
90
98
.remove = virtio_gpu_remove ,
99
+ .shutdown = virtio_gpu_shutdown ,
91
100
.config_changed = virtio_gpu_config_changed
92
101
};
93
102
Original file line number Diff line number Diff line change @@ -300,6 +300,12 @@ static void virtio_dev_shutdown(struct device *_d)
300
300
if (!drv )
301
301
return ;
302
302
303
+ /* If the driver has its own shutdown method, use that. */
304
+ if (drv -> shutdown ) {
305
+ drv -> shutdown (dev );
306
+ return ;
307
+ }
308
+
303
309
/*
304
310
* Some devices get wedged if you kick them after they are
305
311
* reset. Mark all vqs as broken to make sure we don't.
Original file line number Diff line number Diff line change @@ -175,6 +175,8 @@ int virtio_device_restore(struct virtio_device *dev);
175
175
* changes; may be called in interrupt context.
176
176
* @freeze: optional function to call during suspend/hibernation.
177
177
* @restore: optional function to call on resume.
178
+ * @shutdown: synchronize with the device on shutdown. If provided, replaces
179
+ * the virtio core implementation.
178
180
*/
179
181
struct virtio_driver {
180
182
struct device_driver driver ;
@@ -192,6 +194,7 @@ struct virtio_driver {
192
194
int (* freeze )(struct virtio_device * dev );
193
195
int (* restore )(struct virtio_device * dev );
194
196
#endif
197
+ void (* shutdown )(struct virtio_device * dev );
195
198
};
196
199
197
200
static inline struct virtio_driver * drv_to_virtio (struct device_driver * drv )
You can’t perform that action at this time.
0 commit comments