]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/PciBus: Revert "Enable BM on P2P bridges on demand"
authorRuiyu Ni <ruiyu.ni@intel.com>
Mon, 20 Nov 2017 03:03:41 +0000 (11:03 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Wed, 22 Nov 2017 10:00:48 +0000 (18:00 +0800)
This reverts commit 5db417ed2522367290c365831f9d6628d31c346c.
 "MdeModulePkg/PciBusDxe: Enable Bus Master on P2P bridges on demand"

We met some compatibility issues when doing Windows S4 resume.
Reverting the BME disabling patches to fix the S4 resume issue.

Signed-off-by: Ruiyu Ni <Ruiyu.ni@intel.com>
Signed-off-by: Michael Turner <michael.turner@microsoft.com>
Cc: Michael D Kinney <Michael.d.kinney@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
MdeModulePkg/Bus/Pci/PciBusDxe/PciIo.c

index 97bb971a5966a2d869d8da42b47cb4e5be386f27..e76c8f00468a87e9db7d6b014b3cffa257cd2a89 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Supporting functions implementaion for PCI devices management.\r
 \r
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -711,12 +711,7 @@ StartPciDevicesOnBridge (
                              0,\r
                              &Supports\r
                              );\r
-        //\r
-        // By default every bridge's IO and MMIO spaces are enabled.\r
-        // Bridge's Bus Master will be enabled when any device behind it requests\r
-        // to enable Bus Master.\r
-        //\r
-        Supports &= (UINT64) (EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY);\r
+        Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
         PciIoDevice->PciIo.Attributes (\r
                              &(PciIoDevice->PciIo),\r
                              EfiPciIoAttributeOperationEnable,\r
@@ -768,12 +763,7 @@ StartPciDevicesOnBridge (
                              0,\r
                              &Supports\r
                              );\r
-        //\r
-        // By default every bridge's IO and MMIO spaces are enabled.\r
-        // Bridge's Bus Master will be enabled when any device behind it requests\r
-        // to enable Bus Master.\r
-        //\r
-        Supports &= (UINT64) (EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY);\r
+        Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
         PciIoDevice->PciIo.Attributes (\r
                              &(PciIoDevice->PciIo),\r
                              EfiPciIoAttributeOperationEnable,\r
index f73756a31ecd9dcf40b1011bc85d2083d814ca06..81171c82d9e21500ceaf25464d78d196904b02b2 100644 (file)
@@ -1218,12 +1218,11 @@ DetermineDeviceAttribute (
       return Status;\r
     }\r
     //\r
-    // Assume the PCI Root Bridge supports DAC and Bus Master.\r
+    // Assume the PCI Root Bridge supports DAC\r
     //\r
     PciIoDevice->Supports |= (UINT64)(EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE |\r
                               EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM |\r
-                              EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE |\r
-                              EFI_PCI_IO_ATTRIBUTE_BUS_MASTER);\r
+                              EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE);\r
 \r
   } else {\r
 \r
@@ -1234,16 +1233,9 @@ DetermineDeviceAttribute (
     //\r
     Command = EFI_PCI_COMMAND_IO_SPACE     |\r
               EFI_PCI_COMMAND_MEMORY_SPACE |\r
+              EFI_PCI_COMMAND_BUS_MASTER   |\r
               EFI_PCI_COMMAND_VGA_PALETTE_SNOOP;\r
 \r
-    //\r
-    // Per PCI-to-PCI Bridge Architecture all PCI-to-PCI bridges are Bus Master capable.\r
-    // So only test the Bus Master capability for PCI devices.\r
-    //\r
-    if (!IS_PCI_BRIDGE(&PciIoDevice->Pci)) {\r
-      Command |= EFI_PCI_COMMAND_BUS_MASTER;\r
-    }\r
-\r
     BridgeControl = EFI_PCI_BRIDGE_CONTROL_ISA | EFI_PCI_BRIDGE_CONTROL_VGA | EFI_PCI_BRIDGE_CONTROL_VGA_16;\r
 \r
     //\r
@@ -1253,11 +1245,7 @@ DetermineDeviceAttribute (
 \r
     //\r
     // Set the supported attributes for specified PCI device\r
-    // Per PCI-to-PCI Bridge Architecture all PCI-to-PCI bridges are Bus Master capable.\r
     //\r
-    if (IS_PCI_BRIDGE(&PciIoDevice->Pci)) {\r
-      Command |= EFI_PCI_COMMAND_BUS_MASTER;\r
-    }\r
     PciSetDeviceAttribute (PciIoDevice, Command, BridgeControl, EFI_SET_SUPPORTS);\r
 \r
     //\r
index 659f480d712234871485664f6de596412aa0887d..cc7125e4fc3c00f924fc7ea11d482f785219cd14 100644 (file)
@@ -1348,8 +1348,7 @@ ModifyRootBridgeAttributes (
   //\r
   Attributes &= ~(UINT64)(EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE |\r
                           EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM |\r
-                          EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE |\r
-                          EFI_PCI_IO_ATTRIBUTE_BUS_MASTER);\r
+                          EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE);\r
 \r
   //\r
   // Record the new attribute of the Root Bridge\r
@@ -1727,11 +1726,12 @@ PciIoAttributes (
   }\r
   //\r
   // The upstream bridge should be also set to revelant attribute\r
-  // expect for IO and Mem\r
+  // expect for IO, Mem and BusMaster\r
   //\r
   UpStreamAttributes = Attributes &\r
                        (~(EFI_PCI_IO_ATTRIBUTE_IO     |\r
-                          EFI_PCI_IO_ATTRIBUTE_MEMORY\r
+                          EFI_PCI_IO_ATTRIBUTE_MEMORY |\r
+                          EFI_PCI_IO_ATTRIBUTE_BUS_MASTER\r
                           )\r
                         );\r
   UpStreamBridge = PciIoDevice->Parent;\r