From: Shawn Lin <shawn.lin@rock-chips.com>
To: "Wodkowski, PawelX" <pawelx.wodkowski@intel.com>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Cc: shawn.lin@rock-chips.com, "Dong,
Chuanxiao" <chuanxiao.dong@intel.com>,
"Yuan, Juntao" <juntao.yuan@intel.com>
Subject: Re: [PATCH] mmc: Add a restriction to mmc debugfs clock setting.
Date: Tue, 19 Jan 2016 15:44:19 +0800 [thread overview]
Message-ID: <569DE953.6080605@rock-chips.com> (raw)
In-Reply-To: <F6F2A6264E145F47A18AB6DF8E87425D249C45CB@IRSMSX102.ger.corp.intel.com>
On 2016/1/19 14:44, Wodkowski, PawelX wrote:
>> -----Original Message-----
>> From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
>> owner@vger.kernel.org] On Behalf Of Shawn Lin
>> Sent: Tuesday, January 19, 2016 7:35 AM
>> To: Wodkowski, PawelX <pawelx.wodkowski@intel.com>; linux-
>> mmc@vger.kernel.org
>> Cc: shawn.lin@rock-chips.com; Dong, Chuanxiao
>> <chuanxiao.dong@intel.com>; Yuan, Juntao <juntao.yuan@intel.com>
>> Subject: Re: [PATCH] mmc: Add a restriction to mmc debugfs clock setting.
>>
>> On 2016/1/19 14:13, Pawel Wodkowski wrote:
>>> From: Chuanxiao Dong <chuanxiao.dong@intel.com>
>>>
>>> Clock frequency values written to an mmc host should not be less than
>>> the minimum clock frequency which the mmc host supports.
>>>
>>> Signed-off-by: Yuan Juntao <juntaox.yuan@intel.com>
>>> Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
>>> ---
>>> drivers/mmc/core/debugfs.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
>>> index 154aced0b91b..bdfce774d848 100644
>>> --- a/drivers/mmc/core/debugfs.c
>>> +++ b/drivers/mmc/core/debugfs.c
>>> @@ -220,7 +220,7 @@ static int mmc_clock_opt_set(void *data, u64
>> val)
>>> struct mmc_host *host = data;
>>>
>>> /* We need this check due to input value is u64 */
>>> - if (val > host->f_max)
>>> + if (val > host->f_max || val < host->f_min)
>>
>> Hmm... how about if I want to disable clk from sysfs and pass ZERO to
>> mmc_clock_opt_set, doesn't that case make sense? :)
>>
>
> So maybe something like this?
> if (val != 0 && (val > host->f_max || val < host->f_min))
yep.
>
--
Best Regards
Shawn Lin
prev parent reply other threads:[~2016-01-19 7:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-19 6:13 [PATCH] mmc: Add a restriction to mmc debugfs clock setting Pawel Wodkowski
2016-01-19 6:35 ` Shawn Lin
2016-01-19 6:44 ` Wodkowski, PawelX
2016-01-19 7:44 ` Shawn Lin [this message]
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=569DE953.6080605@rock-chips.com \
--to=shawn.lin@rock-chips.com \
--cc=chuanxiao.dong@intel.com \
--cc=juntao.yuan@intel.com \
--cc=linux-mmc@vger.kernel.org \
--cc=pawelx.wodkowski@intel.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