/** * mmc_wait_for_req - start a request and wait for completion * @host: MMC host to start command * @mrq: MMC request to start * * Start a new MMC custom command request for a host, and wait * for the command to complete. Does not attempt to parse the * response. */ void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq) { #ifdef CONFIG_WIMAX int ret = 0; #endif DECLARE_COMPLETION_ONSTACK(complete); mrq->done_data = &complete; mrq->done = mmc_wait_done; mmc_start_request(host, mrq); #ifdef CONFIG_WIMAX ret = wait_for_completion_timeout(&complete, msecs_to_jiffies(5000)); if (ret <= 0) { struct msmsdcc_host *msm_host = mmc_priv(host); printk("[ERR] %s: %s wait_for_completion_timeout!\n", __func__, mmc_hostname(host)); msmsdcc_stop_data(msm_host); mrq->cmd->error = -ETIMEDOUT; msmsdcc_request_end(msm_host, mrq); } #else wait_for_completion(&complete); #endif }
void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq) { DECLARE_COMPLETION_ONSTACK(complete); mrq->done_data = &complete; mrq->done = mmc_wait_done; do { mmc_start_request(host, mrq); wait_for_completion(&complete); /* * If CRC error happens, slow down the clock and resend the request */ if ((mrq->cmd->error == -EILSEQ) || (mrq->data && (mrq->data->error == -EILSEQ))) { /* * If the clock is too slow, the performance is very poor. * So, just return error. */ if (host->ios.clock <= 3000000) { printk(KERN_WARNING "SD clock is too slow!\n"); break; } printk(KERN_WARNING "%s: CRC error! slow the clock to %d\n", mmc_hostname(host), host->ios.clock/2); mmc_set_clock(host, host->ios.clock/2); } else { break; } } while (1); }
/** * mmc_wait_for_req - start a request and wait for completion * @host: MMC host to start command * @mrq: MMC request to start * * Start a new MMC custom command request for a host, and wait * for the command to complete. Does not attempt to parse the * response. */ void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq) { DECLARE_COMPLETION_ONSTACK(complete); mrq->done_data = &complete; mrq->done = mmc_wait_done; mmc_start_request(host, mrq); wait_for_completion(&complete); }
/** * mmc_wait_for_req - start a request and wait for completion * @host: MMC host to start command * @mrq: MMC request to start * * Start a new MMC custom command request for a host, and wait * for the command to complete. Does not attempt to parse the * response. */ void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq) { DECLARE_COMPLETION_ONSTACK(complete); mrq->done_data = &complete; mrq->done = mmc_wait_done; mmc_start_request(host, mrq); if(host->index == 0) mmc_delay(10); wait_for_completion_io(&complete); }
/** * mmc_wait_for_req - start a request and wait for completion * @host: MMC host to start command * @mrq: MMC request to start * * Start a new MMC custom command request for a host, and wait * for the command to complete. Does not attempt to parse the * response. */ int mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq) //sw2-6-1-RH-Wlan_Reset7-00* { DECLARE_COMPLETION_ONSTACK(complete); mrq->done_data = &complete; mrq->done = mmc_wait_done; mmc_start_request(host, mrq); //sw2-6-1-RH-Wlan_Reset7-00*[ // wait_for_completion_io(&complete); return wait_for_completion_timeout(&complete, msecs_to_jiffies(2500)); //sw2-6-1-RH-Wlan_Reset7-00*] }
/** * mmc_wait_for_req - start a request and wait for completion * @host: MMC host to start command * @mrq: MMC request to start * * Start a new MMC custom command request for a host, and wait * for the command to complete. Does not attempt to parse the * response. */ void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq) { #ifdef CONFIG_WIMAX #ifdef CONFIG_WIMAX_MMC_TIMEOUT int ret = 0; struct msmsdcc_host *msm_host = mmc_priv(host); int timeout = 0; #endif #endif DECLARE_COMPLETION_ONSTACK(complete); mrq->done_data = &complete; mrq->done = mmc_wait_done; mmc_start_request(host, mrq); #ifdef CONFIG_WIMAX #ifdef CONFIG_WIMAX_MMC #ifdef CONFIG_WIMAX_MMC_TIMEOUT if ( !(strcmp(mmc_hostname(host), CONFIG_WIMAX_MMC))) { #ifdef CONFIG_WIMAX_REQ_TIMEOUT ret = wait_for_completion_timeout(&complete, msecs_to_jiffies(CONFIG_WIMAX_REQ_TIMEOUT)); timeout = CONFIG_WIMAX_REQ_TIMEOUT; #else ret = wait_for_completion_timeout(&complete, msecs_to_jiffies(5000)); timeout = 5000; #endif if (ret <= 0) { printk("[ERR] %s: %s wait_for_completion_timeout in %d!\n", __func__, mmc_hostname(host), timeout); msmsdcc_reset_and_restore(msm_host); msmsdcc_stop_data(msm_host); mrq->cmd->error = -ETIMEDOUT; msmsdcc_request_end(msm_host, mrq); } } else #endif #endif #endif wait_for_completion_io(&complete); }
/** * mmc_wait_for_req - start a request and wait for completion * @host: MMC host to start command * @mrq: MMC request to start * * Start a new MMC custom command request for a host, and wait * for the command to complete. Does not attempt to parse the * response. */ void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq) { DECLARE_COMPLETION_ONSTACK(complete); mrq->done_data = &complete; mrq->done = mmc_wait_done; mmc_start_request(host, mrq); //#ifdef CONFIG_BCM_WIFI // if(!wait_for_completion_timeout(&complete, 5*HZ)) // { // printk("shaohua mmc 5 dec timeout \n"); // mrq->cmd->error = -1; // } //#else wait_for_completion(&complete); //#endif }
/** * mmc_wait_for_req - start a request and wait for completion * @host: MMC host to start command * @mrq: MMC request to start * * Start a new MMC custom command request for a host, and wait * for the command to complete. Does not attempt to parse the * response. */ void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq) { int timeout; DECLARE_COMPLETION_ONSTACK(complete); mrq->done_data = &complete; mrq->done = mmc_wait_done; mmc_start_request(host, mrq); timeout = wait_for_completion_timeout(&complete, msecs_to_jiffies(5000)); if(timeout == 0) { printk("%s: mmc_wait_for_req :timeout\n",mmc_hostname(host)); } }
/** * mmc_wait_for_req - start a request and wait for completion * @host: MMC host to start command * @mrq: MMC request to start * * Start a new MMC custom command request for a host, and wait * for the command to complete. Does not attempt to parse the * response. */ void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq) { int error = 0; DECLARE_COMPLETION_ONSTACK(complete); down(&host->req_sema); DBG("[%s] s\n",__func__); mrq->done_data = &complete; mrq->done = mmc_wait_done; mmc_start_request(host, mrq); wait_for_completion(&complete); if (mrq->cmd->error != 0) { error |= 1; } if (mrq->data) { if (mrq->data->error != 0) error |= 2; } if (mrq->stop) { if (mrq->stop->error != 0) error |= 4; } if (error && host->ops->get_slot_status(host) && (host->scan_retry > 0) && host->card_scan_status == true) { DBG(KERN_ALERT"[%s]1 cmd = %d error = %d retry = %d slot = %d card_status = %d\n", __func__,mrq->cmd->opcode,error,host->scan_retry,host->ops->get_slot_status(host),host->card_scan_status); mmc_detect_change(host, HZ*1); host->scan_retry--; } up(&host->req_sema); DBG("[%s] e\n",__func__); }
/** * mmc_wait_for_req - start a request and wait for completion * @host: MMC host to start command * @mrq: MMC request to start * * Start a new MMC custom command request for a host, and wait * for the command to complete. Does not attempt to parse the * response. */ void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq) { int ret; DECLARE_COMPLETION_ONSTACK(complete); mrq->done_data = &complete; mrq->done = mmc_wait_done; mmc_start_request(host, mrq); if (!wait_for_completion_timeout(&complete, msecs_to_jiffies(10000))) { host->ops->dump_regs(host); dump_mmc_ios(host); #ifdef MMC_HOST_DEBUGGING extern void dump(void); dump(); #endif if (host->ops->abort_request) { /* Power off */ ret = mmc_power_save_host(host); if (ret) pr_err("%s: mmc_power_save_host : error %d\n", mmc_hostname(host), ret); /* Reset host */ host->ops->abort_request(host); /* Reinitialize the host and card */ ret = mmc_power_restore_host(host); if (ret) pr_err("%s: mmc_power_restore_host : error %d\n", mmc_hostname(host), ret); } else { printk(KERN_ERR"[MMC]Timeout Timer Handler Error\n"); } } }
/* ** return value changed ** void -> int ** ** old prototype ---> void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq) */ int mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq) { DECLARE_COMPLETION_ONSTACK(complete); mrq->done_data = &complete; mrq->done = mmc_wait_done; mmc_start_request(host, mrq); #ifdef CONFIG_MACH_LGE_MMC_REFRESH if(wait_for_completion_timeout(&complete, HZ * 3)==0) { return 0xbcbc; } else { return 0; } #else wait_for_completion(&complete); #endif }