Reviewed-by: Feng Tian <[email protected]>

Thanks
Feng

-----Original Message-----
From: Wu, Hao A 
Sent: Thursday, March 17, 2016 10:46 AM
To: [email protected]; Ni, Ruiyu <[email protected]>; Tian, Feng 
<[email protected]>
Cc: Wu, Hao A <[email protected]>
Subject: [PATCH] MdeModulePkg DiskIoDxe: Media status check not be done at 
DiskIo level

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 <[email protected]>
---
 MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c 
b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
index 97f2d50..2b2e576 100644
--- a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
+++ b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
@@ -833,18 +833,6 @@ DiskIo2ReadWriteDisk (
   Status    = EFI_SUCCESS;
   Blocking  = (BOOLEAN) ((Token == NULL) || (Token->Event == NULL));
 
-  if (!(Media->MediaPresent)) {
-    return EFI_NO_MEDIA;
-  }
-
-  if (Media->MediaId != MediaId) {
-    return EFI_MEDIA_CHANGED;
-  }
-
-  if (Write && Media->ReadOnly) {
-    return EFI_WRITE_PROTECTED;
-  }
-
   if (Blocking) {
     //
     // Wait till pending async task is completed.
--
1.9.5.msysgit.0

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to