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

Commit 938e70f3 authored by Tony Truong's avatar Tony Truong Committed by Gerrit - the friendly Code Review server
Browse files

mhi: core: Track number of failed M2 wakeups



Failed M2 wakeups may represent a serious hardware problem.
The device is refusing to wake up from low power states and all
modem functionality is now stalled.

Track these wakeup attempts.

Change-Id: I3115a4416f85290c5faead0e2d9f280d8cc3b662
Signed-off-by: default avatarAndrei Danaila <adanaila@codeaurora.org>
Signed-off-by: default avatarTony Truong <truong@codeaurora.org>
parent 8211d525
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -385,6 +385,7 @@ struct mhi_counters {
	u32 mhi_ready_cntr;
	u32 mhi_ready_cntr;
	u32 m3_event_timeouts;
	u32 m3_event_timeouts;
	u32 m0_event_timeouts;
	u32 m0_event_timeouts;
	u32 m2_event_timeouts;
	u32 msi_disable_cntr;
	u32 msi_disable_cntr;
	u32 msi_enable_cntr;
	u32 msi_enable_cntr;
	u32 nr_irq_migrations;
	u32 nr_irq_migrations;
+2 −1
Original line number Original line Diff line number Diff line
@@ -914,8 +914,9 @@ int mhi_initiate_m3(struct mhi_device_ctxt *mhi_dev_ctxt)
				mhi_dev_ctxt->mhi_state == MHI_STATE_M1,
				mhi_dev_ctxt->mhi_state == MHI_STATE_M1,
				msecs_to_jiffies(MHI_MAX_RESUME_TIMEOUT));
				msecs_to_jiffies(MHI_MAX_RESUME_TIMEOUT));
		if (0 == r || -ERESTARTSYS == r) {
		if (0 == r || -ERESTARTSYS == r) {
			mhi_log(MHI_MSG_INFO,
			mhi_log(MHI_MSG_CRITICAL,
				"MDM failed to come out of M2.\n");
				"MDM failed to come out of M2.\n");
			mhi_dev_ctxt->counters.m2_event_timeouts++;
			r = -EAGAIN;
			r = -EAGAIN;
			goto exit;
			goto exit;
		}
		}