bus: mhi: host: Fix race between channel preparation and M0 event
stable inclusion from stable-v5.10.164 commit ab9bb65b851973fd7843f83830e4ed518d9e213b category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I7T7G4 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=ab9bb65b851973fd7843f83830e4ed518d9e213b -------------------------------- [ Upstream commit 869a9990 ] There is a race condition where mhi_prepare_channel() updates the read and write pointers as the base address and in parallel, if an M0 transition occurs, the tasklet goes ahead and rings doorbells for all channels with a delta in TRE rings assuming they are already enabled. This causes a null pointer access. Fix it by adding a channel enabled check before ringing channel doorbells. Cc: stable@vger.kernel.org # 5.19 Fixes: a6e2e352 "bus: mhi: core: Add support for PM state transitions" Signed-off-by: NQiang Yu <quic_qianyu@quicinc.com> Reviewed-by: NManivannan Sadhasivam <mani@kernel.org> Link: https://lore.kernel.org/r/1665889532-13634-1-git-send-email-quic_qianyu@quicinc.com [mani: CCed stable list] Signed-off-by: NManivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: Nsanglipeng <sanglipeng1@jd.com>
Showing
想要评论请 注册 或 登录