Skip to contentSkip to conversation

drm/hyperv: Don't overwrite dirt_needed value set by host

PATCH Applied Saurabh Sengar 2 participants 2 messages May 8, 2023 – May 12, 2023 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/hyperv: Don't overwrite dirt_needed value set by host

[ Upstream commit 19b5e6659eaf537ebeac90ae30c7df0296fe5ab9 ]

Existing code is causing a race condition where dirt_needed value is already set by the host and gets overwritten with default value. Remove this default setting of dirt_needed, to avoid overwriting the value received in the channel callback set by vmbus_open. Removing this setting also means the default value for dirt_needed is changed to false as it's allocated by kzalloc which is similar to legacy hyperv_fb driver.

---
 drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/hyperv/hyperv_drm_drv.c +0 -2
index 00e53de4812b..584d3a73db96 100644
@@ -198,8 +198,6 @@ static int hyperv_vmbus_probe(struct hv_device *hdev,
 	if (ret)
 		drm_warn(dev, "Failed to update vram location.\n");
 
-	hv->dirt_needed = true;
-
 	ret = hyperv_mode_config_init(hv);
 	if (ret)
 		goto err_vmbus_close;
Signature · 1 line
2.34.1
maintainer Applied
#1 lore raw
Quoted 9 lines · Saurabh Sengar

[ Upstream commit 19b5e6659eaf537ebeac90ae30c7df0296fe5ab9 ]

Existing code is causing a race condition where dirt_needed value is already set by the host and gets overwritten with default value. Remove this default setting of dirt_needed, to avoid overwriting the value received in the channel callback set by vmbus_open. Removing this setting also means the default value for dirt_needed is changed to false as it's allocated by kzalloc which is similar to legacy hyperv_fb driver.

Quoted 3 lines

Queued up, thanks!

Signature · 2 lines
Thanks,
Sasha