Re: [PATCH v2 4/6] mmc: sdhci-of-esdhc: add erratum eSDHC7 support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 28/02/19 9:35 AM, Yinbo Zhu wrote:
> From: Yinbo Zhu <yinbo.zhu@xxxxxxx>
> 
> Invalid Transfer Complete (IRQSTAT[TC]) bit could be set during
> multi-write operation even when the BLK_CNT in BLKATTR register
> has not reached zero. Therefore, Transfer Complete might be
> reported twice due to this erratum since a valid Transfer Complete
> occurs when BLK_CNT reaches zero. This erratum is to fix this issue
> 
> Signed-off-by: Yinbo Zhu <yinbo.zhu@xxxxxxx>
> ---
>  drivers/mmc/host/sdhci.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 39bbbd7..2140762 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -2985,6 +2985,15 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)
>  		}
>  
>  		if (intmask & SDHCI_INT_DATA_END) {
> +			if (of_find_compatible_node(NULL, NULL,
> +							"fsl,p2020-esdhc")) {
> +				command = SDHCI_GET_CMD(sdhci_readw(host,
> +								SDHCI_COMMAND));
> +				if (command == MMC_WRITE_MULTIPLE_BLOCK &&
> +					sdhci_readw(host, SDHCI_BLOCK_COUNT)
> +					 != 0)
> +					return;
> +			}

Is it possible to do this with the host->ops->irq callback?  It should be
possible to clear the SDHCI_INT_DATA_END bit there although it will need to
be written back to SDHCI_INT_STATUS to clear that also.

>  			if (host->cmd == host->data_cmd) {
>  				/*
>  				 * Data managed to finish before the
> 




[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux