Show mmc (hdd style) activity in ac100 led

Asked by Francesco Cortassa Gozzi

Hi Guys!

First of all, my very big compliments to all of you for the hard work you have done to make the ac100 a pleasant-to-use machine!!!

I'd like to add the internal MMC activity notification, as it frequently happens that I start some heavy application, say Firefox, and the system gets stuck for some seconds. I dunno if I didn't click correctly or it's just a matter of waiting... In a proper laptop, I'd have a look at the HDD led to verify that the program is starting up.
I'd sacrifice the wifi led to use it for MMC activity.
Unfortunately I'm not that linux guru as you guys are, and that's the reason why I'm asking for your help.
What I know is that the MMC led is driven by the '/sys/class/leds/mmc0::/brightness' system file, and I'm looking for a convenient way to feed the '/sys/class/leds/wifi-led/brightness' wifi led with the mmc content... Or, even, another better way to do the job.

Just for testing, the following command does the trick, but it is awful and cpu consuming (I feel ashamed of this command!!!):

while : ; do cat "/sys/class/leds/mmc0::/brightness" > /sys/class/leds/wifi-led/brightness ;done

Does anyone of you have an idea on how to pipe the content of one file into the other, without making loops or whatever? I tried also to symlink without luck...

Thanks !!
Kind regards
francesco

Question information

Language:
English Edit question
Status:
Solved
For:
AC100_enablement Edit question
Assignee:
No assignee Edit question
Solved by:
Marc Dietrich
Solved:
Last query:
Last reply:
Revision history for this message
Gordan Bobic (gordan) said :
#1

On 07/31/2012 07:01 PM, Francesco Cortassa Gozzi wrote:
> New question #204692 on AC100_enablement:
> https://answers.launchpad.net/ac100/+question/204692
>
> Hi Guys!
>
> First of all, my very big compliments to all of you for the hard work you have done to make the ac100 a pleasant-to-use machine!!!
>
> I'd like to add the internal MMC activity notification, as it frequently happens that I start some heavy application, say Firefox, and the system gets stuck for some seconds. I dunno if I didn't click correctly or it's just a matter of waiting... In a proper laptop, I'd have a look at the HDD led to verify that the program is starting up.
> I'd sacrifice the wifi led to use it for MMC activity.
> Unfortunately I'm not that linux guru as you guys are, and that's the reason why I'm asking for your help.
> What I know is that the MMC led is driven by the '/sys/class/leds/mmc0::/brightness' system file, and I'm looking for a convenient way to feed the '/sys/class/leds/wifi-led/brightness' wifi led with the mmc content... Or, even, another better way to do the job.
>
> Just for testing, the following command does the trick, but it is awful and cpu consuming (I feel ashamed of this command!!!):
>
> while : ; do cat "/sys/class/leds/mmc0::/brightness"> /sys/class/leds/wifi-led/brightness ;done
>
> Does anyone of you have an idea on how to pipe the content of one file into the other, without making loops or whatever? I tried also to symlink without luck...

To make it efficient, you'd need to write a kernel patch that connects
these internally and runs every time the MMC interrupt triggers.

Gordan

Revision history for this message
Best Marc Dietrich (marvin24) said :
#2

Am Dienstag, 31. Juli 2012, 18:36:03 schrieb Gordan Bobic:
> Question #204692 on AC100_enablement changed:
> https://answers.launchpad.net/ac100/+question/204692
>
> Status: Open => Answered
>
> Gordan Bobic proposed the following answer:
>
> On 07/31/2012 07:01 PM, Francesco Cortassa Gozzi wrote:
> > New question #204692 on AC100_enablement:
> > https://answers.launchpad.net/ac100/+question/204692
> >
> > Hi Guys!
> >
> > First of all, my very big compliments to all of you for the hard work you
> > have done to make the ac100 a pleasant-to-use machine!!!
> >
> > I'd like to add the internal MMC activity notification, as it frequently
> > happens that I start some heavy application, say Firefox, and the system
> > gets stuck for some seconds. I dunno if I didn't click correctly or it's
> > just a matter of waiting... In a proper laptop, I'd have a look at the
> > HDD led to verify that the program is starting up. I'd sacrifice the wifi
> > led to use it for MMC activity.
> > Unfortunately I'm not that linux guru as you guys are, and that's the
> > reason why I'm asking for your help. What I know is that the MMC led is
> > driven by the '/sys/class/leds/mmc0::/brightness' system file, and I'm
> > looking for a convenient way to feed the
> > '/sys/class/leds/wifi-led/brightness' wifi led with the mmc content...
> > Or, even, another better way to do the job.
> >
> > Just for testing, the following command does the trick, but it is awful
> > and cpu consuming (I feel ashamed of this command!!!):
> >
> > while : ; do cat "/sys/class/leds/mmc0::/brightness">
> > /sys/class/leds/wifi-led/brightness ;done
> >
> > Does anyone of you have an idea on how to pipe the content of one file
> > into the other, without making loops or whatever? I tried also to symlink
> > without luck...
> To make it efficient, you'd need to write a kernel patch that connects
> these internally and runs every time the MMC interrupt triggers.

maybe not. I haven't my ac100 here, but in "theory", it should be enough to
echo mmc0 to the wifi led trigger in sysfs.

Marc

Revision history for this message
Francesco Cortassa Gozzi (francesco-cortassa) said :
#3

I'm sorry, for sure this is a stupid question, but how can I continuosly echo the content of one file into another one without making a loop? I googled for a solution, but I didn't find any so far... To my knowledge, it's a matter of linking the destination file to the source, and the symlink would do the trick, but in sysfs it seems that root can't do whatever he wants :)

The patching solution would be far the more efficient, but unfortunately I don't have any experience in kernel hacking, even if I'd love to learn it, and I would need at least some clue from you... I only found which is the gpio that is connected to the wifi led (#define TEGRA_WIFI_LED TEGRA_GPIO_PD0 in arch/arm/mach-tegra/board-paz00.h), but how to drive it ... well, big black hole....

Ciao!
Francesco

Revision history for this message
Marco Filippi (filippi) said :
#4

Francesco, don't waste your time and do a

echo mmc0 >/sys/class/leds/wifi-led/trigger

as Marc suggested, I can confirm this works fine.

Marco

Revision history for this message
turbooster (comacritter) said :
#5

Can the other leds be controlled too? In /sys/class/leds/ there's only
wifi-led. It's kind of sad that the only led that tells something useful
should used for this and not one of the other three that all show more or
less the same thing.
Can they be controlled some place else?
Thanks for the info nevertheless.

2012/8/2 Marco Filippi <email address hidden>

> Question #204692 on AC100_enablement changed:
> https://answers.launchpad.net/ac100/+question/204692
>
> Status: Open => Answered
>
> Marco Filippi proposed the following answer:
> Francesco, don't waste your time and do a
>
> echo mmc0 >/sys/class/leds/wifi-led/trigger
>
> as Marc suggested, I can confirm this works fine.
>
> Marco
>
> --
> You received this question notification because you are a member of
> AC100 Team, which is an answer contact for AC100_enablement.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~ac100
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~ac100
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Gordan Bobic (gordan) said :
#6

On 08/02/2012 01:30 PM, Marco Filippi wrote:
> Question #204692 on AC100_enablement changed:
> https://answers.launchpad.net/ac100/+question/204692
>
> Status: Open => Answered
>
> Marco Filippi proposed the following answer:
> Francesco, don't waste your time and do a
>
> echo mmc0>/sys/class/leds/wifi-led/trigger
>
> as Marc suggested, I can confirm this works fine.

What values does the trigger accept? What would it take to make it
activate on USB block device access?

Gordan

Revision history for this message
Marco Filippi (filippi) said :
#7

To see accepted values do a

cat /sys/class/leds/wifi-led/trigger

the value between [ ] is the current one.

I don't know if there is a trigger for USB block device and I haven't my ac100 with me .

Marco

Revision history for this message
Francesco Cortassa Gozzi (francesco-cortassa) said :
#8

Wow, that did the trick!! I didn't know anything about the 'trigger' before now! That's nice!!

Thank you guys!

Francesco

Revision history for this message
Francesco Cortassa Gozzi (francesco-cortassa) said :
#9

Thanks Marc Dietrich, that solved my question.

Revision history for this message
Francesco Cortassa Gozzi (francesco-cortassa) said :
#10

Many thanks to Marco too for the explanation!!!
Linux rocks :)

Revision history for this message
Julian Andres Klode (juliank) said :
#11

Just a question, which computers do have disk activity leds? My two laptops (ThinkPad Edge and HP Compaq) don't, and I don't think my desktops had them. I guess that the top ThinkPad lines might have them, but I personally can't remember to have seen something like this.