login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
October
»
13
Re: [PATCH] mmc: append a file to change host clock at run time
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Adrian Hunter
Subject:
Re: [PATCH] mmc: append a file to change host clock at run time
Date: Wednesday, October 13, 2010 - 1:07 am
On 12/10/10 18:17, Andy Shevchenko wrote:
quoted text
> For debugging power managment features there is quite convenient to have a > possibility to change MMC host controller clock at run time. This patch adds > 'clock' file under MMC host root of debugfs. > > Usage as follows: > > # cat /sys/kernel/debug/mmc0/clock > 24000000 > > # echo "1000000000"> /sys/kernel/debug/mmc0/clock > # cat /sys/kernel/debug/mmc0/clock > 52000000 > > # echo "48000000"> /sys/kernel/debug/mmc0/clock > # cat /sys/kernel/debug/mmc0/clock > 48000000 > > The second piece of example shows limits which are applied accordingly to used > host driver. > > Signed-off-by: Andy Shevchenko<ext-andriy.shevchenko@nokia.com> > --- > drivers/mmc/core/debugfs.c | 33 +++++++++++++++++++++++++++++++-- > 1 files changed, 31 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c > index 96d10f4..4ff109f 100644 > --- a/drivers/mmc/core/debugfs.c > +++ b/drivers/mmc/core/debugfs.c > @@ -133,6 +133,31 @@ static const struct file_operations mmc_ios_fops = { > .release = single_release, > }; > > +static int mmc_clock_opt_get(void *data, u64 *val) > +{ > + struct mmc_host *host = data; > + > + *val = host->ios.clock; > + > + return 0; > +} > + > +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) > + return -EINVAL; > + > + mmc_set_clock(host, (unsigned int) val);
Probably need to claim the host here otherwise you might be changing the clock while a request is in progress
quoted text
> + > + return 0; > +} > + > +DEFINE_SIMPLE_ATTRIBUTE(mmc_clock_fops, mmc_clock_opt_get, mmc_clock_opt_set, > + "%llu\n"); > + > void mmc_add_host_debugfs(struct mmc_host *host) > { > struct dentry *root; > @@ -149,11 +174,15 @@ void mmc_add_host_debugfs(struct mmc_host *host) > host->debugfs_root = root; > > if (!debugfs_create_file("ios", S_IRUSR, root, host,&mmc_ios_fops)) > - goto err_ios; > + goto err_node; > + > + if (!debugfs_create_file("clock", S_IRUSR | S_IWUSR, root, host, > + &mmc_clock_fops)) > + goto err_node; > > return; > > -err_ios: > +err_node: > debugfs_remove_recursive(root); > host->debugfs_root = NULL; > err_root:
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] mmc: append a file to change host clock at run time
, Andy Shevchenko
, (Tue Oct 12, 8:17 am)
Re: [PATCH] mmc: append a file to change host clock at run ...
, Andy Shevchenko
, (Wed Oct 13, 12:08 am)
Re: [PATCH] mmc: append a file to change host clock at run ...
, Adrian Hunter
, (Wed Oct 13, 1:07 am)
Re: [PATCH] mmc: append a file to change host clock at run ...
, Andy Shevchenko
, (Wed Oct 13, 1:15 am)
[PATCHv2] mmc: append a file to change host clock at run time
, Andy Shevchenko
, (Wed Oct 13, 1:22 am)
Re: [PATCHv2] mmc: append a file to change host clock at r ...
, Chris Ball
, (Wed Oct 13, 6:57 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Fortier,Vincent [Montreal]
2.6.21.5 june 30th to july 1st date hang?
Jeff Dike
[ PATCH 2/6 ] UML - Formatting fixes around os_{read_write}_file callers
Liam Girdwood
[PATCH 07/13] regulator: regulator test harness
Oleg Nesterov
Re: Getting the new RxRPC patches upstream
Stefan Seyfried
Re: 2.6.19-rc5: grub is much slower resuming from suspend-to-disk than in 2.6.18
linux-netdev
:
Arnaud Ebalard
Re: [REGRESSION,BISECTED] MIPv6 support broken by f4f914b58019f0
Jan Engelhardt
Re: [PATCH iptables] extension: add xt_cpu match
Jarek Poplawski
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Sebastian Andrzej Siewior
[PATCH 8/8] net/emergency: remove locking from reycling pool if emergncy pools are...
David Miller
Re: [PATCH] qlcnic: dont assume NET_IP_ALIGN is 2
git
:
Jakub Narebski
Re: git on MacOSX and files with decomposed utf-8 file names
Brandon Casey
Re: Thunderbird and patches (was Re: [PATCH v2] Enable setting attach as the def...
Christian Couder
[PATCH 1/3] rev-parse: add test script for "--verify"
Ramkumar Ramachandra
Re: [GSoC update] git-remote-svn: The final one
Junio C Hamano
Re: git-rm isn't the inverse action of git-add
openbsd-misc
:
Joachim Schipper
Re: UVC Webcams
Florin Andrei
SOLVED [was: firewall is very slow, something's wrong]
Todd Alan Smith
Re: Microsoft gets the Most Secure Operating Systems award
Neal Hogan
Re: Need Advice: Thinkpad T60 or T61?
Sam Fourman Jr.
Re: Real men don't attack straw men
git-commits-head
:
Linux Kernel Mailing List
ACPI: Disable ARB_DISABLE on platforms where it is not needed
Linux Kernel Mailing List
m68knommu: add read_barrier_depends() and irqs_disabled_flags()
Linux Kernel Mailing List
[MTD] Add mtd panic_write function pointer
Linux Kernel Mailing List
[ARM] pxa: remove duplicate select statements from Kconfig
Linux Kernel Mailing List
mlx4_core: Don't read reserved fields in mlx4_QUERY_ADAPTER()
Colocation donated by:
Syndicate