FS#6421 - Make "disk power off" always be on on supported targets, remove the option.
Attached to Project:
Rockbox
Opened by Nils Wallménius (nls) - Friday, 08 December 2006, 11:42 GMT
Last edited by Nils Wallménius (nls) - Friday, 08 December 2006, 14:15 GMT
Opened by Nils Wallménius (nls) - Friday, 08 December 2006, 11:42 GMT
Last edited by Nils Wallménius (nls) - Friday, 08 December 2006, 14:15 GMT
|
DetailsThis patch makes rockbox always power down the disk when it is spun down on supported targets and removes the "disk poweroff" option in the "general settings -> system -> disk" menu as it is now uneccesary. I do not know of a way to check if the disk is actually powered down...
Tested on H320 works well. Also since the settings block changed, your settings will be reset. Edit: size comparison shows that it makes rockbox.iriver 172 bytes smaller for H300. |
This task depends upon
Closed by Nils Wallménius (nls)
Tuesday, 23 January 2007, 15:46 GMT
Reason for closing: Accepted
Additional comments about closing: comitted
Tuesday, 23 January 2007, 15:46 GMT
Reason for closing: Accepted
Additional comments about closing: comitted
Things to and from the hard drive should be cached to avoid this issue. I am not sure what problems wold arise of you cached disk commands.
to Reproduce go to a directory containing a txt file. Wait for the hard drive to power off. Try opeining the text file. This will faill but the drive will spool. Try reading it again and It will work.
Tried on H10 20G
The directory cache setting is turned on.
On a good note I tested this patch and got an extra 3 hours out of my device. This put battery consumption for the H10 at ~ 8 hours with no non-default settings other then this patch.
I am sure the crashes didn't help as when they happen the disk continued to spin until I noticed it and reset it. (Sometimes al long as 30 -45 mins.) I will continue to do more precise testing.
I have been trying to reproduce the bug that the first read fails, but it works flawlessly on my H300.
My suspision is that Rockbox tries to read from the disk too soon, as the power on, then spin up takes longer to finish.
One thing You could try is increasing the value of READ_TIMEOUT on line 64 in ata.c
(it looks like this)
#define READ_TIMEOUT 5*HZ
try increasing the number (seconds) before *HZ to maybe 7 or 8 and see if it works ok.
Sometimes "Can't open viewer" type errors.
Sometimes .rockbox directory missing
sometimes it just crashes (most notably when changeing songs)
Others it just freezes.
It does not take long to test the REAT_TIMEOUT setting. I can repoduce it every time.
but it doesn't
I am now trying without the patch and with the option on.
I will definaly be running this patch (as soon as I figure out a way around this power down issue.)
Index: firmware/drivers/ata.c
===================================================================
--- firmware/drivers/ata.c (revision 12071)
+++ firmware/drivers/ata.c (working copy)
@@ -100,7 +100,7 @@
static int wait_for_bsy(void) ICODE_ATTR;
static int wait_for_bsy(void)
{
- long timeout = current_tick + HZ*30;
+ long timeout = current_tick + HZ*60;
while (TIME_BEFORE(current_tick, timeout) && (ATA_STATUS & STATUS_BSY)) {
last_disk_activity = current_tick;
yield();
@@ -120,7 +120,7 @@
if (!wait_for_bsy())
return 0;
- timeout = current_tick + HZ*10;
+ timeout = current_tick + HZ*20;
while (TIME_BEFORE(current_tick, timeout) &&
!(ATA_ALT_STATUS & STATUS_RDY)) {
Feel free to open a bug report on this issue (although it's known it ensures that it isn't forgotten).
I'll let you know how it turns out.
Thanks
No crashes or read errors.