[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Asynchronous power handling.
- To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
- From: Paul Durrant <xadimgnik@xxxxxxxxx>
- Date: Thu, 14 Mar 2024 09:45:09 +0000
- Delivery-date: Thu, 14 Mar 2024 09:45:20 +0000
- List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>
On 12/03/2024 07:23, Owen Smith wrote:
From: Martin Harvey <Martin.Harvey@xxxxxxxxxx>
XenDisk requires minimal IRP_MN_SET_POWER/IRP_MN_QUERY_POWER interactions.
No IoWorkItems are required as operations perform no significant work.
Power handlers are is limited to tracking state changes and calling
PoSetPowerState.
Signed-off-by: Martin Harvey <martin.harvey@xxxxxxxxxx>
Refactored
Signed-off-by: Owen Smith <owen.smith@xxxxxxxxx>
---
src/xendisk/fdo.c | 552 +++++++++------------------------------------
src/xendisk/pdo.c | 555 +++++++++-------------------------------------
2 files changed, 209 insertions(+), 898 deletions(-)
diff --git a/src/xendisk/fdo.c b/src/xendisk/fdo.c
index 056e24a..2e5c0de 100644
--- a/src/xendisk/fdo.c
+++ b/src/xendisk/fdo.c
[snip]
@@ -1216,13 +1219,12 @@ __FdoSetDevicePower(
PowerActionName(PowerAction));
if (DeviceState == __FdoGetDevicePowerState(Fdo)) {
- status = FdoForwardIrpSynchronously(Fdo, Irp);
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
-
+ IoSkipCurrentIrpStackLocation(Irp);
+ status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
goto done;
}
- status = (DeviceState < __FdoGetDevicePowerState(Fdo)) ?
This appears to be an unnecessary change.
+ status = DeviceState < __FdoGetDevicePowerState(Fdo) ?
__FdoSetDevicePowerUp(Fdo, Irp) :
__FdoSetDevicePowerDown(Fdo, Irp);
[snip]
@@ -1314,13 +1318,12 @@ __FdoSetSystemPower(
PowerActionName(PowerAction));
if (SystemState == __FdoGetSystemPowerState(Fdo)) {
- status = FdoForwardIrpSynchronously(Fdo, Irp);
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
-
+ IoSkipCurrentIrpStackLocation(Irp);
+ status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
goto done;
}
- status = (SystemState < __FdoGetSystemPowerState(Fdo)) ?
Same here.
I can drop them on commit.
Reviewed-by: Paul Durrant <paul@xxxxxxx>
+ status = SystemState < __FdoGetSystemPowerState(Fdo) ?
__FdoSetSystemPowerUp(Fdo, Irp) :
__FdoSetSystemPowerDown(Fdo, Irp);
|