]> git.proxmox.com Git - mirror_edk2.git/commit - MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c
MdeModulePkg/UsbMass: Retry CMD for MediaChanged sense key
authorRuiyu Ni <ruiyu.ni@intel.com>
Fri, 2 Mar 2018 09:35:41 +0000 (17:35 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Sat, 3 Mar 2018 07:49:24 +0000 (15:49 +0800)
commit06e24096670ba13eaff39496498a5d9e41a37034
tree892589c72d15e8563502482e21d92bbb0eb6c335
parentcd626ef0fbc93d22c01245d3cdc55ddcfb85d7cd
MdeModulePkg/UsbMass: Retry CMD for MediaChanged sense key

When a USB device reports failure for a CMD and REQUEST SENSE returns
Media Changed key, UsbBootExecCmdWithRetry() stops to retry CMD and
returns EFI_MEDIA_CHANGED to caller.

For this case, the CMD should be retried until success, getting
NoMedia sense key or timeout.
The patch updates UsbBootExecCmdWithRetry() to follow the above
rule so EFI_MEDIA_CHANGED is no longer returned.

UsbBootDetectMedia() is updated accordingly.

Because UsbBootGetParams() is called for new plugged USB storage,
and some USB storage devices may report Media Changed key,
UsbBootGetParams() is updated to treat it as a Success.
This change could fix the issue that some USB storage devices
cannot be detected.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassImpl.c