summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe
diff options
context:
space:
mode:
authorFeng Tian <feng.tian@intel.com>2016-04-12 13:57:48 +0800
committerFeng Tian <feng.tian@intel.com>2016-04-21 16:07:45 +0800
commit83ceccabd3c2adc517ed27f59282737efe4e8bd0 (patch)
tree0119bf369256b03416785fa7f0684e1f5fb12746 /MdeModulePkg/Bus/Pci/SdMmcPciHcDxe
parentac30e4c15dc51b4f22d56dcc7f3ce098b69ba399 (diff)
downloadedk2-83ceccabd3c2adc517ed27f59282737efe4e8bd0.zip
edk2-83ceccabd3c2adc517ed27f59282737efe4e8bd0.tar.gz
edk2-83ceccabd3c2adc517ed27f59282737efe4e8bd0.tar.bz2
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 <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>
Diffstat (limited to 'MdeModulePkg/Bus/Pci/SdMmcPciHcDxe')
-rw-r--r--MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c
index 59649e1..31def72 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]);