From: Ben Chalmers Date: Thu, 11 Jul 2013 08:13:08 +0000 (+0100) Subject: [CP-5276] Move suspend and resume watches so they only happen on system power changes X-Git-Tag: 8.1.0-rc1~35 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=43edb8687ec5483c917254eaee537aecebe1a98a;p=pvdrivers%2Fwin%2Fxeniface.git [CP-5276] Move suspend and resume watches so they only happen on system power changes --- diff --git a/build.py b/build.py index 5a850f4..eb82652 100644 --- a/build.py +++ b/build.py @@ -271,9 +271,9 @@ if __name__ == '__main__': if 'BUILD_NUMBER' not in os.environ.keys(): os.environ['BUILD_NUMBER'] = '0' - if 'MERCURIAL_REVISION' in os.environ.keys(): + if 'GIT_REVISION' in os.environ.keys(): revision = open('revision', 'w') - print(os.environ['MERCURIAL_REVISION'], file=revision) + print(os.environ['GIT_REVISION'], file=revision) revision.close() debug = { 'checked': True, 'free': False } diff --git a/src/xeniface/fdo.c b/src/xeniface/fdo.c index 67ba503..3f26583 100644 --- a/src/xeniface/fdo.c +++ b/src/xeniface/fdo.c @@ -744,9 +744,7 @@ FdoD3ToD0( SUSPEND(Acquire, Fdo->SuspendInterface); SHARED_INFO(Acquire, Fdo->SharedInfoInterface); - SessionsResumeAll(Fdo); - - Fdo->InterfacesAcquired = TRUE; + status = SUSPEND(Register, Fdo->SuspendInterface, @@ -756,8 +754,11 @@ FdoD3ToD0( &Fdo->SuspendCallbackLate); if (!NT_SUCCESS(status)) goto fail2; - + Fdo->InterfacesAcquired = TRUE; KeLowerIrql(Irql); + + + return STATUS_SUCCESS; @@ -784,10 +785,9 @@ FdoD0ToD3( KIRQL Irql; ASSERT3U(KeGetCurrentIrql(), ==, PASSIVE_LEVEL); - - KeRaiseIrql(DISPATCH_LEVEL, &Irql); Fdo->InterfacesAcquired = FALSE; - SessionsSuspendAll(Fdo); + KeRaiseIrql(DISPATCH_LEVEL, &Irql); + SUSPEND(Deregister, Fdo->SuspendInterface, Fdo->SuspendCallbackLate); @@ -1292,6 +1292,7 @@ __FdoSetDevicePowerUp( ASSERT3U(DeviceState, ==, PowerDeviceD0); status = FdoD3ToD0(Fdo); + SessionsResumeAll(Fdo); ASSERT(NT_SUCCESS(status)); done: @@ -1323,8 +1324,10 @@ __FdoSetDevicePowerDown( ASSERT3U(DeviceState, ==, PowerDeviceD3); - if (__FdoGetDevicePowerState(Fdo) == PowerDeviceD0) + if (__FdoGetDevicePowerState(Fdo) == PowerDeviceD0){ + SessionsSuspendAll(Fdo); FdoD0ToD3(Fdo); + } IoSkipCurrentIrpStackLocation(Irp); status = IoCallDriver(Fdo->LowerDeviceObject, Irp);