Skip to contentSkip to conversation

Allow more IDE power management

PATCH In review Ben Guthro 2 participants 2 messages Aug 27, 2007

lore
Share & tools
lore

Ben Guthro

author
#0 lore raw

PATCH 1/1 Allow more IDE power management

Made the QEMU IDE disk tolerate more power-mgmt commands, specifically:
WIN_SETFEATURE(EN_AAM) - enable automatic acoustic mgmt
WIN_SETFEATURE(DIS_AAM) - disable automatic acoustic mgmt
WIN_SETFEATURE(DIS_APM) - disable automatic power mgmt
WIN_STANDBY
WIN_SETIDLE1
WIN_SLEEPNOW1
WIN_STANDBY2
WIN_SETIDLE2
WIN_SLEEPNOW2
WIN_STANDBYNOW2
These are all essentially no-ops, like existing support for EN_RLA (enable read lookahead) and WIN_STANDBYNOW1.

This fixes a crash in the SLES9-SP3 64bit kernel when the powersaved was started (with ACPI or ACM). This guest really only needs EN_AAM, DIS_APM, and WIN_SETIDLE1 support, but the others seemed sensible to include.

I've excluded EN_APM since I'm unsure of what that's agreeing to do. It's probably ok to include.

tools/ioemu/hw/ide.c +11 -1
diff -r b9f911005829 tools/ioemu/hw/ide.c
@@ -2136,6 +2136,9 @@ static void ide_ioport_write(void *opaqu
                 break;
             case 0xaa: /* read look-ahead enable */
             case 0x55: /* read look-ahead disable */
+	    case 0x42: /* enable Automatic Acoustic Mode */
+	    case 0xc2: /* disable Automatic Acoustic Mode */
+	    case 0x85: /* disable APM */
                 s->status = READY_STAT | SEEK_STAT;
                 ide_set_irq(s);
                 break;
@@ -2174,8 +2177,15 @@ static void ide_ioport_write(void *opaqu
 	    s->status = READY_STAT;
             ide_set_irq(s);
             break;
+        case WIN_IDLEIMMEDIATE:
+        case WIN_STANDBY:
+        case WIN_SETIDLE1:
 	case WIN_STANDBYNOW1:
-        case WIN_IDLEIMMEDIATE:
+        case WIN_SLEEPNOW1:
+        case WIN_STANDBY2:
+        case WIN_SETIDLE2:
+	case WIN_STANDBYNOW2:
+        case WIN_SLEEPNOW2:
 	    s->status = READY_STAT;
             ide_set_irq(s);
             break;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 14 lines · Ben Guthro

Made the QEMU IDE disk tolerate more power-mgmt commands, specifically:
WIN_SETFEATURE(EN_AAM) - enable automatic acoustic mgmt
WIN_SETFEATURE(DIS_AAM) - disable automatic acoustic mgmt
WIN_SETFEATURE(DIS_APM) - disable automatic power mgmt
WIN_STANDBY
WIN_SETIDLE1
WIN_SLEEPNOW1
WIN_STANDBY2
WIN_SETIDLE2
WIN_SLEEPNOW2
WIN_STANDBYNOW2
These are all essentially no-ops, like existing support for EN_RLA (enable read lookahead) and WIN_STANDBYNOW1.

Quoted 6 lines

This fixes a crash in the SLES9-SP3 64bit kernel when the powersaved was started (with ACPI or ACM). This guest really only needs EN_AAM, DIS_APM, and WIN_SETIDLE1 support, but the others seemed sensible to include.

I've excluded EN_APM since I'm unsure of what that's agreeing to do. It's probably ok to include.

This and other QEMU patches should really be sent to upstream QEMU for review and inclusion first so we don't have to maintain extra patches in Xen forever.

Dan.

Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=|