Skip to content

Commit 0feea33

Browse files
diandersandersson
authored andcommitted
soc: qcom-geni-se: Don't use relaxed writes when writing commands
Writing the command is the final step in kicking off a transfer. Let's use writel() to ensure that any other memory accesses are done before the command kicks off. It's expected that this is mostly relevant if we're in DMA mode but since it doesn't appear to regress performance in a measurable way [1] even in PIO mode and it's easier to reason about then let's just always use it. NOTE: this patch came about due to code inspection. No actual problems were observed that this patch fixes. [1] Tested by timing "flashrom -p ec" on a Chromebook which stresses GENI SPI a lot. Reviewed-by: Mukesh Kumar Savaliya <msavaliy@codeaurora.org> Reviewed-by: Akash Asthana <akashast@codeaurora.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Suggested-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Douglas Anderson <dianders@chromium.org> Link: https://lore.kernel.org/r/20200722150113.1.Ia50ab5cb8a6d3a73d302e6bdc25542d48ffd27f4@changeid Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
1 parent cb8aed7 commit 0feea33

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

include/linux/qcom-geni-se.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ static inline void geni_se_setup_m_cmd(struct geni_se *se, u32 cmd, u32 params)
296296
u32 m_cmd;
297297

298298
m_cmd = (cmd << M_OPCODE_SHFT) | (params & M_PARAMS_MSK);
299-
writel_relaxed(m_cmd, se->base + SE_GENI_M_CMD0);
299+
writel(m_cmd, se->base + SE_GENI_M_CMD0);
300300
}
301301

302302
/**
@@ -316,7 +316,7 @@ static inline void geni_se_setup_s_cmd(struct geni_se *se, u32 cmd, u32 params)
316316
s_cmd &= ~(S_OPCODE_MSK | S_PARAMS_MSK);
317317
s_cmd |= (cmd << S_OPCODE_SHFT);
318318
s_cmd |= (params & S_PARAMS_MSK);
319-
writel_relaxed(s_cmd, se->base + SE_GENI_S_CMD0);
319+
writel(s_cmd, se->base + SE_GENI_S_CMD0);
320320
}
321321

322322
/**

0 commit comments

Comments
 (0)