win-pvdrivers
changeset 1061:df3ee58e8b4f
scsiport queue will freeze if something returns an error. Queue a timer to ensure it keeps moving.
author | James Harper <james.harper@bendigoit.com.au> |
---|---|
date | Tue Oct 01 18:46:50 2013 +1000 (2013-10-01) |
parents | b448f01b31e8 |
children | 5775fb8612ab |
files | xenvbd_scsiport/xenvbd.c |
line diff
1.1 --- a/xenvbd_scsiport/xenvbd.c Tue Oct 01 13:46:32 2013 +1000 1.2 +++ b/xenvbd_scsiport/xenvbd.c Tue Oct 01 18:46:50 2013 +1000 1.3 @@ -241,6 +241,20 @@ XenVbd_CompleteDisconnect(PXENVBD_DEVICE 1.4 } 1.5 } 1.6 1.7 +static VOID 1.8 +XenVbd_HwScsiTimer(PVOID DeviceExtension) { 1.9 + PXENVBD_SCSIPORT_DATA xvsd = DeviceExtension; 1.10 + PXENVBD_DEVICE_DATA xvdd = (PXENVBD_DEVICE_DATA)xvsd->xvdd; 1.11 + 1.12 + //FUNCTION_MSG("HwScsiTimer\n"); 1.13 + XenVbd_HandleEvent(xvdd); 1.14 + if (xvsd->outstanding) { 1.15 + ScsiPortNotification(RequestTimerCall, xvsd, XenVbd_HwScsiTimer, 100000); 1.16 + } else { 1.17 + ScsiPortNotification(RequestTimerCall, xvsd, XenVbd_HwScsiTimer, 0); 1.18 + } 1.19 +} 1.20 + 1.21 static BOOLEAN 1.22 XenVbd_HwScsiStartIo(PVOID DeviceExtension, PSCSI_REQUEST_BLOCK srb) { 1.23 PXENVBD_SCSIPORT_DATA xvsd = DeviceExtension; 1.24 @@ -297,6 +311,12 @@ XenVbd_HwScsiStartIo(PVOID DeviceExtensi 1.25 } else { 1.26 ScsiPortNotification(NextRequest, xvsd); 1.27 } 1.28 + /* if there was an error returned by an SRB then the queue will freeze. Queue a timer to resolve this */ 1.29 + if (xvsd->outstanding) { 1.30 + ScsiPortNotification(RequestTimerCall, xvsd, XenVbd_HwScsiTimer, 100000); 1.31 + } else { 1.32 + ScsiPortNotification(RequestTimerCall, xvsd, XenVbd_HwScsiTimer, 0); 1.33 + } 1.34 return TRUE; 1.35 } 1.36