dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Red freeze
From: Mike Holden (
Date: 2003-03-29

Björn Stenberg said:
> However, the single most important problem right now is the "red led
> dead". This appears to be a condition where the drive never recovers
> from failure and thus reports errors forever. Hence my attempt with
> using a hard reset.

Another idea -
we recently added a patch that updated last_disk_activity on each loop
within ata_read_sectors(). This was to resolve the problem where the disk
could spindown during an interrupted read. Since wait_for_rdy() and
wait_for_bsy() have a built in maximum timeout of 10 seconds (10*HZ), we
should do the same here as well. If either of these functions takes a few
seconds, we could be spinning the disk down (default disk spindown is I
think 5 seconds). We could either update it each time round the while()
loop, or we could pre-empt it and set it to the function timeout value on
entry and set it again on exit (I assume that nothing will get "confused"
by having last_disk_activity in the future? It seems to be a simple
integer arithmetic comparison to current_tick-timeout or similar, so
should be ok).

As an additional question, both of these functions use a sleep_thread()
call. The code does some hardware stuff with the SBYCR address, and the
comment says that wakeup is by interrupt. What kind of events will provide
this wakeup?

Mike Holden

Page was last modified "Jan 10 2012" The Rockbox Crew