From b3fbddda80c13f048fbf27c3c8a5489dd8cc6e60 Mon Sep 17 00:00:00 2001 From: heyuanjie87 <943313837@qq.com> Date: Thu, 29 Aug 2024 06:33:50 +0800 Subject: [PATCH] =?UTF-8?q?[bsp/cvitek]=E4=BF=AE=E6=AD=A3sdhci=E5=8F=91?= =?UTF-8?q?=E9=80=81=E5=91=BD=E4=BB=A4=E8=B6=85=E6=97=B6=E5=90=8E=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E4=B8=A4=E6=AC=A1=E4=BF=A1=E5=8F=B7=E9=87=8F=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正命令超时后触发两次信号量的问题 详解: 中断状态寄存器的BIT0仅表示sdhci处理命令完成,完成结果由其它位指示,当出错时 BIT0也会值1产生中断 Signed-off-by: heyuanjie87 <943313837@qq.com> --- bsp/cvitek/drivers/drv_sdhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsp/cvitek/drivers/drv_sdhci.c b/bsp/cvitek/drivers/drv_sdhci.c index 14ed7214d1..dd7ae14086 100644 --- a/bsp/cvitek/drivers/drv_sdhci.c +++ b/bsp/cvitek/drivers/drv_sdhci.c @@ -403,7 +403,6 @@ static void sdhci_cmd_irq(struct rthw_sdhci *sdhci, uint32_t intmask) if (intmask & SDIF_INT_RESPONSE) { - sdhci->cmd_error = RT_EOK; if (sdhci->response_type == RESP_R2) { /* CRC is stripped so we need to do some shifting. */ @@ -419,6 +418,8 @@ static void sdhci_cmd_irq(struct rthw_sdhci *sdhci, uint32_t intmask) sdhci->response[0] = mmio_read_32(BASE + SDIF_RESPONSE_01); LOG_D("sdhci->response: [%08x]", sdhci->response[0]); } + + rt_sem_release(sdhci->sem_cmd); } } @@ -486,7 +487,6 @@ static void sdhci_transfer_handle_irq(int irqno, void *param) if (intmask & SDIF_INT_CMD_MASK) { sdhci_cmd_irq(sdhci, intmask & SDIF_INT_CMD_MASK); - rt_sem_release(sdhci->sem_cmd); } if (intmask & SDIF_INT_DMA_END)