//calculate the timeout value for SDMMC; added by xbw at 2011-09-27
if(mrq->data)
{
- unit = 3*(1<<20);// unit=3MB
+ unit = 2*(1<<20);// unit=2MB
datasize = mrq->data->blksz*mrq->data->blocks;
multi = datasize/unit;
multi += (datasize%unit)?1:0;
{
host->doneflag = 0;
mrq->cmd->error = -EIO;
- printk("%s..%d.. !!!!! wait for CMD%d timeout ===xbw[%s]===\n",\
- __FUNCTION__, __LINE__, mrq->cmd->opcode, mmc_hostname(host));
+
+ if(0 == mrq->cmd->retries)
+ {
+ printk(KERN_WARNING "%s..%d.. !!!!! wait for CMD%d timeout [%s]\n",\
+ __FUNCTION__, __LINE__, mrq->cmd->opcode, mmc_hostname(host));
+ }
}
#else
wait_for_completion(&complete);
mmc_host_clk_release(host);
}
-static void mmc_power_off(struct mmc_host *host)
+void mmc_power_off(struct mmc_host *host)
{
mmc_host_clk_hold(host);
}
/*
- * Remove the current bus handler from a host. Assumes that there are
- * no interesting cards left, so the bus is powered down.
+ * Remove the current bus handler from a host.
*/
void mmc_detach_bus(struct mmc_host *host)
{
spin_unlock_irqrestore(&host->lock, flags);
- mmc_power_off(host);
-
mmc_bus_put(host);
}
#if !defined(CONFIG_USE_SDMMC0_FOR_WIFI_DEVELOP_BOARD)
if( strncmp( mmc_hostname(host) ,"mmc0" , strlen("mmc0")) )
{
- sdio_reset(host);
+ //sdio_reset(host);//make no sense; noteed by xbw at 2011-12-14
mmc_go_idle(host);
if (!(init_ret=mmc_attach_sdio(host)))
{
- printk("%s..%d.. ===== Initialize SDIO successfully. ===xbw[%s]===\n",\
+ printk(KERN_INFO "%s..%d.. ===== Initialize SDIO successfully. [%s]\n",\
__FUNCTION__, __LINE__, mmc_hostname(host));
return 0;
}
{
if(0xFF!=init_ret)
{
- printk("\n=====\n %s..%d.. ===== Initialize SDIO-card unsuccessfully!!! ===xbw[%s]===\n=====\n",\
+ printk(KERN_WARNING "\n=====\n %s..%d.. ===== Initialize SDIO-card unsuccessfully!!! [%s]\n=====\n",\
__FUNCTION__, __LINE__, mmc_hostname(host));
goto freq_out;
mmc_go_idle(host);
}
#else
- sdio_reset(host);
+ //sdio_reset(host); //make no sense; noteed by xbw at 2011-12-14
mmc_go_idle(host);
if (!(init_ret=mmc_attach_sdio(host)))
{
- printk("%s..%d.. ===== Initialize SDIO successfully. ===xbw[%s]===\n",\
+ printk(KERN_INFO "%s..%d.. ===== Initialize SDIO successfully. [%s]\n",\
__FUNCTION__, __LINE__, mmc_hostname(host));
return 0;
}
{
if(0xFF!=init_ret)
{
- printk("\n=====\n %s..%d.. ===== Initialize SDIO-card unsuccessfully!!! ===xbw[%s]===\n=====\n",\
+ printk(KERN_WARNING "\n=====\n %s..%d.. ===== Initialize SDIO-card unsuccessfully!!! [%s]\n=====\n",\
__FUNCTION__, __LINE__, mmc_hostname(host));
goto freq_out;
if (!(init_ret=mmc_attach_sd(host)))
{
- printk("%s..%d.. ===== Initialize SD-card successfully. ===xbw[%s]===\n",\
+ printk(KERN_INFO "%s..%d.. ===== Initialize SD-card successfully. [%s]\n",\
__FUNCTION__, __LINE__, mmc_hostname(host));
return 0;
{
if(0xFF!=init_ret)
{
- printk("\n=====\n%s..%d.. ===== Initialize SD-card unsuccessfully!!! ===xbw[%s]===\n====\n",\
+ printk(KERN_WARNING "\n=====\n%s..%d.. ===== Initialize SD-card unsuccessfully! [%s]\n====\n",\
__FUNCTION__, __LINE__, mmc_hostname(host));
goto freq_out;
if (!(init_ret=mmc_attach_mmc(host)))
{
- printk("%s...%d.. ===== Initialize MMC-card successfully. ===xbw[%s]===\n",\
+ printk(KERN_INFO "%s...%d.. ===== Initialize MMC-card successfully. [%s]\n",\
__FUNCTION__, __LINE__, mmc_hostname(host));
return 0;
{
if(0xFF!=init_ret)
{
- printk("\n =====\n%s..%d.. ===== Initialize MMC-card unsuccessfully!!! ===xbw[%s]===\n======\n",\
+ printk(KERN_WARNING "\n =====\n%s..%d.. ===== Initialize MMC-card unsuccessfully!!! [%s]\n======\n",\
__FUNCTION__, __LINE__, mmc_hostname(host));
goto freq_out;
mmc_bus_put(host);
#if defined(CONFIG_SDMMC_RK29) || !defined(CONFIG_SDMMC_RK29_OLD) //Modifyed by xbw at 2011-11-17
- printk("\n%s...%d.. ===== mmc_rescan Begin....======xbw[%s]=====\n",__FILE__, __LINE__, mmc_hostname(host));
+ printk(KERN_INFO "\n%s...%d.. ===== mmc_rescan Begin....[%s]\n",__FILE__, __LINE__, mmc_hostname(host));
#endif
if (host->ops->get_cd && host->ops->get_cd(host) == 0)
{
#if defined(CONFIG_SDMMC_RK29) || !defined(CONFIG_SDMMC_RK29_OLD) //Modifyed by xbw at 2011-11-17
- printk("\n=================\n%s..%d.. ====find no SDMMC host.====xbw[%s]=====\n", \
+ printk(KERN_WARNING "\n=================\n%s..%d.. ====find no SDMMC host. [%s]\n", \
__FUNCTION__, __LINE__, mmc_hostname(host));
#endif
mmc_claim_host(host);
mmc_detach_bus(host);
+ mmc_power_off(host);
mmc_release_host(host);
mmc_bus_put(host);
return;
if (host->bus_ops && !host->bus_dead) {
if (host->bus_ops->suspend)
err = host->bus_ops->suspend(host);
+
+#if defined(CONFIG_SDMMC_RK29) && defined(CONFIG_SDMMC_RK29_OLD)
+ //deleted all detail code. //fix the crash bug when error occur during suspend. Modiefyed by xbw at 2012-08-09
+#else
if (err == -ENOSYS || !host->bus_ops->resume) {
/*
* We simply "remove" the card in this case.
host->bus_ops->remove(host);
mmc_claim_host(host);
mmc_detach_bus(host);
+ mmc_power_off(host);
mmc_release_host(host);
host->pm_flags = 0;
err = 0;
}
+#endif
+ flush_delayed_work(&host->disable);
}
mmc_bus_put(host);
host->bus_ops->remove(host);
mmc_detach_bus(host);
+ mmc_power_off(host);
mmc_release_host(host);
host->pm_flags = 0;
break;