sata_mars : Investigation to get hd-idle to work in all hard disks
4 participantes
Página 1 de 2.
Página 1 de 2. • 1, 2
sata_mars : Investigation to get hd-idle to work in all hard disks
Hello,
we have discovered that hd-idle does not work in all hard disk, because some disk needs some more seconds to start,
and module sata_mars does not wait this amount of time.
The idea is to get source code of module sata_mars, increase the timer, and recompile.
Can someone helps to locate source code for mipsel of module sata_mars ?
Thanks you all
we have discovered that hd-idle does not work in all hard disk, because some disk needs some more seconds to start,
and module sata_mars does not wait this amount of time.
The idea is to get source code of module sata_mars, increase the timer, and recompile.
Can someone helps to locate source code for mipsel of module sata_mars ?
Thanks you all
vic1972- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
It is in the directory linux-2.6.12/drivers/scsi/ of the source tree LG-MS408D supplied by LG (upon request).vic1972 escribió:we have discovered that hd-idle does not work in all hard disk, because some disk needs some more seconds to start, and module sata_mars does not wait this amount of time. The idea is to get source code of module sata_mars, increase the timer, and recompile. Can someone helps to locate source code for mipsel of module sata_mars ?
So the question is one that I already posted several times in this forum, without response: Does anybody has the required tool-chain ready and know the details of how to compile a kernel module (and ideally the whole kernel too) ??
Best wishes,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
Hello,
regarding the toolchain, I cannot remember well, but i think there is a post in some place where keltek explained it....
Anyways, thanks for the info of source, I have in fact extracted some files from there:
probably we can start having a quick look into the sources to see if it is at least feasible to do the changes ..
http://dl.dropbox.com/u/684543/varios/ms450h/Cod_Fuente_LG/sata.zip
Best regards
regarding the toolchain, I cannot remember well, but i think there is a post in some place where keltek explained it....
Anyways, thanks for the info of source, I have in fact extracted some files from there:
probably we can start having a quick look into the sources to see if it is at least feasible to do the changes ..
http://dl.dropbox.com/u/684543/varios/ms450h/Cod_Fuente_LG/sata.zip
Best regards
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
I already had a look. It creates some hooks under /sys/bus/SATA.... In fact, when all the modules are loaded, many hooks are made available under the tree /sys/bus/SATA.... Interestingly, there is one called timeout which by default holds a value of "7" (seconds ¡¿?!). It can be changed at will by just writing another number onto it.Admin escribió:[...]we can start having a quick look into the sources to see if it is at least feasible to do the changes [...]
This particular hook does not seem to be created by sata_mars (and for the moment I don't know which other module --or the kernel-- does create it), but given the value "7" and the fact that 1TB+ disks happen to fail just because they take more than "7" seconds to spin-up, I think it would be worth trying to increase it to 9 or 10 and test hd-idle again.
Vic, can you do it yourself? (to test hd-idle it is better not to start the service and just run it manually for inmediate speendown: "hd-idle -t /dev/sda"). Otherwise, I can test it on your LG if you give me access to it, as you did last Sunday. Please, let me know.
Best,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
In my ms400 with usb disk, i have:
I will test later in the ms450, i cannot test right now.
But it seems there are different files....
- Código:
root@Venus:/sys/bus# ls -l
total 0
drwxr-xr-x 4 root root 0 Mar 29 16:11 SATA_BUS
drwxr-xr-x 4 root root 0 Jan 1 2009 i2c
drwxr-xr-x 4 root root 0 Jan 1 2009 platform
drwxr-xr-x 4 root root 0 Jan 1 2009 scsi
drwxr-xr-x 4 root root 0 Jan 1 2009 usb
root@Venus:/sys/bus# cd SATA_BUS/
root@Venus:/sys/bus/SATA_BUS# ls -
ls: -: No such file or directory
root@Venus:/sys/bus/SATA_BUS# ls
devices offline_dev scan_dev
drivers re_scan wait_insmod_state
root@Venus:/sys/bus/SATA_BUS#
I will test later in the ms450, i cannot test right now.
But it seems there are different files....
vic1972- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
Sorry, I wrote my message without having my LG at hand, so I wrote some wrong filenames. Here is the relevant tree:vic1972 escribió:In my ms400 with usb disk, i have:[...} I will test later in the ms450, i cannot test right now. But it seems there are different files....
- Código:
/sys/bus/SATA_BUS/
+ devices
| + SATA_DEV
| + host0
| | + target0:0:0
| | | + 0:0:0:0
| | | | + timeout
| | | [...]
| | [...]
| [..]
+ offline_dev
+ re_scan
[...]
cat timeout ; echo 10 > timeout ; cat timeout
Hope it is clear now.
Best,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
Yes, very clear now, thanks
wowww what a path
root@Venus:/sys/devices/SATA_DEV/host0/target0:0:0/0:0:0:0# cat timeout
10
ok, unfortunally i cannotest right now, as we are recording a couple of programs.,
will test tomorrow.
wowww what a path
root@Venus:/sys/devices/SATA_DEV/host0/target0:0:0/0:0:0:0# cat timeout
10
ok, unfortunally i cannotest right now, as we are recording a couple of programs.,
will test tomorrow.
vic1972- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
it works!!!!
I just did a unique test, and it worked fine.
I will keep it in using for some days.
thanks
I just did a unique test, and it worked fine.
I will keep it in using for some days.
thanks
vic1972- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
Thanks to you! These seem good news. Let's wait for a few more tests before including it in the hdidle service script.vic1972 escribió:it works!!!! I just did a unique test, and it worked fine. I will keep it in using for some days. thanks
Best,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
Some checkings.
echo 10 > /sys/devices/SATA_DEV/host0/target0:0:0/0:0:0:0/timeout
cat /sys/devices/SATA_DEV/host0/target0:0:0/0:0:0:0/timeout
echo 10 > /sys/devices/SATA_DEV/host0/target0:0:0/0:0:0:0/timeout
cat /sys/devices/SATA_DEV/host0/target0:0:0/0:0:0:0/timeout
vic1972- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
???... I don't understand... Maybe we should use Spanish...vic1972 escribió:Some checkings.
echo 10 > /sys/devices/SATA_DEV/host0/target0:0:0/0:0:0:0/timeout
cat /sys/devices/SATA_DEV/host0/target0:0:0/0:0:0:0/timeout
Best,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
jajaja
Sorry, I had to go in a kind or emergency ...
Just wanted to show all the necessary changes.
Changes are two:
*1* /usr/local/etc/starthddservices.sh
Near the end i have placed the code:
#Modify the timeout for SATA devices
echo 10 > /sys/devices/SATA_DEV/host0/target0:0:0/0:0:0:0/timeout
Why, because this value is resetted each time we start lg, so we are setting the right value.
I do not know if here is the best place, but it work well. suggestions are welcomed.
*2* Patch to enable the service,
we have to go to file:
root/custom/var/www/lgmenu/services/svc_hdidle.php
and comment or delete the line with the code:
return self::STATUS_NOCONTROL;
I am planing to put the changes in the service pack script, numeric code 960.
Another idea, is that, if we could put a value like 11 or 12, just in case .... ???
Sorry, I had to go in a kind or emergency ...
Just wanted to show all the necessary changes.
Changes are two:
*1* /usr/local/etc/starthddservices.sh
Near the end i have placed the code:
#Modify the timeout for SATA devices
echo 10 > /sys/devices/SATA_DEV/host0/target0:0:0/0:0:0:0/timeout
Why, because this value is resetted each time we start lg, so we are setting the right value.
I do not know if here is the best place, but it work well. suggestions are welcomed.
*2* Patch to enable the service,
we have to go to file:
root/custom/var/www/lgmenu/services/svc_hdidle.php
and comment or delete the line with the code:
return self::STATUS_NOCONTROL;
I am planing to put the changes in the service pack script, numeric code 960.
Another idea, is that, if we could put a value like 11 or 12, just in case .... ???
vic1972- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
I Think it is better to put it directly in the service script /tmp/hdd/root/custom/etc/init.d/hdidle:vic1972 escribió:Changes are two:
*1* /usr/local/etc/starthddservices.sh
Near the end i have placed the code:
#Modify the timeout for SATA devices
echo 10 > /sys/devices/SATA_DEV/host0/target0:0:0/0:0:0:0/timeout
Why, because this value is resetted each time we start lg, so we are setting the right value.
I do not know if here is the best place, but it work well. suggestions are welcomed.
- Código:
start)
echo "Change the timeout for SATA devices
echo 10 > /sys/devices/SATA_DEV/host0/target0:0:0/0:0:0:0/timeout
echo "Remounting /dev/sda4 with noatime flags"
...
I don't know how can you do all these changes without previously loading some script or file on the LG ... I'd rather implement a patch to be manually downloaded (from SF), then put in a USB drive and finally manually execute it from a telnet connection...*2* Patch to enable the service, we have to go to file:
root/custom/var/www/lgmenu/services/svc_hdidle.php
and comment or delete the line with the code:
return self::STATUS_NOCONTROL;
I am planing to put the changes in the service pack script, numeric code 960.
May be... I think this does not really harm.Another idea, is that, if we could put a value like 11 or 12, just in case .... ???
Best,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
Going to test it. Unfortunately I didn't have device like you so there must be some sophisticated command to set timeout for all the SATA hosts.
My device (MS400 with 1.5TB)
My device (MS400 with 1.5TB)
- Código:
/sys/devices/SATA_DEV/host1/target1:0:0/1:0:0:0/timeout
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
Yea! This is why I said:Keltek escribió:Going to test it. Unfortunately I didn't have device like you so there must be some sophisticated command to set timeout for all the SATA hosts. My device (MS400 with 1.5TB)
- Código:
/sys/devices/SATA_DEV/host1/target1:0:0/1:0:0:0/timeout
But it should be nice if your testing reveals that setting this timer does work for you... Of course, now something still left will be to test with a 1GB+ USB disk...This is just for the internal disk. In any case, the hdidle service script needs a complete rewrite to properly consider external SATA and/or USB disks. This can be done in another release
Best,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
Hi Vic, any news on your testing?vic1972 escribió:it works!!!!
I just did a unique test, and it worked fine. I will keep it in using for some days.
Best,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
It works now
I have to set the timeout to 20. I listen spinup the HDD and yes, it takes veeeeeeery long time. (with timeout 10 it not works and I must stop Samba and Transmission, but it is obvious)
So what about this"
(the mount command should be redesigned too)
I have to set the timeout to 20. I listen spinup the HDD and yes, it takes veeeeeeery long time. (with timeout 10 it not works and I must stop Samba and Transmission, but it is obvious)
So what about this"
- Código:
echo "Starting the hd-idle daemon"
TIMEOUTFILES=`ls /sys/devices/SATA_DEV/host?/target*/*/timeout`
for file in $TIMEOUTFILES; do
echo 20 > "$file"
done
/bin/mount -o remount,rw,noatime,nodiratime /dev/scsi/host1/bus0/target0/lun0/part4 /tmp/hdd/root
start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- $HD_IDLE_OPTS
(the mount command should be redesigned too)
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
Looks like good news ;) Thanks!Keltek escribió:It works now :)
I have to set the timeout to 20. I listen spinup the HDD and yes, it takes veeeeeeery long time. (with timeout 10 it not works and I must stop Samba and Transmission, but it is obvious)
Looks fine. Thanks! (but still it does not support 1TB+ USB disks).So what about this"
[...]
(the mount command should be redesigned too)
BTW, have you figured out which module does create the /sys/devices/SATA_DEV/host?/target*/*/timeout hooks?
Best,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
I don't know the SATA driver coding for Linux (I don't know any coding of drivers for Linux), but this is definitely in sata_mars, which use libata and scsi backend. But this seems all what I can say
Hey all, are there someone who is Linux kernel guru? Please?
USB device identification
I connect the 500GB disc to front USB and the timeout parameter is at
It can be found using this pattern:
So if I get this entry, it means this is the block device attached to USB (it can be flash disk or physical HDD) and on the same path (dirname <file>) is the timeout.
And so this should set the timeouts for all USB connected to system
- Código:
/sys/devices/platform/ehci_hcd/usb1/1-2/1-2:1.0/host2/target2:0:0/2:0:0:0/timeout
It can be found using this pattern:
- Código:
/sys/devices/platform/ehci_hcd/usb?/*/*/host?/*/*/block
So if I get this entry, it means this is the block device attached to USB (it can be flash disk or physical HDD) and on the same path (dirname <file>) is the timeout.
And so this should set the timeouts for all USB connected to system
- Código:
USBBLOCKS=`ls /sys/devices/platform/ehci_hcd/usb?/*/*/host?/*/*/block`
for file in $USBBLOCKS; do
USBTIMEOUT=`/usr/bin/dirname $file`/timeout
echo 20 > "$USBTIMEOUT"
done
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
Great. So we have already all the needed info to prepare a general purpose service script for hd-idle. I'll make a proposal tomorrow (unless you're faster, as usual ;)Keltek escribió:I connect the 500GB disc to front USB and the timeout parameter is atIt can be found using this pattern:
- Código:
/sys/devices/platform/ehci_hcd/usb1/1-2/1-2:1.0/host2/target2:0:0/2:0:0:0/timeout
So if I get this entry, it means this is the block device attached to USB (it can be flash disk or physical HDD) and on the same path (dirname <file>) is the timeout. And so this should set the timeouts for all USB connected to system
- Código:
/sys/devices/platform/ehci_hcd/usb?/*/*/host?/*/*/block
- Código:
USBBLOCKS=`ls /sys/devices/platform/ehci_hcd/usb?/*/*/host?/*/*/block`
for file in $USBBLOCKS; do
USBTIMEOUT=`/usr/bin/dirname $file`/timeout
echo 20 > "$USBTIMEOUT"
done
Best,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
I started to read the source code of sata_mars, looking for some timeout definitions. This is how I found some hooks under /sys/devices/SATA_DEV/. Then I was curiuous and continued searching under SATA_DEV/ and finally hit host?/target*/*/timeout ;)Keltek escribió:I don't know the SATA driver coding for Linux (I don't know any coding of drivers for Linux), but this is definitely in sata_mars, which use libata and scsi backend. But this seems all what I can say ;)Hey all, are there someone who is Linux kernel guru? Please?
But I found no code in sata_mars.[ch] related with the timeout hook or any other hooks which are under host?/target*/*/ ...
Nevertheless, I think the problem is solved, so this is just trying to understad the details...
Best,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
It can (and should) be using the libata interface in kernel. The driver itself is really simple (just access the hardware registers and all the work do libata, which is I think the main purpose for libata) and the rest of background is in the other resources. That's why I ask for Linux kernel guru
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
I think a more direct, simple and safe way is:Keltek escribió:I connect the 500GB disc to front USB and the timeout parameter is at[...] And so this should set the timeouts for all USB connected to system
- Código:
/sys/devices/platform/ehci_hcd/usb1/1-2/1-2:1.0/host2/target2:0:0/2:0:0:0/timeout
- Código:
USBBLOCKS=`ls /sys/devices/platform/ehci_hcd/usb?/*/*/host?/*/*/block`
for file in $USBBLOCKS; do
USBTIMEOUT=`/usr/bin/dirname $file`/timeout
echo 20 > "$USBTIMEOUT"
done
- Código:
D=/sys/devices/platform/ehci_hcd
USBTIMEOUTS=`ls $D/usb?/?-?/?-?:*/host?/target?:*/?:*/timeout 2>/dev/null`
for T in $USBTIMEOUTS ; do echo 20 > $T ; done
One problem (both with this and with the way you had proposed), however, is that this does not work if the USB disk is plugged after the hd-idle service script has been executed. So, ideally, I think the USB timeout setting should be set by means of hotpulg...
More ideas?
Best,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Re: sata_mars : Investigation to get hd-idle to work in all hard disks
I already had a look at libata.[ch], but I did not find anything clearly related with the hooks under: /sys/devices/SATA_DEV/host0/target0:0:0/0:0:0:0/ ...Keltek escribió:It can (and should) be using the libata interface in kernel. The driver itself is really simple (just access the hardware registers and all the work do libata, which is I think the main purpose for libata) and the rest of background is in the other resources. That's why I ask for Linux kernel guru :)
Best,
evr- Mensajes : 279
Fecha de inscripción : 12/10/2010
Página 1 de 2. • 1, 2
Página 1 de 2.
Permisos de este foro:
No puedes responder a temas en este foro.