]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/SdMmcPciHcDxe: Execute card detect only for RemovableSlot
authorMarcin Wojtas <mw@semihalf.com>
Tue, 18 Sep 2018 08:59:07 +0000 (16:59 +0800)
committerHao Wu <hao.a.wu@intel.com>
Fri, 21 Sep 2018 02:47:48 +0000 (10:47 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1182

Some devices can be non removable (such as eMMC) and checking
Present State Register on host controller may falsely return
an information that device is not present. Execute this
check conditionally on the SloType field value.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c

index f923930bbae9b9189f0f660ef92f9b65845e9d52..bf9869dbb5f055d53bb16e0bbe9ebb3227072dfa 100644 (file)
@@ -661,12 +661,18 @@ SdMmcPciHcDriverBindingStart (
     //\r
     // Check whether there is a SD/MMC card attached\r
     //\r
-    Status = SdMmcHcCardDetect (PciIo, Slot, &MediaPresent);\r
-    if (EFI_ERROR (Status) && (Status != EFI_MEDIA_CHANGED)) {\r
-      continue;\r
-    } else if (!MediaPresent) {\r
-      DEBUG ((DEBUG_INFO, "SdMmcHcCardDetect: No device attached in Slot[%d]!!!\n", Slot));\r
-      continue;\r
+    if (Private->Slot[Slot].SlotType == RemovableSlot) {\r
+      Status = SdMmcHcCardDetect (PciIo, Slot, &MediaPresent);\r
+      if (EFI_ERROR (Status) && (Status != EFI_MEDIA_CHANGED)) {\r
+        continue;\r
+      } else if (!MediaPresent) {\r
+        DEBUG ((\r
+          DEBUG_INFO,\r
+          "SdMmcHcCardDetect: No device attached in Slot[%d]!!!\n",\r
+          Slot\r
+          ));\r
+        continue;\r
+      }\r
     }\r
 \r
     Status = SdMmcHcInitHost (Private, Slot);\r