linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
To: Sebastian Rasmussen <sebras@gmail.com>
Cc: linux-mmc@vger.kernel.org
Subject: Re: [PATCH] mmc: debugfs: expose the SDCLK frq in sys ios (v3)
Date: Thu, 03 Nov 2011 07:46:54 +0100	[thread overview]
Message-ID: <4EB238DE.9050706@st.com> (raw)
In-Reply-To: <CAAgDR1N=mPVMoQNHmFvX2BvH_nmuemzQx3+z16qqS7BjQeOWDg@mail.gmail.com>

On 10/28/2011 12:02 AM, Sebastian Rasmussen wrote:
> Hi!
> 
>> +++ b/drivers/mmc/host/sdhci.c
>> @@ -1107,9 +1113,13 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
>>                        if ((host->max_clk / div) <= clock)
>>                                break;
>>                }
>> +               real_div = div;
>>                div >>= 1;
>>        }
>>
>> +       if (real_div)
>> +               host->mmc->actual_clock = (host->max_clk * clk_mul) / real_div;
> 
> What triggered me to look at this is that usually a divider of 0 means
> that the clock is not divided at all, and your code seemed to set
> host->mmc->actual_clock to 0 in this case. After further inspection I
> realize that real_div appears to always be >= 1 which means that the
> if-statement is unnecessary. Or did I miss something?

fixed in v4
thx
peppe

> 
>  / Sebastian
> 
> PS. I don't have a good SDHCI spec, is it publicly available
> somewhere? I have only found Pierre Ossman's old wiki on
> archive.org...
> 


  reply	other threads:[~2011-11-03  6:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-19 13:45 [PATCH] sdhci: expose the SDCLK frq in sys ios Giuseppe CAVALLARO
2011-10-20  6:22 ` Adrian Hunter
2011-10-20  6:31   ` Giuseppe CAVALLARO
2011-10-20  7:38     ` Adrian Hunter
2011-10-20  8:00       ` Giuseppe CAVALLARO
2011-10-21  8:16 ` [PATCH] mmc: debugfs: expose the SDCLK frq in sys ios (v2) Giuseppe CAVALLARO
2011-10-25  8:40   ` Adrian Hunter
2011-10-26 11:21     ` Giuseppe CAVALLARO
2011-10-27  6:16 ` [PATCH] mmc: debugfs: expose the SDCLK frq in sys ios (v3) Giuseppe CAVALLARO
2011-10-27 22:02   ` Sebastian Rasmussen
2011-11-03  6:46     ` Giuseppe CAVALLARO [this message]
2011-11-02 10:38   ` Adrian Hunter
2011-11-03  6:46     ` Giuseppe CAVALLARO

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=4EB238DE.9050706@st.com \
    --to=peppe.cavallaro@st.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=sebras@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 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).