Skip to content

Commit

Permalink
video: hyperv_fb: Fix hibernation for the deferred IO feature
Browse files Browse the repository at this point in the history
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 <decui@microsoft.com>
Reviewed-by: Wei Hu <weh@microsoft.com>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Dexuan Cui authored and Sasha Levin committed Jan 25, 2020
1 parent e2379b3 commit 382a462
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/video/fbdev/hyperv_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,7 @@ static int hvfb_suspend(struct hv_device *hdev)
fb_set_suspend(info, 1);

cancel_delayed_work_sync(&par->dwork);
cancel_delayed_work_sync(&info->deferred_work);

par->update_saved = par->update;
par->update = false;
Expand Down Expand Up @@ -1227,6 +1228,7 @@ static int hvfb_resume(struct hv_device *hdev)
par->fb_ready = true;
par->update = par->update_saved;

schedule_delayed_work(&info->deferred_work, info->fbdefio->delay);
schedule_delayed_work(&par->dwork, HVFB_UPDATE_DELAY);

/* 0 means do resume */
Expand Down

0 comments on commit 382a462

Please sign in to comment.