- Status Closed
- Percent Complete
- Task Type Patches
- Category Drivers
- Assigned To No-one
- Operating System All players
- Severity Low
- Priority Very Low
- Reported Version
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
FS#6789 - Shorten unnecessarily long sleep() in ata_init()
The initialization code in the ATA driver has what appears to be an excessively long sleep() of 1HZ. The portion of code turns IDE power on only if it is currently off so it may only be rarely reached, if ever.
The comment that goes with the sleep(HZ) suggests that it is to “allow voltage to build up”, but 1HZ seems like an excessively long time for this. Also, if it is needed, I think the sleep() would be better off inside the ide_power_enable() function as is already done on some targets.
Looking back over the SVN history, this code was added in revision 4095 (http://svn.rockbox.org/viewvc.cgi?view=rev&revision=4095) to fix “spinning disk while charging flashed FM+V2”. Is this problem still relevant and is this code still necessary?
This patch just shortens the sleep() to 1 tick, which should still be more than enough time for voltage stabalisation. I have tested on my H10 both with current SVN and with current SVN modified to turn IDE power off right before ata_init() is called. It seems to work fine there. I think what really needs to be tested is the issue that SVN commit 4095 fixed, so hopefully someone with a FM+V2 can test this patch and report back.
2007-11-04 07:58
Reason for closing: Out of Date
Additional comments about closing: Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407
Amiconn included a similar change in his
recent commit that enabled ata poweroff
for ipods.
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task
Currently on an Archos FM or V2 Recorder ide_powered() always returns true because HAVE_ATA_POWER_OFF is not defined. Because of this the ide_power_enable(true) and sleep(HZ) are never executed. Turning on IDE power shortly before calling ata_init() works fine.