public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Anton Vorontsov <cbouatmailru@gmail.com>
To: B42677@freescale.com
Cc: linux-mmc@vger.kernel.org,
	Haijun Zhang <Haijun.Zhang@freescale.com>,
	Jerry Huang <Chang-Ming.Huang@freescale.com>
Subject: Re: [PATCH] Powerpc eSDHC Recover from the ADMA error
Date: Tue, 18 Sep 2012 13:12:22 -0700	[thread overview]
Message-ID: <20120918201220.GA27312@lizard> (raw)
In-Reply-To: <1347955699-18780-1-git-send-email-B42677@freescale.com>

On Tue, Sep 18, 2012 at 04:08:19PM +0800, B42677@freescale.com wrote:
> From: Haijun Zhang <Haijun.Zhang@freescale.com>
> 
> 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@freescale.com>
> Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
> CC: Anton Vorontsov <cbouatmailru@gmail.com>
> ---
[...]
> +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.

  reply	other threads:[~2012-09-18 20:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-18  8:08 [PATCH] Powerpc eSDHC Recover from the ADMA error B42677
2012-09-18 20:12 ` Anton Vorontsov [this message]
2012-09-19  2:20   ` Zhang Haijun-B42677

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120918201220.GA27312@lizard \
    --to=cbouatmailru@gmail.com \
    --cc=B42677@freescale.com \
    --cc=Chang-Ming.Huang@freescale.com \
    --cc=Haijun.Zhang@freescale.com \
    --cc=linux-mmc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox