public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: Philip Rakity <prakity@marvell.com>
Cc: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Subject: Re: [RFC]  sdhci: 8 bit bus width changes
Date: Fri, 19 Nov 2010 21:40:02 +0000	[thread overview]
Message-ID: <20101119214002.GA19272@void.printf.net> (raw)
In-Reply-To: <B76798A1-FA3F-4D7D-A22A-52289A4062FB@marvell.com>

Hi Philip,

I'd like to take this patch.  One comment, though: 

On Fri, Oct 01, 2010 at 03:45:50PM -0700, Philip Rakity wrote:
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 73a94fe..ec103c3 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1182,17 +1182,31 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>  	else
>  		sdhci_set_power(host, ios->vdd);
>  
> -	ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
>  
> -	if (ios->bus_width == MMC_BUS_WIDTH_8)
> -		ctrl |= SDHCI_CTRL_8BITBUS;
> -	else
> -		ctrl &= ~SDHCI_CTRL_8BITBUS;
> +	/*
> +	 * use platform_8_bit_width if not v3 controller
> +	 * or if special hw/board specific processing is needed
> +	 */
> +	if (host->ops->platform_8bit_width)
> +		host->ops->platform_8bit_width(host, ios->bus_width);
> +	else {
> +		ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
> +		if (ios->bus_width == MMC_BUS_WIDTH_8) {
> +			ctrl &= ~SDHCI_CTRL_4BITBUS;
> +			if (host->version >= SDHCI_SPEC_300)
> +				ctrl |= SDHCI_CTRL_8BITBUS;
> +		} else {
> +			if (host->version >= SDHCI_SPEC_300)
> +				ctrl &= ~SDHCI_CTRL_8BITBUS;
> +			if (ios->bus_width == MMC_BUS_WIDTH_4)
> +				ctrl |= SDHCI_CTRL_4BITBUS;
> +			else
> +				ctrl &= ~SDHCI_CTRL_4BITBUS;
> +		}
> +		sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
> +	}
>  
> -	if (ios->bus_width == MMC_BUS_WIDTH_4)
> -		ctrl |= SDHCI_CTRL_4BITBUS;
> -	else
> -		ctrl &= ~SDHCI_CTRL_4BITBUS;
> +	ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);

I don't see why we should re-read ctrl here, since we've already written
it back to the device at this point, and we don't use it anywhere below
this line.

Thanks,

-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

  parent reply	other threads:[~2010-11-19 21:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-01 22:45 [RFC] sdhci: 8 bit bus width changes Philip Rakity
2010-11-05  7:13 ` Peppe CAVALLARO
2010-11-19 21:40 ` Chris Ball [this message]
2010-11-19 21:53   ` Chris Ball
2010-11-20 12:35     ` Wolfram Sang
2010-11-20 16:37       ` Philip Rakity
2010-11-20 18:24       ` Chris Ball
2010-11-21 19:17         ` Philip Rakity
2010-11-22 10:16           ` zhangfei gao
2010-11-22 10:36           ` zhangfei gao
2010-11-22 16:13             ` Philip Rakity
2010-11-23  2:45               ` zhangfei gao
2010-11-24 17:35           ` Chris Ball
2010-11-20 16:37     ` Philip Rakity

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=20101119214002.GA19272@void.printf.net \
    --to=cjb@laptop.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=prakity@marvell.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