win-pvdrivers

changeset 868:9096c1757947

Handle gref and concurrent IO without forgetting to notify Dom0. Dump active SRB's on scsi reset.
author James Harper <james.harper@bendigoit.com.au>
date Tue Mar 01 23:10:24 2011 +1100 (2011-03-01)
parents fc034d9ccf1b
children 34e72b071e51
files xenvbd/xenvbd_scsiport.c
line diff
     1.1 --- a/xenvbd/xenvbd_scsiport.c	Tue Mar 01 10:42:00 2011 +1100
     1.2 +++ b/xenvbd/xenvbd_scsiport.c	Tue Mar 01 23:10:24 2011 +1100
     1.3 @@ -421,7 +421,7 @@ XenVbd_PutQueuedSrbsOnRing(PXENVBD_DEVIC
     1.4          sector_number, block_count, sector_number2, block_count2));
     1.5        /* put the srb back at the start of the queue */
     1.6        InsertHeadList(&xvdd->srb_list, (PLIST_ENTRY)srb->SrbExtension);
     1.7 -      return; /* stall the queue */
     1.8 +      break; /* stall the queue but fall through so the notify is triggered */
     1.9      }
    1.10  
    1.11      remaining = block_count * 512;
    1.12 @@ -499,11 +499,11 @@ XenVbd_PutQueuedSrbsOnRing(PXENVBD_DEVIC
    1.13            shadow->aligned_buffer_in_use = FALSE;
    1.14            xvdd->aligned_buffer_in_use = FALSE;
    1.15          }
    1.16 -        /* put the srb back at the start of the queue */
    1.17 +        /* put the srb back at the start of the queue, then fall through so that the notify is triggered*/
    1.18          InsertHeadList(&xvdd->srb_list, (PLIST_ENTRY)srb->SrbExtension);
    1.19          put_shadow_on_freelist(xvdd, shadow);
    1.20          KdPrint((__DRIVER_NAME "     Out of gref's. Deferring\n"));
    1.21 -        return;
    1.22 +        break;
    1.23        }
    1.24        offset = physical_address.LowPart & (PAGE_SIZE - 1);
    1.25        length = min(PAGE_SIZE - offset, remaining);
    1.26 @@ -1504,6 +1504,7 @@ static BOOLEAN
    1.27  XenVbd_HwScsiResetBus(PVOID DeviceExtension, ULONG PathId)
    1.28  {
    1.29    PXENVBD_DEVICE_DATA xvdd = DeviceExtension;
    1.30 +  int i;
    1.31  
    1.32    UNREFERENCED_PARAMETER(DeviceExtension);
    1.33    UNREFERENCED_PARAMETER(PathId);
    1.34 @@ -1511,6 +1512,15 @@ XenVbd_HwScsiResetBus(PVOID DeviceExtens
    1.35    FUNCTION_ENTER();
    1.36  
    1.37    KdPrint((__DRIVER_NAME "     IRQL = %d\n", KeGetCurrentIrql()));
    1.38 +  
    1.39 +  for (i = 0; i < MAX_SHADOW_ENTRIES; i++)
    1.40 +  {
    1.41 +    if (xvdd->shadows[i].srb)
    1.42 +    {
    1.43 +      KdPrint((__DRIVER_NAME "     shadow entry %d in use with srb %p\n", i, xvdd->shadows[i].srb));
    1.44 +    }
    1.45 +  }
    1.46 +  
    1.47    if (xvdd->ring_detect_state == RING_DETECT_STATE_COMPLETE && xvdd->device_state->suspend_resume_state_pdo == SR_STATE_RUNNING)
    1.48    {
    1.49      ScsiPortNotification(NextRequest, DeviceExtension);