public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: Huang Changming-R66093 <r66093@freescale.com>
Cc: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	Jain Priyanka-B32167 <B32167@freescale.com>
Subject: Re: [PATCH v7] ESDHC: Workaround for data crc error on p1010rdb
Date: Sat, 11 Feb 2012 16:20:25 -0500	[thread overview]
Message-ID: <m2mx8pkqxy.fsf@bob.laptop.org> (raw)
In-Reply-To: <110EED8CC96DFC488B7E717A2027A27C01F304@039-SN1MPN1-002.039d.mgd.msft.net> (Huang Changming-R's message of "Thu, 9 Feb 2012 02:12:14 +0000")

Hi,

On Wed, Feb 08 2012, Huang Changming-R66093 wrote:
>> > +static void esdhc_of_set_clock(struct sdhci_host *host, unsigned int
>> clock)
>> > +{
>> > +	/* Workaround to reduce the clock frequency for p1010 esdhc */
>> > +	if (of_find_compatible_node(NULL, NULL, "fsl,p1010-esdhc")) {
>> > +		if (clock == 0) {
>> > +			host->clock = clock;
>> > +			return;
>> > +		}
>> 
>> Is this if (clock == 0) necessary?  You'll be calling esdhc_set_clock()
>> immediately afterwards, and it performs the same test.
>
> Yes, I perform this test two times.
> The first time, I test the original value (as the parameter from set_clock)
> The second time, I test it again, that is because the clock value has
> been changed or reduced,
> I think it is necessary to test it again. 

I don't see how it's necessary to test *if it is zero* again, because
you're not going to change or reduce it to zero.  You're going to
subtract 5M/10M from it if it was over 20M/40M, so there is no chance
of it reaching zero.

This isn't a huge deal, but:  could you walk me through an example of
where it's necessary to have the first test for 0, because something
bad would happen if you didn't?  I'm talking about this piece of code:

+       if (of_find_compatible_node(NULL, NULL, "fsl,p1010-esdhc")) {
+               if (clock == 0) {
+                       host->clock = clock;
+                       return;
+               }

.. which I think will get caught by the same test in esdhc_set_clock()
when you call that immediately after this test.

Thanks,

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

  reply	other threads:[~2012-02-11 21:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-08  8:05 [PATCH v7] ESDHC: Workaround for data crc error on p1010rdb r66093
2012-02-08 15:07 ` Chris Ball
2012-02-09  2:12   ` Huang Changming-R66093
2012-02-11 21:20     ` Chris Ball [this message]
2012-02-13  2:40       ` Huang Changming-R66093
2012-02-13  4:28         ` Chris Ball
2012-02-13  4:36           ` Chris Ball
2012-02-13  7:43             ` Huang Changming-R66093
2012-02-13 20:44               ` Chris Ball
2012-02-14  6:11                 ` Huang Changming-R66093
2012-03-28 11:15                   ` Latency Issue due to patch; " Jain Priyanka-B32167

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=m2mx8pkqxy.fsf@bob.laptop.org \
    --to=cjb@laptop.org \
    --cc=B32167@freescale.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=r66093@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