Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d60da45 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drm/msm/sde: make sure all locks are acquired during lastclose"

parents 6b72d6ea ec0b11a3
Loading
Loading
Loading
Loading
+25 −9
Original line number Diff line number Diff line
@@ -990,7 +990,7 @@ static void msm_lastclose(struct drm_device *dev)
	struct msm_drm_private *priv = dev->dev_private;
	struct msm_kms *kms = priv->kms;
	struct drm_modeset_acquire_ctx ctx;
	int i;
	int i, rc;

	/*
	 * clean up vblank disable immediately as this is the last close.
@@ -1008,16 +1008,32 @@ static void msm_lastclose(struct drm_device *dev)

	if (priv->fbdev) {
		drm_fb_helper_restore_fbdev_mode_unlocked(priv->fbdev);
	} else {
		return;
	}

	drm_modeset_acquire_init(&ctx, 0);
		drm_modeset_lock_all_ctx(dev, &ctx);
		msm_disable_all_modes(dev, &ctx);
retry:
	rc = drm_modeset_lock_all_ctx(dev, &ctx);
	if (rc)
		goto fail;

	rc = msm_disable_all_modes(dev, &ctx);
	if (rc)
		goto fail;

	if (kms && kms->funcs && kms->funcs->lastclose)
		kms->funcs->lastclose(kms, &ctx);

fail:
	if (rc == -EDEADLK) {
		drm_modeset_backoff(&ctx);
		goto retry;
	} else if (rc) {
		pr_err("last close failed: %d\n", rc);
	}
	drm_modeset_drop_locks(&ctx);
	drm_modeset_acquire_fini(&ctx);
}
}

static irqreturn_t msm_irq(int irq, void *arg)
{