From 93c1e0c633ff3fe0da99ab29db03049d6a7c8730 Mon Sep 17 00:00:00 2001 From: Jari Nippula Date: Fri, 28 Mar 2025 15:54:23 +0200 Subject: [PATCH] arch/risc-v/src/mpfs/mpfs_emmcsd: ignore WRCOMPLETE As emmcsd driver does not support separate WRCOMPLETE interrupt the SDIOWAIT_WRCOMPLETE event shall not be waited. The SDIOWAIT_TRANSFERDONE event indicates that both "transfer done" and "write complete" events are completed. --- arch/risc-v/src/mpfs/mpfs_emmcsd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/risc-v/src/mpfs/mpfs_emmcsd.c b/arch/risc-v/src/mpfs/mpfs_emmcsd.c index 1e375e799a2..a627fe12ad1 100644 --- a/arch/risc-v/src/mpfs/mpfs_emmcsd.c +++ b/arch/risc-v/src/mpfs/mpfs_emmcsd.c @@ -2769,6 +2769,17 @@ static sdio_eventset_t mpfs_eventwait(struct sdio_dev_s *dev) sdio_eventset_t wkupevent = 0; int ret; +#if defined(CONFIG_MMCSD_SDIOWAIT_WRCOMPLETE) + if ((priv->waitevents & SDIOWAIT_WRCOMPLETE) != 0) + { + /* Do not wait for SDIOWAIT_WRCOMPLETE as the SDIOWAIT_TRANSFERDONE + * event has already taken care of that part also. + */ + + return SDIOWAIT_WRCOMPLETE; + } +#endif + mcinfo("wait\n"); /* There is a race condition here... the event may have completed before