]> xenbits.xensource.com Git - pvdrivers/win/xenbus.git/commitdiff
Only call PdoSuspend() and PdoResume() when in the correct state
authorPaul Durrant <paul.durrant@citrix.com>
Wed, 4 Mar 2015 10:09:51 +0000 (10:09 +0000)
committerPaul Durrant <paul.durrant@citrix.com>
Wed, 4 Mar 2015 10:09:51 +0000 (10:09 +0000)
The FDO code calls PdoSuspend() and PdoResume() when a PDO is removed or
added (respectively) to the FDO list. However, if the FDO is not in state
D0, this is not the correct thing to do. Currently PdoSuspend() and
PdoResume() do nothing in XENBUS, but the equivalent functions in XENVIF
do and a call to PdoSuspend() when the FDO was in D3 was causing a BSOD.
Commit 5b895423957de23a82dc763dc378e305be16817a fixes this problem in
XENVIF. This patch brings XENBUS into line.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/xenbus/fdo.c
src/xenbus/pdo.c

index 17a74ab1b8ef43cb7d3f92b11cb0df6f604ca70f..1eb5fa888fdd5a7d63ba30098dbc1f37d675daab 100644 (file)
@@ -706,7 +706,8 @@ FdoAddPhysicalDeviceObject(
     ASSERT3U(Fdo->References, !=, 0);
     Fdo->References++;
 
-    PdoResume(Pdo);
+    if (__FdoGetDevicePowerState(Fdo) == PowerDeviceD0)
+        PdoResume(Pdo);
 }
 
 VOID
@@ -722,7 +723,8 @@ FdoRemovePhysicalDeviceObject(
     Dx = (PXENBUS_DX)DeviceObject->DeviceExtension;
     ASSERT3U(Dx->Type, ==, PHYSICAL_DEVICE_OBJECT);
 
-    PdoSuspend(Pdo);
+    if (__FdoGetDevicePowerState(Fdo) == PowerDeviceD0)
+        PdoSuspend(Pdo);
 
     RemoveEntryList(&Dx->ListEntry);
     ASSERT3U(Fdo->References, !=, 0);
index 621f377da70bb584258edbe999e1d2167276a60c..4c6017d208cd3c31be0c202636e349e987bc8cba 100644 (file)
@@ -2206,6 +2206,8 @@ PdoResume(
     )
 {
     UNREFERENCED_PARAMETER(Pdo);
+
+    Trace("<===>\n");
 }
 
 VOID
@@ -2214,6 +2216,8 @@ PdoSuspend(
     )
 {
     UNREFERENCED_PARAMETER(Pdo);
+
+    Trace("<===>\n");
 }
 
 NTSTATUS