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

Commit 84f716c9 authored by Ajay Singh Parmar's avatar Ajay Singh Parmar Committed by Tatenda Chipeperekwa
Browse files

drm/msm/dp: cancel attention work on disconnect



When cable is disconnected, cancel the attention work as well.
Attention work handles all the attention events sent by the
sink device. In that process, it can queue other works based
on the event received. Cancelling attention work makes sure
that the works are not queued further with dp controller powered
off.

Change-Id: I8780bfc5cf76d43e432b00acfdbd7f68e5733bba
Signed-off-by: default avatarAjay Singh Parmar <aparmar@codeaurora.org>
Signed-off-by: default avatarTatenda Chipeperekwa <tatendac@codeaurora.org>
parent f21ec6ba
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -679,6 +679,8 @@ static int dp_display_usbpd_configure_cb(struct device *dev)
			goto end;
	}

	atomic_set(&dp->aborted, 0);

	dp_display_host_init(dp);

	/* check for hpd high and framework ready */
@@ -763,6 +765,7 @@ static int dp_display_usbpd_disconnect_cb(struct device *dev)

	/* wait for idle state */
	cancel_delayed_work(&dp->connect_work);
	cancel_work(&dp->attention_work);
	flush_workqueue(dp->wq);

	dp_display_handle_disconnect(dp);
@@ -770,7 +773,6 @@ static int dp_display_usbpd_disconnect_cb(struct device *dev)
	if (!dp->debug->sim_mode)
		dp->aux->aux_switch(dp->aux, false, ORIENTATION_NONE);

	atomic_set(&dp->aborted, 0);
end:
	return rc;
}
@@ -913,6 +915,7 @@ static int dp_display_usbpd_attention_cb(struct device *dev)

		/* wait for idle state */
		cancel_delayed_work(&dp->connect_work);
		cancel_work(&dp->attention_work);
		flush_workqueue(dp->wq);

		dp_display_handle_disconnect(dp);