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

Commit 8680bf0f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "asoc: msm_sdw: Add mutex handling to protect dev_up access"

parents ca854163 8809c6c1
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -323,8 +323,7 @@ static int msm_sdw_ahb_write_device(struct msm_sdw_priv *msm_sdw,
{
	u32 temp = (u32)(*value) & 0x000000FF;

	if (!msm_sdw->dev_up ||
	    !q6core_is_adsp_ready()) {
	if (!msm_sdw->dev_up) {
		dev_err_ratelimited(msm_sdw->dev, "%s: q6 not ready\n",
				    __func__);
		return 0;
@@ -339,8 +338,7 @@ static int msm_sdw_ahb_read_device(struct msm_sdw_priv *msm_sdw,
{
	u32 temp;

	if (!msm_sdw->dev_up ||
	    !q6core_is_adsp_ready()) {
	if (!msm_sdw->dev_up) {
		dev_err_ratelimited(msm_sdw->dev, "%s: q6 not ready\n",
				    __func__);
		return 0;
@@ -1760,8 +1758,8 @@ static int msm_sdw_notifier_service_cb(struct notifier_block *nb,
		}
		mutex_lock(&msm_sdw->cdc_int_mclk1_mutex);
		msm_sdw->int_mclk1_enabled = false;
		mutex_unlock(&msm_sdw->cdc_int_mclk1_mutex);
		msm_sdw->dev_up = false;
		mutex_unlock(&msm_sdw->cdc_int_mclk1_mutex);
		snd_soc_card_change_online_state(
			msm_sdw->codec->component.card, 0);
		for (i = 0; i < msm_sdw->nr; i++)
@@ -1792,7 +1790,9 @@ static int msm_sdw_notifier_service_cb(struct notifier_block *nb,
		}
powerup:
		if (adsp_ready) {
			mutex_lock(&msm_sdw->cdc_int_mclk1_mutex);
			msm_sdw->dev_up = true;
			mutex_unlock(&msm_sdw->cdc_int_mclk1_mutex);
			msm_sdw_init_reg(msm_sdw->codec);
			regcache_mark_dirty(msm_sdw->regmap);
			regcache_sync(msm_sdw->regmap);