>From 8fe0df57fc8c03d732a7c91a482c93e07a40bb81 Mon Sep 17 00:00:00 2001 From: Vadim Rozenfeld <vrozenfe@xxxxxxxxxx> Date: Mon, 2 May 2011 15:47:45 +0300 Subject: [COMMIT] [viostor] initialize dpc only once --- viostor/virtio_stor.c | 22 ++++++++-------------- viostor/virtio_stor.h | 1 + 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/viostor/virtio_stor.c b/viostor/virtio_stor.c index be5bd05..14bbfb2 100644 --- a/viostor/virtio_stor.c +++ b/viostor/virtio_stor.c @@ -428,7 +428,7 @@ VirtIoPassiveInitializeRoutine ( StorPortInitializeDpc(DeviceExtension, &adaptExt->completion_dpc, CompleteDpcRoutine); - + adaptExt->dpc_ok = TRUE; return TRUE; } #endif @@ -566,7 +566,7 @@ VirtIoHwInitialize( ScsiPortMoveMemory(&adaptExt->inquiry_data.VendorSpecific, "0001", sizeof("0001")); #ifdef USE_STORPORT - if(!adaptExt->dump_mode) + if(!adaptExt->dump_mode && !adaptExt->dpc_ok) { return StorPortEnablePassiveInitialization(DeviceExtension, VirtIoPassiveInitializeRoutine); } @@ -822,21 +822,15 @@ VirtIoAdapterControl( case ScsiRestartAdapter: { RhelDbgPrint(TRACE_LEVEL_VERBOSE, ("ScsiRestartAdapter\n")); VirtIODeviceReset(DeviceExtension); + ScsiPortWritePortUshort((PUSHORT)(adaptExt->device_base + VIRTIO_PCI_QUEUE_SEL), (USHORT)0); + ScsiPortWritePortUshort((PUSHORT)(adaptExt->device_base + VIRTIO_PCI_QUEUE_PFN),(USHORT)0); adaptExt->pci_vq_info.vq = NULL; -#ifdef MSI_SUPPORTED - if(!adaptExt->dump_mode && adaptExt->msix_vectors) { - adaptExt->pci_vq_info.vq = VirtIODeviceFindVirtualQueue(DeviceExtension, 0, adaptExt->msix_vectors); - } -#endif - if(!adaptExt->pci_vq_info.vq) { - adaptExt->pci_vq_info.vq = VirtIODeviceFindVirtualQueue(DeviceExtension, 0, 0); - } - if (!adaptExt->pci_vq_info.vq) + + if (!VirtIoHwInitialize(DeviceExtension)) { - RhelDbgPrint(TRACE_LEVEL_FATAL, ("Cannot find snd virtual queue\n")); + RhelDbgPrint(TRACE_LEVEL_FATAL, ("Cannot Initialize HW\n")); break; } - VirtIoHwInitialize(DeviceExtension); status = ScsiAdapterControlSuccess; break; } @@ -1198,7 +1192,7 @@ CompleteDPC( RemoveEntryList(&vbr->list_entry); #ifdef USE_STORPORT - if(!adaptExt->dump_mode) { + if(!adaptExt->dump_mode && adaptExt->dpc_ok) { InsertTailList(&adaptExt->complete_list, &vbr->list_entry); StorPortIssueDpc(DeviceExtension, &adaptExt->completion_dpc, diff --git a/viostor/virtio_stor.h b/viostor/virtio_stor.h index dc0c07a..286769d 100644 --- a/viostor/virtio_stor.h +++ b/viostor/virtio_stor.h @@ -120,6 +120,7 @@ typedef struct _ADAPTER_EXTENSION { #ifdef USE_STORPORT LIST_ENTRY complete_list; STOR_DPC completion_dpc; + BOOLEAN dpc_ok; #if (INDIRECT_SUPPORTED) BOOLEAN indirect; #endif -- 1.7.0.2.msysgit.0 -- To unsubscribe from this list: send the line "unsubscribe kvm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html