diff options
author | Hao Wu <hao.a.wu@intel.com> | 2016-03-07 13:59:18 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2016-08-01 10:40:35 +0800 |
commit | bfb6baeed5e9d441ffa0c1bfdc7f9480d99db383 (patch) | |
tree | 1a40f1693f73fa9c861881b93c7fc9f483f35b1a | |
parent | ed7832883eac2e4fbfdb8a21ba388ebb97698eed (diff) | |
download | edk2-platforms-bfb6baeed5e9d441ffa0c1bfdc7f9480d99db383.tar.xz |
MdeModulePkg ScsiDiskDxe: Fix hang issue when reconnecting an ISCSI device
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>
(cherry picked from commit ef952129633bb961ca91e0848c6e119ef6b9216f)
-rw-r--r-- | MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c index 74f53c58b3..6cd9a18701 100644 --- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c +++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c @@ -1,7 +1,7 @@ /** @file
SCSI disk driver that layers on every SCSI IO protocol in the system.
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -466,8 +466,12 @@ ScsiDiskReset ( Status = ScsiDiskDevice->ScsiIo->ResetDevice (ScsiDiskDevice->ScsiIo);
if (EFI_ERROR (Status)) {
- Status = EFI_DEVICE_ERROR;
- goto Done;
+ if (Status == EFI_UNSUPPORTED) {
+ Status = EFI_SUCCESS;
+ } else {
+ Status = EFI_DEVICE_ERROR;
+ goto Done;
+ }
}
if (!ExtendedVerification) {
@@ -790,8 +794,12 @@ ScsiDiskResetEx ( Status = ScsiDiskDevice->ScsiIo->ResetDevice (ScsiDiskDevice->ScsiIo);
if (EFI_ERROR (Status)) {
- Status = EFI_DEVICE_ERROR;
- goto Done;
+ if (Status == EFI_UNSUPPORTED) {
+ Status = EFI_SUCCESS;
+ } else {
+ Status = EFI_DEVICE_ERROR;
+ goto Done;
+ }
}
if (!ExtendedVerification) {
|