audk/MdeModulePkg/Bus/Usb/UsbMassStorageDxe
Ruiyu Ni a662afb5b0 MdeModulePkg/UsbStorage: Fix "map -r" cannot detect media change
When system boots to Shell without CDROM in the USB CDROM drive,
and then user inserts one CDROM with Eltorito file system,
"map -r" cannot show the the new Eltorito file system.

The root cause is when "map" command probes the media change
by calling dummy ReadBlockIo(), UsbMassStorage ReadBlockIo()
contains a bug that ignores the media change status:
UsbBootDetectMedia() ignores the EFI_MEDIA_CHANGED status
returned from UsbBootIsUnitReady(), in consequence, the
BlockIo protocol re-installation logic doesn't run.

By checking the code change history, below commit
SHA-1: 19bc852765
* remove unnecessary retry logic from usb mass storage driver.
adds the code to skip EFI_MEDIA_CHANGED status.

Talking with the original committer Tian Feng, he said the
change was just a code cleanup, not for a special bug fix.
So I revert part of the patch, only keep the change that
removes unnecessary retry logic. It can fix this bug.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
2018-01-22 10:18:04 +08:00
..
ComponentName.c
UsbMass.h
UsbMassBoot.c MdeModulePkg/UsbStorage: Fix "map -r" cannot detect media change 2018-01-22 10:18:04 +08:00
UsbMassBoot.h MdeModulePkg/UsbMassStorageDxe: Fix USB Mass Storage detection 2017-11-14 16:40:50 -08:00
UsbMassBot.c MdeModulePkg/UsbMassStorageDxe: Check Get Max LUN status/value 2017-11-20 14:43:37 -08:00
UsbMassBot.h
UsbMassCbi.c
UsbMassCbi.h
UsbMassDiskInfo.c
UsbMassDiskInfo.h
UsbMassImpl.c
UsbMassImpl.h
UsbMassStorageDxe.inf
UsbMassStorageDxe.uni
UsbMassStorageDxeExtra.uni