public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Shawn Guo <shawn.guo@freescale.com>
Cc: cjb@laptop.org, s.hauer@pengutronix.de, arnd@arndb.de,
	LW@KARO-electronics.de, linux-mmc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 1/7] mmc: mxs-mmc: add mmc host driver for i.MX23/28
Date: Mon, 14 Feb 2011 16:59:59 +0000	[thread overview]
Message-ID: <20110214165959.GC31103@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1297650746-12841-2-git-send-email-shawn.guo@freescale.com>

On Mon, Feb 14, 2011 at 10:32:20AM +0800, Shawn Guo wrote:
> +	switch (mmc_resp_type(cmd)) {
> +	case MMC_RSP_NONE:
> +		break;
> +	case MMC_RSP_R1:
> +	case MMC_RSP_R1B:
> +	case MMC_RSP_R3:
> +		cmd->resp[0] = readl(host->base + HW_SSP_SDRESP0);
> +		break;
> +	case MMC_RSP_R2:
> +		cmd->resp[3] = readl(host->base + HW_SSP_SDRESP0);
> +		cmd->resp[2] = readl(host->base + HW_SSP_SDRESP1);
> +		cmd->resp[1] = readl(host->base + HW_SSP_SDRESP2);
> +		cmd->resp[0] = readl(host->base + HW_SSP_SDRESP3);

You really should be testing for MMC_RSP_PRESENT and MMC_RSP_136
here.  The response types are made up of a bitfield which allows
you to detect what's required rather than having to decode the
response type itself.

> +		else if (stat & BM_SSP_CTRL1_FIFO_UNDERRUN_IRQ)
> +			data->error = -ENODATA;
> +		else if (stat & BM_SSP_CTRL1_FIFO_OVERRUN_IRQ)
> +			data->error = -EOVERFLOW;

Both of these have a common error code - -EIO.

  parent reply	other threads:[~2011-02-14 17:00 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-14  2:32 [PATCH v2 0/7] Add mmc driver for i.MX23/28 Shawn Guo
2011-02-14  2:32 ` [PATCH v2 1/7] mmc: mxs-mmc: add mmc host " Shawn Guo
2011-02-13 19:26   ` Chris Ball
2011-02-13 22:35     ` Arnd Bergmann
2011-02-14  0:25       ` Chris Ball
2011-02-15 21:27       ` Shawn Guo
2011-02-15 21:26     ` Shawn Guo
2011-02-14 15:39   ` Wolfram Sang
2011-02-15 21:28     ` Shawn Guo
2011-02-14 16:59   ` Wolfram Sang
2011-02-15 22:39     ` Shawn Guo
2011-02-15 17:13       ` Wolfram Sang
2011-02-15 17:19         ` Russell King - ARM Linux
2011-02-15 17:29           ` Wolfram Sang
2011-02-15 17:32             ` Russell King - ARM Linux
2011-02-16 20:28             ` Shawn Guo
2011-02-16 15:33               ` Wolfram Sang
2011-02-17  4:17                 ` Shawn Guo
2011-02-17 12:06                   ` Wolfram Sang
2011-02-16 15:59               ` Arnd Bergmann
2011-02-17  2:44                 ` Shawn Guo
2011-02-14 16:59   ` Russell King - ARM Linux [this message]
2011-02-15 22:03     ` Shawn Guo
2011-02-15 14:13       ` Russell King - ARM Linux
2011-02-14  2:32 ` [PATCH v2 2/7] ARM: mxs/clock: fix base address missing in name##_set_parent Shawn Guo
2011-02-14  2:32 ` [PATCH v2 3/7] ARM: mxs: make ssp error irq definition consistent Shawn Guo
2011-02-14  2:32 ` [PATCH v2 4/7] ARM: mxs: dynamically allocate mmc device Shawn Guo
2011-02-14  2:32 ` [PATCH v2 5/7] ARM: mxs: fix typo "GPO" in iomux-mx23.h Shawn Guo
2011-02-14  2:32 ` [PATCH v2 6/7] ARM: mxs/mx23evk: add mmc device Shawn Guo
2011-02-14  2:32 ` [PATCH v2 7/7] ARM: mxs/mx28evk: " Shawn Guo
2011-02-14 10:26   ` Wolfram Sang
2011-02-15 23:11     ` Shawn Guo

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=20110214165959.GC31103@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=LW@KARO-electronics.de \
    --cc=arnd@arndb.de \
    --cc=cjb@laptop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawn.guo@freescale.com \
    /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