]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg ScsiDiskDxe: Fix hang issue when reconnecting an ISCSI device
authorHao Wu <hao.a.wu@intel.com>
Mon, 7 Mar 2016 05:59:18 +0000 (13:59 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 29 Mar 2016 05:35:22 +0000 (13:35 +0800)
The 'Reset' function for BlockIO(2) in ScsiDiskDxe should return
EFI_SUCCESS instead of EFI_DEVICE_ERROR when a device does not support
reset feature.

Otherwise, a 'reconnect -r' action when an ISCSI device is attached will
cause system hang.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c

index 1cacbb9b4a226f689e3769fc20e7b2abeff1f4e0..dfa5fa32e6353a35ac92e7356d0b59e5532295f1 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   SCSI disk driver that layers on every SCSI IO protocol in the system.\r
 \r
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -466,8 +466,12 @@ ScsiDiskReset (
   Status          = ScsiDiskDevice->ScsiIo->ResetDevice (ScsiDiskDevice->ScsiIo);\r
 \r
   if (EFI_ERROR (Status)) {\r
-    Status = EFI_DEVICE_ERROR;\r
-    goto Done;\r
+    if (Status == EFI_UNSUPPORTED) {\r
+      Status = EFI_SUCCESS;\r
+    } else {\r
+      Status = EFI_DEVICE_ERROR;\r
+      goto Done;\r
+    }\r
   }\r
 \r
   if (!ExtendedVerification) {\r
@@ -790,8 +794,12 @@ ScsiDiskResetEx (
   Status          = ScsiDiskDevice->ScsiIo->ResetDevice (ScsiDiskDevice->ScsiIo);\r
 \r
   if (EFI_ERROR (Status)) {\r
-    Status = EFI_DEVICE_ERROR;\r
-    goto Done;\r
+    if (Status == EFI_UNSUPPORTED) {\r
+      Status = EFI_SUCCESS;\r
+    } else {\r
+      Status = EFI_DEVICE_ERROR;\r
+      goto Done;\r
+    }\r
   }\r
 \r
   if (!ExtendedVerification) {\r