您尚未登录。

楼主 #1 2020-04-14 17:33:23

psst
会员
注册时间: 2019-01-22
已发帖子: 91
积分: 36.5

v3s sd卡启动 有时出错

v3s sd卡启动,有时会出这样的错误,系统卡住,连看门狗复位都无法重启。是啥原因??请教大家


[    6.219424] sunxi-mmc 1c0f000.mmc: data error, sending stop command

[    7.175179] sched: RT throttling activated
[    7.225185] sunxi-mmc 1c0f000.mmc: send stop command failed

离线

楼主 #2 2020-04-14 17:50:54

psst
会员
注册时间: 2019-01-22
已发帖子: 91
积分: 36.5

Re: v3s sd卡启动 有时出错

static irqreturn_t sunxi_mmc_handle_manual_stop(int irq, void *dev_id)
{
    struct sunxi_mmc_host *host = dev_id;
    struct mmc_request *mrq;
    unsigned long iflags;

    spin_lock_irqsave(&host->lock, iflags);
    mrq = host->manual_stop_mrq;
    spin_unlock_irqrestore(&host->lock, iflags);

    if (!mrq) {
        dev_err(mmc_dev(host->mmc), "no request for manual stop\n");
        return IRQ_HANDLED;
    }

    dev_err(mmc_dev(host->mmc), "data error, sending stop command\n");

    /*
     * We will never have more than one outstanding request,
     * and we do not complete the request until after
     * we've cleared host->manual_stop_mrq so we do not need to
     * spin lock this function.
     * Additionally we have wait states within this function
     * so having it in a lock is a very bad idea.
     */
    sunxi_mmc_send_manual_stop(host, mrq);

    spin_lock_irqsave(&host->lock, iflags);
    host->manual_stop_mrq = NULL;
    spin_unlock_irqrestore(&host->lock, iflags);

    mmc_request_done(host->mmc, mrq);

    return IRQ_HANDLED;
}

static void sunxi_mmc_send_manual_stop(struct sunxi_mmc_host *host,
                       struct mmc_request *req)
{
    u32 arg, cmd_val, ri;
    unsigned long expire = jiffies + msecs_to_jiffies(1000);

    cmd_val = SDXC_START | SDXC_RESP_EXPIRE |
          SDXC_STOP_ABORT_CMD | SDXC_CHECK_RESPONSE_CRC;

    if (req->cmd->opcode == SD_IO_RW_EXTENDED) {
        cmd_val |= SD_IO_RW_DIRECT;
        arg = (1 << 31) | (0 << 28) | (SDIO_CCCR_ABORT << 9) |
              ((req->cmd->arg >> 28) & 0x7);
    } else {
        cmd_val |= MMC_STOP_TRANSMISSION;
        arg = 0;
    }

    mmc_writel(host, REG_CARG, arg);
    mmc_writel(host, REG_CMDR, cmd_val);

    do {
        ri = mmc_readl(host, REG_RINTR);
    } while (!(ri & (SDXC_COMMAND_DONE | SDXC_INTERRUPT_ERROR_BIT)) &&
         time_before(jiffies, expire));

    if (!(ri & SDXC_COMMAND_DONE) || (ri & SDXC_INTERRUPT_ERROR_BIT)) {
        dev_err(mmc_dev(host->mmc), "send stop command failed\n");
        if (req->stop)
            req->stop->resp[0] = -ETIMEDOUT;
    } else {
        if (req->stop)
            req->stop->resp[0] = mmc_readl(host, REG_RESP0);
    }

    mmc_writel(host, REG_RINTR, 0xffff);
}

找到了两个相关的函数,不知道什么原因引起的,不是每次都会出错,偶尔出问题,很要命。

离线

楼主 #4 2020-04-14 19:30:50

psst
会员
注册时间: 2019-01-22
已发帖子: 91
积分: 36.5

Re: v3s sd卡启动 有时出错

不是开发板,批量做了,大概10个板会有一个出这种问题,而且出问题的可能过段时间又好了

离线

楼主 #6 2020-04-15 11:00:15

psst
会员
注册时间: 2019-01-22
已发帖子: 91
积分: 36.5

Re: v3s sd卡启动 有时出错

有加上拉,硬件没问题

离线

楼主 #7 2020-04-15 14:50:06

psst
会员
注册时间: 2019-01-22
已发帖子: 91
积分: 36.5

Re: v3s sd卡启动 有时出错

总线宽度改成1,是否会降低读写速度,我改成了1,试试看

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn