freemyipod r357 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r356‎ | r357 | r358 >
Date:02:28, 20 December 2010
Author:theseven
Status:new
Tags:
Comment:
emBIOS: Fix a shutdown lockup
Modified paths:
  • /embios/trunk/target/ipodclassic/storage_ata.c (modified) (history)

Diff [purge]

Index: embios/trunk/target/ipodclassic/storage_ata.c
@@ -148,6 +148,7 @@
149149 int ata_power_up()
150150 {
151151 ata_set_active();
 152+ if (ata_powered) return 0;
152153 i2c_sendbyte(0, 0xe6, 0x1b, 1);
153154 clockgate_enable(5, true);
154155 ATA_CFG = BIT(0);
@@ -239,6 +240,7 @@
240241
241242 void ata_power_down()
242243 {
 244+ if (!ata_powered) return;
243245 ata_powered = false;
244246 ata_wait_for_rdy(1000000);
245247 ata_write_cbr(&ATA_PIO_DVR, 0);