RE: [PATCH] Powerpc eSDHC Recover from the ADMA error

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

 



Thanks, I'll correct and send the V2 patch.

Regards
Haijun. 

-----Original Message-----
From: Anton Vorontsov [mailto:cbouatmailru@xxxxxxxxx] 
Sent: Tuesday, September 18, 2012 4:12 PM
To: Zhang Haijun-B42677
Cc: linux-mmc@xxxxxxxxxxxxxxx; Zhang Haijun-B42677; Huang Changming-R66093
Subject: Re: [PATCH] Powerpc eSDHC Recover from the ADMA error

On Tue, Sep 18, 2012 at 04:08:19PM +0800, B42677@xxxxxxxxxxxxx wrote:
> From: Haijun Zhang <Haijun.Zhang@xxxxxxxxxxxxx>
> 
> A-003500: False ADMA Error might be reported when ADMA is used for 
> multiple block read command with Stop at Block Gap. If PROCTL[SABGREQ] 
> is set when the particular block's data is received by the System side 
> logic before entire block(with CRC) data is received by the SD side 
> logic, and also if ADMA descriptor line is fetched at the same time, 
> then DMA engine might report false ADMA error. eSDHC might not be able 
> to Continue(PROCTL[CREQ]=1)after Stop at Block Gap.
> This issue will impact the eSDHC IP VVN2.3.
> 
> 
> Signed-off-by: Haijun Zhang <Haijun.Zhang@xxxxxxxxxxxxx>
> Signed-off-by: Jerry Huang <Chang-Ming.Huang@xxxxxxxxxxxxx>
> CC: Anton Vorontsov <cbouatmailru@xxxxxxxxx>
> ---
[...]
> +static void esdhci_of_adma_workaround(struct sdhci_host *host, u32 
> +intmask) {
> +	u32 tmp = in_be32(host->ioaddr + SDHCI_SLOT_INT_STATUS);
> +
> +	tmp = (tmp & SDHCI_VENDOR_VER_MASK) >> SDHCI_VENDOR_VER_SHIFT;
> +	if (tmp == VENDOR_V_23) {
> +		if ((intmask & SDHCI_INT_DATA_END) &&
> +			(intmask & SDHCI_INT_BLK_GAP)) {

By inverting the condition, you could greatly reduce the indentation. I.e. return early if the condition is false, and do the rest outside of the if block. (Plus, one if statement would be enough, no need to nest them.)

Thanks,

Anton.

��.n��������+%������w��{.n�����{��i��)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥



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

  Powered by Linux