send_stop_cmd(host, data);
else{
/*single block read/write, send stop cmd manually to prevent host controller halt*/
- printk("%s status 1 0x%08x [%s]\n",__func__,mci_readl(host, STATUS),mmc_hostname(host->mmc));
+ printk("%s status 1 0x%08x [%s]\n",
+ __func__,mci_readl(host, STATUS),mmc_hostname(host->mmc));
mci_writel(host, CMDARG, 0);
wmb();
cmd_flags = SDMMC_CMD_STOP |SDMMC_CMD_RESP_CRC|SDMMC_CMD_RESP_EXP|MMC_STOP_TRANSMISSION;
// mci_writel(host, CMD, SDMMC_CMD_USE_HOLD_REG |SDMMC_CMD_STOP |SDMMC_CMD_RESP_CRC|SDMMC_CMD_RESP_EXP| SDMMC_CMD_START|0x0c);
mci_writel(host, CMD, cmd_flags | SDMMC_CMD_START);
wmb();
- while(1){
+ unsigned long timeout = jiffies + msecs_to_jiffies(500);
+ bool ret=0;
+ while(ret=time_before(jiffies, timeout)){
if(!(mci_readl(host, CMD)&SDMMC_CMD_START))
break;
}
+ if(!ret)
+ printk("%s EVENT_DATA_ERROR recovery failed!!! [%s]\n",
+ __func__,mmc_hostname(host->mmc));
}
#else
send_stop_abort(host, data);
unsigned int len;
unsigned int remain, fcnt;
+ if(!host->mmc->bus_refs){
+ printk("Note: %s host->mmc->bus_refs is 0!!!\n",__func__,host->mmc->bus_refs);
+ goto host_put;
+ }
do {
if (!sg_miter_next(sg_miter))
goto done;
done:
sg_miter_stop(sg_miter);
+host_put:
host->sg = NULL;
smp_wmb();
set_bit(EVENT_XFER_COMPLETE, &host->pending_events);
unsigned int len;
unsigned int fifo_depth = host->fifo_depth;
unsigned int remain, fcnt;
+
+ if(!host->mmc->bus_refs){
+ printk("Note: %s host->mmc->bus_refs is 0!!!\n",__func__,host->mmc->bus_refs);
+ goto host_put;
+ }
do {
if (!sg_miter_next(sg_miter))
done:
sg_miter_stop(sg_miter);
+host_put:
host->sg = NULL;
smp_wmb();
set_bit(EVENT_XFER_COMPLETE, &host->pending_events);