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

Commit 74041210 authored by Bhalchandra Gajare's avatar Bhalchandra Gajare
Browse files

ASoC: wcd_cpe_core: Perform irq cleanup once the bus is up



During subsystem restart, it is possible that while the underlying bus
is down, the irq driver has already performed its cleanup. In such case,
when CPE driver requests to cleanup its own irq, the irq driver attempts
to hold an lock that is already freed. Fix this issue by performing the
CPE driver irq cleanup after bus is up rather than when bus is down.

CRs-fixed: 948899
Change-Id: I2772e89bbdc855baa9fcf7a34a9c16f2f5c05c32
Signed-off-by: default avatarBhalchandra Gajare <gajare@codeaurora.org>
parent 2f867742
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -881,6 +881,13 @@ static int wcd_cpe_enable(struct wcd_cpe_core *core,
			 * instead SSR handler will control CPE.
			 */
			wcd_cpe_enable_cpe_clks(core, false);
			/*
			 * During BUS_DOWN event, possibly the
			 * irq driver is under cleanup, do not request
			 * cleanup of irqs here, rather cleanup irqs
			 * once BUS_UP event is received.
			 */
			if (core->ssr_type != WCD_CPE_BUS_DOWN_EVENT)
				wcd_cpe_cleanup_irqs(core);
			goto done;
		}
@@ -1133,6 +1140,7 @@ int wcd_cpe_ssr_event(void *core_handle,
		break;

	case WCD_CPE_BUS_UP_EVENT:
		wcd_cpe_cleanup_irqs(core);
		wcd_cpe_set_and_complete(core, WCD_CPE_BUS_READY);
		/*
		 * In case of bus up event ssr_type will be changed