Skip to content

Commit 382a462

Browse files
dcuiSasha Levin
authored andcommitted
video: hyperv_fb: Fix hibernation for the deferred IO feature
fb_deferred_io_work() can access the vmbus ringbuffer by calling fbdefio->deferred_io() -> synthvid_deferred_io() -> synthvid_update(). Because the vmbus ringbuffer is inaccessible between hvfb_suspend() and hvfb_resume(), we must cancel info->deferred_work before calling vmbus_close() and then reschedule it after we reopen the channel in hvfb_resume(). Fixes: a4ddb11 ("video: hyperv: hyperv_fb: Support deferred IO for Hyper-V frame buffer driver") Fixes: 824946a ("video: hyperv_fb: Add the support of hibernation") Signed-off-by: Dexuan Cui <[email protected]> Reviewed-by: Wei Hu <[email protected]> Acked-by: Bartlomiej Zolnierkiewicz <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent e2379b3 commit 382a462

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/video/fbdev/hyperv_fb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,6 +1194,7 @@ static int hvfb_suspend(struct hv_device *hdev)
11941194
fb_set_suspend(info, 1);
11951195

11961196
cancel_delayed_work_sync(&par->dwork);
1197+
cancel_delayed_work_sync(&info->deferred_work);
11971198

11981199
par->update_saved = par->update;
11991200
par->update = false;
@@ -1227,6 +1228,7 @@ static int hvfb_resume(struct hv_device *hdev)
12271228
par->fb_ready = true;
12281229
par->update = par->update_saved;
12291230

1231+
schedule_delayed_work(&info->deferred_work, info->fbdefio->delay);
12301232
schedule_delayed_work(&par->dwork, HVFB_UPDATE_DELAY);
12311233

12321234
/* 0 means do resume */

0 commit comments

Comments
 (0)