public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre Ossman <drzeus@drzeus.cx>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] sh7760mmc: host driver for SH7760 MMC interface
Date: Fri, 18 Jul 2008 23:49:33 +0000	[thread overview]
Message-ID: <20080719014933.18b9eba4@mjolnir.drzeus.cx> (raw)
In-Reply-To: <20080717110119.GA14949@roarinelk.homelinux.net>

[-- Attachment #1: Type: text/plain, Size: 1770 bytes --]

On Thu, 17 Jul 2008 13:03:53 +0200
Manuel Lauss <mano@roarinelk.homelinux.net> wrote:

> From: Manuel Lauss <mano@roarinelk.homelinux.net>
> 
> Host driver for SH7760 on-chip MMCIF interface.
> 
> Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
> ---

Just some minor things:

> +static void shmmc_cmd(struct shmmc_host *host, struct mmc_command *cmd)
> +{
> +	unsigned char cmdtyr, rsptyr, i;
> +
> +	shmmc_clock(host, 0);
> +	host->cmd = cmd;
> +
> +	/* enable MMCIF and "cmd xfer timeout" irqs */
> +	host->ien1 |= INTCR1_IRQEN | INTCR1_CTERIE;
> +
> +	/* setup command type */
> +	cmdtyr = 0;
> +	if (cmd->opcode == 12)
> +		cmdtyr = CMDTYR_CMD12;
> +

Seems more likely that this flag should be set on any stop command.

> +
> +	blksz_bits = ffs(data->blksz) - 1;
> +	BUG_ON((1 << blksz_bits) != data->blksz);

This is not a bug. You should fail the request with -EINVAL if you
cannot handle it.

> +static int __devexit shmmc_remove(struct platform_device *dev)
> +{
> +	struct mmc_host *mmc = platform_get_drvdata(dev);
> +	struct shmmc_host *host = mmc_priv(mmc);
> +	struct resource *r;
> +
> +	MMC_OUTB(host, INTCR0, 0);
> +	MMC_OUTB(host, INTCR1, 0);
> +	MMC_OUTB(host, INTCR2, 0);
> +	shmmc_clrirq(host);
> +	tasklet_disable(&host->done_task);
> +	mmc_remove_host(mmc);

Don't free up any resources needed to handle requests before
mmc_remove_host() has returned.

Also, remember to run the mmc_test test suite on the driver. It tends
to find a lot of problems.

Rgds
-- 
     -- Pierre Ossman

  WARNING: This correspondence is being monitored by the
  Swedish government. Make sure your server uses encryption
  for SMTP traffic and consider using PGP for end-to-end
  encryption.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  parent reply	other threads:[~2008-07-18 23:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-17 11:01 [PATCH] sh7760mmc: host driver for SH7760 MMC interface Manuel Lauss
2008-07-17 11:03 ` Manuel Lauss
2008-07-17 23:09 ` Paul Mundt
2008-07-18  1:25 ` Nobuhiro Iwamatsu
2008-07-18  5:12 ` Manuel Lauss
2008-07-18 23:49 ` Pierre Ossman [this message]
2008-07-19  7:04 ` Manuel Lauss
2008-07-19 12:02 ` Pierre Ossman

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=20080719014933.18b9eba4@mjolnir.drzeus.cx \
    --to=drzeus@drzeus.cx \
    --cc=linux-sh@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