Re: [PATCH] mmc: Add a restriction to mmc debugfs clock setting.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2016/1/19 14:44, Wodkowski, PawelX wrote:
-----Original Message-----
From: linux-mmc-owner@xxxxxxxxxxxxxxx [mailto:linux-mmc-
owner@xxxxxxxxxxxxxxx] On Behalf Of Shawn Lin
Sent: Tuesday, January 19, 2016 7:35 AM
To: Wodkowski, PawelX <pawelx.wodkowski@xxxxxxxxx>; linux-
mmc@xxxxxxxxxxxxxxx
Cc: shawn.lin@xxxxxxxxxxxxxx; Dong, Chuanxiao
<chuanxiao.dong@xxxxxxxxx>; Yuan, Juntao <juntao.yuan@xxxxxxxxx>
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@xxxxxxxxx>

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@xxxxxxxxx>
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@xxxxxxxxx>
---
   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

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux