提交 8aa62dc7 编写于 作者: C Charles Keepax 提交者: Greg Kroah-Hartman

ASoC: wm_adsp: Add locking to wm_adsp2_bus_error

[ Upstream commit a2225a6d155fcb247fe4c6d87f7c91807462966d ]

Best to lock across handling the bus error to ensure the DSP doesn't
change power state as we are reading the status registers.
Signed-off-by: NCharles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
上级 2ece73fe
...@@ -3819,11 +3819,13 @@ irqreturn_t wm_adsp2_bus_error(struct wm_adsp *dsp) ...@@ -3819,11 +3819,13 @@ irqreturn_t wm_adsp2_bus_error(struct wm_adsp *dsp)
struct regmap *regmap = dsp->regmap; struct regmap *regmap = dsp->regmap;
int ret = 0; int ret = 0;
mutex_lock(&dsp->pwr_lock);
ret = regmap_read(regmap, dsp->base + ADSP2_LOCK_REGION_CTRL, &val); ret = regmap_read(regmap, dsp->base + ADSP2_LOCK_REGION_CTRL, &val);
if (ret) { if (ret) {
adsp_err(dsp, adsp_err(dsp,
"Failed to read Region Lock Ctrl register: %d\n", ret); "Failed to read Region Lock Ctrl register: %d\n", ret);
return IRQ_HANDLED; goto error;
} }
if (val & ADSP2_WDT_TIMEOUT_STS_MASK) { if (val & ADSP2_WDT_TIMEOUT_STS_MASK) {
...@@ -3842,7 +3844,7 @@ irqreturn_t wm_adsp2_bus_error(struct wm_adsp *dsp) ...@@ -3842,7 +3844,7 @@ irqreturn_t wm_adsp2_bus_error(struct wm_adsp *dsp)
adsp_err(dsp, adsp_err(dsp,
"Failed to read Bus Err Addr register: %d\n", "Failed to read Bus Err Addr register: %d\n",
ret); ret);
return IRQ_HANDLED; goto error;
} }
adsp_err(dsp, "bus error address = 0x%x\n", adsp_err(dsp, "bus error address = 0x%x\n",
...@@ -3855,7 +3857,7 @@ irqreturn_t wm_adsp2_bus_error(struct wm_adsp *dsp) ...@@ -3855,7 +3857,7 @@ irqreturn_t wm_adsp2_bus_error(struct wm_adsp *dsp)
adsp_err(dsp, adsp_err(dsp,
"Failed to read Pmem Xmem Err Addr register: %d\n", "Failed to read Pmem Xmem Err Addr register: %d\n",
ret); ret);
return IRQ_HANDLED; goto error;
} }
adsp_err(dsp, "xmem error address = 0x%x\n", adsp_err(dsp, "xmem error address = 0x%x\n",
...@@ -3868,6 +3870,9 @@ irqreturn_t wm_adsp2_bus_error(struct wm_adsp *dsp) ...@@ -3868,6 +3870,9 @@ irqreturn_t wm_adsp2_bus_error(struct wm_adsp *dsp)
regmap_update_bits(regmap, dsp->base + ADSP2_LOCK_REGION_CTRL, regmap_update_bits(regmap, dsp->base + ADSP2_LOCK_REGION_CTRL,
ADSP2_CTRL_ERR_EINT, ADSP2_CTRL_ERR_EINT); ADSP2_CTRL_ERR_EINT, ADSP2_CTRL_ERR_EINT);
error:
mutex_unlock(&dsp->pwr_lock);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
EXPORT_SYMBOL_GPL(wm_adsp2_bus_error); EXPORT_SYMBOL_GPL(wm_adsp2_bus_error);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册