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

Commit 6823d262 authored by Ajay Singh Parmar's avatar Ajay Singh Parmar
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.

CRs-Fixed: 2216312
Change-Id: I8780bfc5cf76d43e432b00acfdbd7f68e5733bba
Signed-off-by: default avatarAjay Singh Parmar <aparmar@codeaurora.org>
parent 34e1614a
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -610,6 +610,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 */
@@ -694,10 +696,10 @@ 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);
	atomic_set(&dp->aborted, 0);
end:
	return rc;
}
@@ -801,6 +803,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);