The original code doesn't reset the slot when there is device change.
It may bring issue on device identification procedure of some SD cards.
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@Intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
if ((Status == EFI_MEDIA_CHANGED) && (MediaPresent == TRUE)) {\r
DEBUG ((EFI_D_INFO, "SdMmcPciHcEnumerateDevice: device connected at slot %d of pci %p\n", Slot, Private->PciIo));\r
//\r
+ // Reset the specified slot of the SD/MMC Pci Host Controller\r
+ //\r
+ Status = SdMmcHcReset (Private->PciIo, Slot);\r
+ if (EFI_ERROR (Status)) {\r
+ continue;\r
+ }\r
+ //\r
// Reinitialize slot and restart identification process for the new attached device\r
//\r
Status = SdMmcHcInitHost (Private->PciIo, Slot, Private->Capability[Slot]);\r