]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/SdMmcPciHc: Reset the slot when sd device is connected
authorFeng Tian <feng.tian@intel.com>
Tue, 12 Apr 2016 05:57:48 +0000 (13:57 +0800)
committerFeng Tian <feng.tian@intel.com>
Thu, 21 Apr 2016 08:07:45 +0000 (16:07 +0800)
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>
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c

index 59649e1cad4d4864d625bc43df2de01bd2309c5a..31def727ebd1dee560eae33256ee423f9a31faa5 100644 (file)
@@ -275,6 +275,13 @@ SdMmcPciHcEnumerateDevice (
       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