Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Red led dead - this is where it goes wrong!!!
From: Mike Holden (rockbox_at_mikeholden.uklinux.net)
Date: 2003-05-02


I'll have a look at this. I assume that USE_SLEEP will not be defined?

One other point I just noticed, slightly related! Should we in fact be
calling ata_soft_reset() rather than perform_soft_reset(), since that
performs the mutex locking as well as the reset?

Björn Stenberg said:
> Mike Holden wrote:
>> Basically, when we hit this problem, the ATA_ALT_STATUS __always__
>> returns 0x80 (BUSY). [..] This usually happens when called from
>> perform_soft_reset() in ata_read_sectors()
>
> Excellent work!
>
>> I have tried changing the perform_soft_reset() call to an
>> ata_hard_reset(), but it seems that this doesn't always sort out the
>> disk either, so I need to look at an even more severe reset method.
>
> The ATA spec says:
>
> "Transition PM3:PM2:, When hardware reset, software reset, or DEVICE
> RESET command is received the device shall make a transition to the
> PM2:Standby mode."
>
> (PM3 is sleep mode, PM2 is standby mode.)
>
> So all of the three should work. If neither hard or soft reset work, you
> could try the DEVICE RESET command, but I doubt it will work any better.
>
> What is definitely worth trying, however, is to use power mode STANDBY
> instead of SLEEP. It draws a little bit more power, but does not require
> a reset to wake up. Silly of me not to try this before. Here's a patch:
>
> =================================================================== RCS
> file: /cvsroot/rockbox/firmware/drivers/ata.c,v
> retrieving revision 1.82
> diff -u -b -r1.82 ata.c
> --- firmware/drivers/ata.c 28 Apr 2003 12:02:14 -0000 1.82 +++
> firmware/drivers/ata.c 1 May 2003 20:44:58 -0000
> @@ -185,6 +185,7 @@
> return -1;
> }
> }
> +#ifdef USE_SLEEP
> else {
> if (perform_soft_reset()) {
> mutex_unlock(&ata_mtx);
> @@ -192,6 +193,7 @@
> return -1;
> }
> }
> +#endif
> }
>
> timeout = current_tick + READ_TIMEOUT;
> @@ -334,6 +336,7 @@
> return -1;
> }
> }
> +#ifdef USE_SLEEP
> else {
> if (perform_soft_reset()) {
> mutex_unlock(&ata_mtx);
> @@ -341,6 +344,7 @@
> return -1;
> }
> }
> +#endif
> }
>
> ATA_SELECT = ata_device;
> @@ -490,7 +494,11 @@
> return -1;
> }
>
> +#ifdef USE_SLEEP
> ATA_COMMAND = CMD_SLEEP;
> +#else
> + ATA_COMMAND = CMD_STANDBY_IMMEDIATE;
> +#endif
>
> if (!wait_for_rdy())
> {
>
> --
> Björn

-- 
Mike Holden



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