]> www.infradead.org Git - linux.git/commitdiff
remoteproc: qcom_q6v5_mss: Re-order writes to the IMEM region
authorSibi Sankar <quic_sibis@quicinc.com>
Mon, 19 Aug 2024 07:30:20 +0000 (13:00 +0530)
committerBjorn Andersson <andersson@kernel.org>
Sat, 16 Nov 2024 03:36:38 +0000 (19:36 -0800)
Any write access to the IMEM region when the Q6 is setting up XPU
protection on it will result in a XPU violation. Fix this by ensuring
IMEM writes related to the MBA post-mortem logs happen before the Q6
is brought out of reset.

Fixes: 318130cc9362 ("remoteproc: qcom_q6v5_mss: Add MBA log extraction support")
Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20240819073020.3291287-1-quic_sibis@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
drivers/remoteproc/qcom_q6v5_mss.c

index aaddbaf1099e4544ef0503eb9f53cd32d1c8d309..e78bd986dc3f256effce4470222c0a5faeea86ec 100644 (file)
@@ -1158,6 +1158,9 @@ static int q6v5_mba_load(struct q6v5 *qproc)
                goto disable_active_clks;
        }
 
+       if (qproc->has_mba_logs)
+               qcom_pil_info_store("mba", qproc->mba_phys, MBA_LOG_SIZE);
+
        writel(qproc->mba_phys, qproc->rmb_base + RMB_MBA_IMAGE_REG);
        if (qproc->dp_size) {
                writel(qproc->mba_phys + SZ_1M, qproc->rmb_base + RMB_PMI_CODE_START_REG);
@@ -1168,9 +1171,6 @@ static int q6v5_mba_load(struct q6v5 *qproc)
        if (ret)
                goto reclaim_mba;
 
-       if (qproc->has_mba_logs)
-               qcom_pil_info_store("mba", qproc->mba_phys, MBA_LOG_SIZE);
-
        ret = q6v5_rmb_mba_wait(qproc, 0, 5000);
        if (ret == -ETIMEDOUT) {
                dev_err(qproc->dev, "MBA boot timed out\n");