All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: P L Sai Krishna <lakshmi.sai.krishna.potthuri@xilinx.com>
Cc: Michal Simek <michal.simek@xilinx.com>,
	Soren Brinkmann <soren.brinkmann@xilinx.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Kevin Hao <haokexin@gmail.com>, Emil Lenchak <emill@xilinx.com>,
	Tobias Klauser <tklauser@distanz.ch>,
	Sudeep Holla <Sudeep.Holla@arm.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Jisheng Zhang <jszhang@marvell.com>,
	"Ivan T. Ivanov" <ivan.ivanov@linaro.org>,
	Scott Branden <sbranden@broadcom.com>,
	Vincent Yang <vincent.yang.fujitsu@gmail.com>,
	Haibo Chen <haibo.chen@freescale.com>,
	Marek Vasut <marex@denx.de>,
	"ludovic.desroches@atmel.com" <ludovic.desroches@atmel.com>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Suman Tripathi <stripathi@apm.com>,
	Shawn Lin <shawn.lin@rock-chips.com>,
	devicetree@vger.kernel.org, Harini Katakam <harinik@xilinx.com>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	P L Sai Krishna <lakshmis@xilinx.com>,
	Anirudha Sarangi <anirudh@xilinx.com>,
	Punnaiah Choudary Kalluri <punnaia@xilinx.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [LINUX PATCH 1/5] mmc: Workaround for the issue in auto tuning mode.
Date: Tue, 19 Jan 2016 17:57:58 +0000	[thread overview]
Message-ID: <20160119175757.GR19062@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1453213055-35563-1-git-send-email-lakshmis@xilinx.com>

On Tue, Jan 19, 2016 at 07:47:31PM +0530, P L Sai Krishna wrote:
> +void arasan_tune_sdclk(struct sdhci_host *host)

static?

> +{
> +	unsigned int clock;
> +
> +	clock = host->clock;

Maybe combine the above two lines:

	unsigned int clock = host->clock;

?

> +
> +	/*
> +	 * As per controller erratum, program the SDCLK Frequency
> +	 * Select of clock control register with a value, say
> +	 * clock/2. Wait for the Internal clock stable and program
> +	 * the desired frequency.
> +	 */
> +	host->ops->set_clock(host, clock/2);

The comment above says "wait for the internal clock stable" - I see
no wait in here.  Does the code actually conform with the comment?

Please also use "clock / 2" as per coding style, thanks

> +
> +	host->ops->set_clock(host, host->clock);

Maybe replace host->clock with clock?

> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index d622435..8b064cd 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -2043,6 +2043,11 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
>  		err = -EIO;
>  	}
>  
> +	if ((host->quirks2 & SDHCI_QUIRK2_BROKEN_TUNING) &&
> +		(tuning_loop_counter >= 0) && (ctrl & SDHCI_CTRL_TUNED_CLK)) {
> +		host->ops->tune_clk(host);
> +	}

Do we need this "SDHCI_QUIRK2_BROKEN_TUNING" quirk at all?  What's wrong
with:

	if (host->ops->tune_clk && tuning_loop_counter >= 0 &&
	    ctrl & SDHCI_CTRL_TUNED_CLK)
		host->ops->tune_clk(host);

here?

-- 
RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

WARNING: multiple messages have this Message-ID (diff)
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: P L Sai Krishna <lakshmi.sai.krishna.potthuri@xilinx.com>
Cc: Michal Simek <michal.simek@xilinx.com>,
	Soren Brinkmann <soren.brinkmann@xilinx.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Kevin Hao <haokexin@gmail.com>, Emil Lenchak <emill@xilinx.com>,
	Tobias Klauser <tklauser@distanz.ch>,
	Sudeep Holla <Sudeep.Holla@arm.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Jisheng Zhang <jszhang@marvell.com>,
	"Ivan T. Ivanov" <ivan.ivanov@linaro.org>,
	Scott Branden <sbranden@broadcom.com>,
	Vincent Yang <vincent.yang.fujitsu@gmail.com>,
	Haibo Chen <haibo.chen@freescale.com>,
	Marek Vasut <marex@denx.de>,
	"ludovic.desroches@atmel.com" <ludovic.desroches@atmel.com>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Suman Tripathi <stripathi@apm.com>,
	Shawn Lin <shawn.lin@rock-chips.com>,
	devicetree@vger
Subject: Re: [LINUX PATCH 1/5] mmc: Workaround for the issue in auto tuning mode.
Date: Tue, 19 Jan 2016 17:57:58 +0000	[thread overview]
Message-ID: <20160119175757.GR19062@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1453213055-35563-1-git-send-email-lakshmis@xilinx.com>

On Tue, Jan 19, 2016 at 07:47:31PM +0530, P L Sai Krishna wrote:
> +void arasan_tune_sdclk(struct sdhci_host *host)

static?

> +{
> +	unsigned int clock;
> +
> +	clock = host->clock;

Maybe combine the above two lines:

	unsigned int clock = host->clock;

?

> +
> +	/*
> +	 * As per controller erratum, program the SDCLK Frequency
> +	 * Select of clock control register with a value, say
> +	 * clock/2. Wait for the Internal clock stable and program
> +	 * the desired frequency.
> +	 */
> +	host->ops->set_clock(host, clock/2);

The comment above says "wait for the internal clock stable" - I see
no wait in here.  Does the code actually conform with the comment?

Please also use "clock / 2" as per coding style, thanks

> +
> +	host->ops->set_clock(host, host->clock);

Maybe replace host->clock with clock?

> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index d622435..8b064cd 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -2043,6 +2043,11 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
>  		err = -EIO;
>  	}
>  
> +	if ((host->quirks2 & SDHCI_QUIRK2_BROKEN_TUNING) &&
> +		(tuning_loop_counter >= 0) && (ctrl & SDHCI_CTRL_TUNED_CLK)) {
> +		host->ops->tune_clk(host);
> +	}

Do we need this "SDHCI_QUIRK2_BROKEN_TUNING" quirk at all?  What's wrong
with:

	if (host->ops->tune_clk && tuning_loop_counter >= 0 &&
	    ctrl & SDHCI_CTRL_TUNED_CLK)
		host->ops->tune_clk(host);

here?

-- 
RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

WARNING: multiple messages have this Message-ID (diff)
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [LINUX PATCH 1/5] mmc: Workaround for the issue in auto tuning mode.
Date: Tue, 19 Jan 2016 17:57:58 +0000	[thread overview]
Message-ID: <20160119175757.GR19062@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1453213055-35563-1-git-send-email-lakshmis@xilinx.com>

On Tue, Jan 19, 2016 at 07:47:31PM +0530, P L Sai Krishna wrote:
> +void arasan_tune_sdclk(struct sdhci_host *host)

static?

> +{
> +	unsigned int clock;
> +
> +	clock = host->clock;

Maybe combine the above two lines:

	unsigned int clock = host->clock;

?

> +
> +	/*
> +	 * As per controller erratum, program the SDCLK Frequency
> +	 * Select of clock control register with a value, say
> +	 * clock/2. Wait for the Internal clock stable and program
> +	 * the desired frequency.
> +	 */
> +	host->ops->set_clock(host, clock/2);

The comment above says "wait for the internal clock stable" - I see
no wait in here.  Does the code actually conform with the comment?

Please also use "clock / 2" as per coding style, thanks

> +
> +	host->ops->set_clock(host, host->clock);

Maybe replace host->clock with clock?

> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index d622435..8b064cd 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -2043,6 +2043,11 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
>  		err = -EIO;
>  	}
>  
> +	if ((host->quirks2 & SDHCI_QUIRK2_BROKEN_TUNING) &&
> +		(tuning_loop_counter >= 0) && (ctrl & SDHCI_CTRL_TUNED_CLK)) {
> +		host->ops->tune_clk(host);
> +	}

Do we need this "SDHCI_QUIRK2_BROKEN_TUNING" quirk at all?  What's wrong
with:

	if (host->ops->tune_clk && tuning_loop_counter >= 0 &&
	    ctrl & SDHCI_CTRL_TUNED_CLK)
		host->ops->tune_clk(host);

here?

-- 
RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

  parent reply	other threads:[~2016-01-19 17:58 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-19 14:17 [LINUX PATCH 1/5] mmc: Workaround for the issue in auto tuning mode P L Sai Krishna
2016-01-19 14:17 ` P L Sai Krishna
2016-01-19 14:17 ` P L Sai Krishna
2016-01-19 14:17 ` [LINUX PATCH 2/5] Documentation: mmc: Updated the binding doc for Arasan SDHCI P L Sai Krishna
2016-01-19 14:17   ` P L Sai Krishna
2016-01-19 14:17   ` P L Sai Krishna
2016-01-19 16:50   ` Sören Brinkmann
2016-01-19 16:50     ` Sören Brinkmann
2016-01-19 16:50     ` Sören Brinkmann
2016-01-19 17:19   ` Rob Herring
2016-01-19 17:19     ` Rob Herring
2016-01-19 17:19     ` Rob Herring
2016-01-19 19:03     ` Michal Simek
2016-01-19 19:03       ` Michal Simek
2016-01-19 19:03       ` Michal Simek
2016-01-19 14:17 ` [LINUX PATCH 3/5] mmc: host: Added DT support to use SDIO in standard speed P L Sai Krishna
2016-01-19 14:17   ` P L Sai Krishna
2016-01-19 14:17   ` P L Sai Krishna
2016-01-19 14:17 ` [LINUX PATCH 4/5] Documentation: mmc: Updated the binding doc for Arasan SDHCI P L Sai Krishna
2016-01-19 14:17   ` P L Sai Krishna
2016-01-19 14:17   ` P L Sai Krishna
2016-01-19 17:16   ` Rob Herring
2016-01-19 17:16     ` Rob Herring
2016-01-19 17:16     ` Rob Herring
2016-01-20  5:51     ` Lakshmi Sai Krishna Potthuri
2016-01-20  5:51       ` Lakshmi Sai Krishna Potthuri
2016-01-20  5:51       ` Lakshmi Sai Krishna Potthuri
2016-01-20 15:05       ` Rob Herring
2016-01-20 15:05         ` Rob Herring
2016-01-20 15:05         ` Rob Herring
2016-01-19 14:17 ` [LINUX PATCH 5/5] mmc: host: Update the quirks for this controller P L Sai Krishna
2016-01-19 14:17   ` P L Sai Krishna
2016-01-19 14:17   ` P L Sai Krishna
2016-01-19 16:05   ` Holger Schurig
2016-01-19 16:05     ` Holger Schurig
2016-01-19 16:05     ` Holger Schurig
2016-01-19 15:01 ` [LINUX PATCH 1/5] mmc: Workaround for the issue in auto tuning mode Chen-Yu Tsai
2016-01-19 15:01   ` Chen-Yu Tsai
2016-01-19 15:01   ` Chen-Yu Tsai
2016-01-20  5:21   ` Lakshmi Sai Krishna Potthuri
2016-01-20  5:21     ` Lakshmi Sai Krishna Potthuri
2016-01-20  5:21     ` Lakshmi Sai Krishna Potthuri
2016-01-19 17:57 ` Russell King - ARM Linux [this message]
2016-01-19 17:57   ` Russell King - ARM Linux
2016-01-19 17:57   ` Russell King - ARM Linux
2016-01-20  6:02   ` Lakshmi Sai Krishna Potthuri
2016-01-20  6:02     ` Lakshmi Sai Krishna Potthuri
2016-01-20  6:02     ` Lakshmi Sai Krishna Potthuri

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=20160119175757.GR19062@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=Sudeep.Holla@arm.com \
    --cc=adrian.hunter@intel.com \
    --cc=anirudh@xilinx.com \
    --cc=devicetree@vger.kernel.org \
    --cc=emill@xilinx.com \
    --cc=galak@codeaurora.org \
    --cc=haibo.chen@freescale.com \
    --cc=haokexin@gmail.com \
    --cc=harinik@xilinx.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=ivan.ivanov@linaro.org \
    --cc=jszhang@marvell.com \
    --cc=lakshmi.sai.krishna.potthuri@xilinx.com \
    --cc=lakshmis@xilinx.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ludovic.desroches@atmel.com \
    --cc=marex@denx.de \
    --cc=mark.rutland@arm.com \
    --cc=michal.simek@xilinx.com \
    --cc=pawel.moll@arm.com \
    --cc=punnaia@xilinx.com \
    --cc=robh+dt@kernel.org \
    --cc=sbranden@broadcom.com \
    --cc=shawn.lin@rock-chips.com \
    --cc=soren.brinkmann@xilinx.com \
    --cc=stripathi@apm.com \
    --cc=tklauser@distanz.ch \
    --cc=ulf.hansson@linaro.org \
    --cc=vincent.yang.fujitsu@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.