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

Commit a7024525 authored by Vevek Venkatesan's avatar Vevek Venkatesan Committed by Gerrit - the friendly Code Review server
Browse files

qcacmn: abort system suspend_noirq if wake-IRQ received

Wake-IRQ can be received just before Kernel issuing
suspend_noirq callback, such wake-IRQ would not be
handled by Kernel. So check if any tasklet most likely
CE2 is pending and abort suspend_noirq if true.

Change-Id: Ie3d6de97179aa0d8f383a086f4f8df27d3fc5254
CRs-Fixed: 2981882
parent 6cb2c309
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -971,18 +971,6 @@ void hif_close(struct hif_opaque_softc *hif_ctx)
	qdf_mem_free(scn);
}

/**
 * hif_get_num_active_tasklets() - get the number of active
 *		tasklets pending to be completed.
 * @scn: HIF context
 *
 * Returns: the number of tasklets which are active
 */
static inline int hif_get_num_active_tasklets(struct hif_softc *scn)
{
	return qdf_atomic_read(&scn->active_tasklet_cnt);
}

/**
 * hif_get_num_active_grp_tasklets() - get the number of active
 *		datapath group tasklets pending to be completed.
+12 −0
Original line number Diff line number Diff line
@@ -307,6 +307,18 @@ void *hif_get_hal_handle(struct hif_opaque_softc *hif_hdl)
	return sc->hal_soc;
}

/**
 * hif_get_num_active_tasklets() - get the number of active
 *		tasklets pending to be completed.
 * @scn: HIF context
 *
 * Returns: the number of tasklets which are active
 */
static inline int hif_get_num_active_tasklets(struct hif_softc *scn)
{
	return qdf_atomic_read(&scn->active_tasklet_cnt);
}

/**
 * Max waiting time during Runtime PM suspend to finish all
 * the tasks. This is in the multiple of 10ms.
+16 −0
Original line number Diff line number Diff line
@@ -373,6 +373,22 @@ int hif_ipci_bus_resume(struct hif_softc *scn)

int hif_ipci_bus_suspend_noirq(struct hif_softc *scn)
{
	/*
	 * If it is system suspend case and wake-IRQ received
	 * just before Kernel issuing suspend_noirq, that must
	 * have scheduled CE2 tasklet, so suspend activity can
	 * be aborted.
	 * Similar scenario for runtime suspend case, would be
	 * handled by hif_pm_runtime_check_and_request_resume
	 * in hif_ce_interrupt_handler.
	 *
	 */
	if (!hif_pm_runtime_get_monitor_wake_intr(GET_HIF_OPAQUE_HDL(scn)) &&
	    hif_get_num_active_tasklets(scn)) {
		hif_err("Tasklets are pending, abort sys suspend_noirq");
		return -EBUSY;
	}

	return 0;
}