]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg DiskIoDxe: Media status check not be done at DiskIo level
authorHao Wu <hao.a.wu@intel.com>
Thu, 17 Mar 2016 02:03:44 +0000 (10:03 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 29 Mar 2016 05:39:13 +0000 (13:39 +0800)
Found an issue that file system cannot be started on a DVD when doing the
following process:

Boot to shell with a DVD inside a SATA DVDROM. Eject the DVD and run
"reconnect -r". Put the DVD inside again and run "reconnect -r".

The cause is that after executing the second reconnect action, DiskIo
immediately returns EFI_NO_MEDIA in function DiskIo2ReadWriteDisk() when
checking the media information. However, at this time, the media
information does not get updated by the ScsiDisk driver. Therefore, DiskIo
driver should left the no media check to ScsiDisk driver.

Generally, the media changed and media write protect check should also be
left to lower-level device driver. Thus, these two checks in function
DiskIo2ReadWriteDisk() are also removed.

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/Universal/Disk/DiskIoDxe/DiskIo.c

index 97f2d508a2775dca4be3b592c1bac7cdda186b65..b8bde2a25e16086a210e418ccb984b26dff80f63 100644 (file)
@@ -9,7 +9,7 @@
     Aligned  - A read of N contiguous sectors.\r
     OverRun  - The last byte is not on a sector boundary.\r
 \r
-Copyright (c) 2006 - 2014, 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
@@ -833,18 +833,6 @@ DiskIo2ReadWriteDisk (
   Status    = EFI_SUCCESS;\r
   Blocking  = (BOOLEAN) ((Token == NULL) || (Token->Event == NULL));\r
 \r
-  if (!(Media->MediaPresent)) {\r
-    return EFI_NO_MEDIA;\r
-  }\r
-\r
-  if (Media->MediaId != MediaId) {\r
-    return EFI_MEDIA_CHANGED;\r
-  }\r
-  \r
-  if (Write && Media->ReadOnly) {\r
-    return EFI_WRITE_PROTECTED;\r
-  }\r
-\r
   if (Blocking) {\r
     //\r
     // Wait till pending async task is completed.\r