This is an automated email from the ASF dual-hosted git repository. pkarashchenko pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit bb1e81eb95f296ee75507091a8f6efebc055849a Author: Xiang Xiao <[email protected]> AuthorDate: Thu Apr 14 05:15:55 2022 +0800 driver/mmcsdio: do not hold the semaphore in idle thread too Signed-off-by: Xiang Xiao <[email protected]> --- drivers/mmcsd/mmcsd_sdio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmcsd/mmcsd_sdio.c b/drivers/mmcsd/mmcsd_sdio.c index c2c7f30fd9..c41877a80f 100644 --- a/drivers/mmcsd/mmcsd_sdio.c +++ b/drivers/mmcsd/mmcsd_sdio.c @@ -256,7 +256,7 @@ static int mmcsd_takesem(FAR struct mmcsd_state_s *priv) * waiting) */ - if (up_interrupt_context() == false) + if (!up_interrupt_context() && !sched_idletask()) { ret = nxsem_wait_uninterruptible(&priv->sem); if (ret < 0) @@ -282,7 +282,7 @@ static int mmcsd_takesem(FAR struct mmcsd_state_s *priv) static void mmcsd_givesem(FAR struct mmcsd_state_s *priv) { - if (up_interrupt_context() == false) + if (!up_interrupt_context() && !sched_idletask()) { /* Release the SDIO bus lock, then the MMC/SD driver semaphore in the * opposite order that they were taken to assure that no deadlock
