I tried to implement sigint patch in freescale imx6 4.1 
kernel(http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/, branch 
imx_4.1.15_1.0.0_ga), but it's not working. I have added these same changes 
in bcmsdh.c and i've made my sw_mci_check_r1_ready() function in sdhci.c 
based on 

static int sdhci_card_busy(struct mmc_host *mmc)
{
    struct sdhci_host *host = mmc_priv(mmc);
    u32 present_state;

    sdhci_runtime_pm_get(host);
    /* Check whether DAT[3:0] is 0000 */
    present_state = sdhci_readl(host, SDHCI_PRESENT_STATE);
    sdhci_runtime_pm_put(host);

    return !(present_state & SDHCI_DATA_LVL_MASK);
}

Unfortunately this doesn't helped. Is there any official solution? Maybe 
you can give me some advice how to implement this in 4.1 freescale kernel.

W dniu czwartek, 9 lipca 2015 10:10:12 UTC+2 użytkownik sigint napisał:
>
> ..something like this:
> (v4.0.5. mainline)
>
> diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
> index 459ed1b..82f41e3 100644
> --- a/drivers/mmc/host/sunxi-mmc.c
> +++ b/drivers/mmc/host/sunxi-mmc.c
> @@ -1082,6 +1082,23 @@ static struct platform_driver sunxi_mmc_driver = {
>  };
>  module_platform_driver(sunxi_mmc_driver);
>  
> +int sw_mci_check_r1_ready(struct mmc_host* mmc, unsigned ms)
> +{
> +    struct sunxi_mmc_host *smc_host = mmc_priv(mmc);
> +    unsigned expire = jiffies + msecs_to_jiffies(ms);
> +    do {
> +        if (!(mmc_readl(smc_host, REG_STAS) & SDXC_CARD_DATA_BUSY))
> +            break;
> +    } while (jiffies < expire);
> +
> +    if ((mmc_readl(smc_host, REG_STAS) & SDXC_CARD_DATA_BUSY)) {
> +        dev_err(mmc_dev(mmc), "wait r1 rdy %d ms timeout\n", ms);
> +        return -1;
> +    } else
> +        return 0;
> +}
> +EXPORT_SYMBOL_GPL(sw_mci_check_r1_ready);
> +
>  MODULE_DESCRIPTION("Allwinner's SD/MMC Card Controller Driver");
>  MODULE_LICENSE("GPL v2");
>  MODULE_AUTHOR("David Lanzend�rfer <david.lan...@o2s.ch <javascript:>>");
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
> b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
> index 7944224..ff63927 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
> @@ -58,6 +58,8 @@
>  #define BRCMF_DEFAULT_TXGLOM_SIZE        32  /* max tx frames in glom 
> chain */
>  #define BRCMF_DEFAULT_RXGLOM_SIZE        32  /* max rx frames in glom 
> chain */
>  
> +extern int sw_mci_check_r1_ready(struct mmc_host* mmc, unsigned ms);
> +
>  static int brcmf_sdiod_txglomsz = BRCMF_DEFAULT_TXGLOM_SIZE;
>  module_param_named(txglomsz, brcmf_sdiod_txglomsz, int, 0);
>  MODULE_PARM_DESC(txglomsz, "maximum tx packet chain size [SDIO]");
> @@ -266,6 +268,10 @@ static int brcmf_sdiod_request_data(struct
> brcmf_sdio_dev *sdiodev, u8 fn,
>                  brcmf_dbg(SDIO, "failed to %s data F%d@0x%05x, err: %d\n",
>                            write ? "write" : "read", fn, addr, ret);
>  
> +        //AW judge sdio read write timeout, 1s
> +        if (sw_mci_check_r1_ready(sdiodev->func[fn]->card->host, 1000) != 
> 0)
> +                brcmf_err("sw_mci_check_r1_ready data timeout.\n");
> +
>          return ret;
>  }
>  
> @@ -322,6 +328,11 @@ static int brcmf_sdiod_regrw_helper(struct
> brcmf_sdio_dev *sdiodev, u32 addr,
>                          brcmf_dbg(SDIO, "failed to %s data F%d@0x%05x, 
> err: %d\n",
>                                    write ? "write" : "read", func, addr, 
> ret);
>          }
> +
> +        //AW judge sdio read write timeout, 1s
> +        if (sw_mci_check_r1_ready(sdiodev->func[func]->card->host, 1000) 
> != 0)
> +                brcmf_err("sw_mci_check_r1_ready data timeout.\n");
> +
>          return ret;
>  }
>  
> @@ -461,6 +472,11 @@ static int brcmf_sdiod_buffrw(struct brcmf_sdio_dev
> *sdiodev, uint fn,
>                                    req_sz);
>          if (err == -ENOMEDIUM)
>                  brcmf_sdiod_nomedium_state(sdiodev);
> +
> +        //AW judge sdio read write timeout, 1s
> +        if (sw_mci_check_r1_ready(sdiodev->func[fn]->card->host, 1000) != 
> 0)
> +                brcmf_err("sw_mci_check_r1_ready data timeout.\n");
> +
>          return err;
>  }
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to