linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mmc: mmci: Gate the clock when freq is 0
Date: Fri, 21 Dec 2012 16:21:32 +0000	[thread overview]
Message-ID: <20121221162132.GI14363@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1355327421-20187-1-git-send-email-ulf.hansson@stericsson.com>

On Wed, Dec 12, 2012 at 04:50:21PM +0100, Ulf Hansson wrote:
> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> index edc3e9b..bf07823 100644
> --- a/drivers/mmc/host/mmci.c
> +++ b/drivers/mmc/host/mmci.c
> @@ -1147,6 +1147,15 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>  		}
>  	}
>  
> +	/*
> +	 * If clock = 0 and the block needs a certain value in the clreg
> +	 * to function, we need to gate the clock by removing MCI_PWR_ON.
> +	 * This is a special case for ST Micro variants, since the power
> +	 * register in the ARM legacy case is used for powering the cards.

I wish you'd stop using "legacy" when talking about the ARM primecell.
How can it be legacy when ARMs current development boards still use this
primecell?

> +	 */
> +	if (!ios->clock && variant->clkreg)
> +		pwr &= ~MCI_PWR_ON;

This is horrid.  You're overloading the clkreg default value with another
meaning here - "if we have any bits set in the default value for the
MCICLOCK register, the MCIPOWER register has special meanings for the
power control bits".

When you think about it as I've described it above, do you think this is
an acceptable solution to this problem?

  parent reply	other threads:[~2012-12-21 16:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-12 15:50 [PATCH] mmc: mmci: Gate the clock when freq is 0 Ulf Hansson
2012-12-12 18:57 ` Linus Walleij
2012-12-21 16:21 ` Russell King - ARM Linux [this message]
2013-01-07 10:29   ` Ulf Hansson
2013-01-07 16:28     ` Ulf Hansson

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=20121221162132.GI14363@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).