From 83ceccabd3c2adc517ed27f59282737efe4e8bd0 Mon Sep 17 00:00:00 2001 From: Feng Tian Date: Tue, 12 Apr 2016 13:57:48 +0800 Subject: MdeModulePkg/SdMmcPciHc: Reset the slot when sd device is connected 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 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian Reviewed-by: Hao Wu --- MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'MdeModulePkg/Bus/Pci') diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c index 59649e1cad..31def727eb 100644 --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c @@ -275,6 +275,13 @@ SdMmcPciHcEnumerateDevice ( if ((Status == EFI_MEDIA_CHANGED) && (MediaPresent == TRUE)) { DEBUG ((EFI_D_INFO, "SdMmcPciHcEnumerateDevice: device connected at slot %d of pci %p\n", Slot, Private->PciIo)); // + // Reset the specified slot of the SD/MMC Pci Host Controller + // + Status = SdMmcHcReset (Private->PciIo, Slot); + if (EFI_ERROR (Status)) { + continue; + } + // // Reinitialize slot and restart identification process for the new attached device // Status = SdMmcHcInitHost (Private->PciIo, Slot, Private->Capability[Slot]); -- cgit v1.2.3