From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=jiewen.yao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A9ACF20359A90 for ; Wed, 22 Nov 2017 00:19:58 -0800 (PST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Nov 2017 00:24:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,436,1505804400"; d="scan'208";a="4568205" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by FMSMGA003.fm.intel.com with ESMTP; 22 Nov 2017 00:24:14 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 22 Nov 2017 00:24:13 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.175]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.213]) with mapi id 14.03.0319.002; Wed, 22 Nov 2017 16:24:11 +0800 From: "Yao, Jiewen" To: "Yao, Jiewen" , "Ni, Ruiyu" , "edk2-devel@lists.01.org" CC: "Kinney, Michael D" , Michael Turner Thread-Topic: [PATCH 1/2] MdeModulePkg/PciBus: Revert "disable all BME when entering RT" Thread-Index: AQHTYax5UKutqc+8jUeJjDiEL1mNM6MgEJ2wgAAAa3A= Date: Wed, 22 Nov 2017 08:24:11 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503AA2804E@shsmsx102.ccr.corp.intel.com> References: <20171120030532.7548-1-ruiyu.ni@intel.com> <20171120030532.7548-2-ruiyu.ni@intel.com> <74D8A39837DF1E4DA445A8C0B3885C503AA28006@shsmsx102.ccr.corp.intel.com> In-Reply-To: <74D8A39837DF1E4DA445A8C0B3885C503AA28006@shsmsx102.ccr.corp.intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzFmNjY2MWEtNjJkNi00ZjliLWE5YzgtNWIzMDdmNTlhOWYyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX1BVQkxJQyJ9XX1dfSwiU3ViamVjdExhYmVscyI6W10sIlRNQ1ZlcnNpb24iOiIxNy4yLjUuMTgiLCJUcnVzdGVkTGFiZWxIYXNoIjoiaWtSdTU1MHpzRlgyckQ3Z1wvRldoSkt0ZTA0TmhrYTc4YkJzWlB4dUdraUxcL2xna0R4NUoxZFAydGhoR3p2WGtlIn0= x-ctpclassification: CTP_PUBLIC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 1/2] MdeModulePkg/PciBus: Revert "disable all BME when entering RT" X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 08:19:58 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable BTW: I notice that we have exit boot service callback in ATA bus driver, wh= ich may also clear some command register. I think we need validate that too. Thank you Yao Jiewen > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ya= o, > Jiewen > Sent: Wednesday, November 22, 2017 4:15 PM > To: Ni, Ruiyu ; edk2-devel@lists.01.org > Cc: Kinney, Michael D ; Michael Turner > > Subject: Re: [edk2] [PATCH 1/2] MdeModulePkg/PciBus: Revert "disable all = BME > when entering RT" >=20 > Reviewed-by: Jiewen.yao@intel.com >=20 > > -----Original Message----- > > From: Ni, Ruiyu > > Sent: Monday, November 20, 2017 11:06 AM > > To: edk2-devel@lists.01.org > > Cc: Ni, Ruiyu ; Michael Turner > > ; Kinney, Michael D > > ; Yao, Jiewen > > Subject: [PATCH 1/2] MdeModulePkg/PciBus: Revert "disable all BME when > > entering RT" > > > > This reverts commit 050763db0730a0bb46235cec87e3716632dc532c. > > "MdeModulePkg/PciBus: Disable BME of all devices when entering RT" > > > > 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 > > Signed-off-by: Michael Turner > > Cc: Michael D Kinney > > Cc: Jiewen Yao > > --- > > MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h | 2 - > > MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf | 3 - > > MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c | 86 > ----------------------- > > 3 files changed, 91 deletions(-) > > > > diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h > > b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h > > index 79b5b71082..55eb3a5a80 100644 > > --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h > > +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h > > @@ -18,8 +18,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY > KIND, > > EITHER EXPRESS OR IMPLIED. > > > > #include > > > > -#include > > - > > #include > > #include > > #include > > diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf > > b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf > > index d5b8fab3ca..97608bfcf2 100644 > > --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf > > +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf > > @@ -80,9 +80,6 @@ [LibraryClasses] > > DebugLib > > PeCoffLib > > > > -[Guids] > > - gEfiEventExitBootServicesGuid ## > > SOMETIMES_CONSUMES ## Event > > - > > [Protocols] > > gEfiPciHotPlugRequestProtocolGuid ## > > SOMETIMES_PRODUCES > > gEfiPciIoProtocolGuid ## BY_START > > diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c > > b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c > > index 004f2a3b5b..97bb971a59 100644 > > --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c > > +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c > > @@ -20,72 +20,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY > > KIND, EITHER EXPRESS OR IMPLIED. > > // > > LIST_ENTRY mPciDevicePool; > > > > -/** > > - Disable Bus Master Enable bit in all devices in the list. > > - > > - @param Devices A device list. > > -**/ > > -VOID > > -DisableBmeOnTree ( > > - IN LIST_ENTRY *Devices > > - ) > > -{ > > - LIST_ENTRY *Link; > > - PCI_IO_DEVICE *PciIoDevice; > > - UINT16 Command; > > - > > - for ( Link =3D GetFirstNode (Devices) > > - ; !IsNull (Devices, Link) > > - ; Link =3D GetNextNode (Devices, Link) > > - ) { > > - PciIoDevice =3D PCI_IO_DEVICE_FROM_LINK (Link); > > - // > > - // Turn off all children's Bus Master, if any > > - // > > - DisableBmeOnTree (&PciIoDevice->ChildList); > > - > > - // > > - // If this is a device that supports BME, disable BME on this devi= ce. > > - // > > - if ((PciIoDevice->Supports & EFI_PCI_IO_ATTRIBUTE_BUS_MASTER) !=3D= 0) > { > > - PCI_READ_COMMAND_REGISTER(PciIoDevice, &Command); > > - if ((Command & EFI_PCI_COMMAND_BUS_MASTER) !=3D 0) { > > - Command &=3D ~EFI_PCI_COMMAND_BUS_MASTER; > > - PCI_SET_COMMAND_REGISTER (PciIoDevice, Command); > > - DEBUG (( > > - DEBUG_INFO," %02x %02x %02x %04x\n", > > - PciIoDevice->BusNumber, PciIoDevice->DeviceNumber, > > PciIoDevice->FunctionNumber, > > - Command > > - )); > > - } > > - } > > - } > > -} > > - > > -/** > > - Exit Boot Services Event notification handler. > > - > > - Disable Bus Master on any that were enabled during BDS. > > - > > - @param[in] Event Event whose notification function is being > invoked. > > - @param[in] Context Pointer to the notification function's context= . > > - > > -**/ > > -VOID > > -EFIAPI > > -OnExitBootServices ( > > - IN EFI_EVENT Event, > > - IN VOID *Context > > - ) > > -{ > > - DEBUG (( > > - DEBUG_INFO, > > - "PciBus: Disable Bus Master of all devices...\n" > > - " Bus# Device# Function# NewCommand\n" > > - )); > > - DisableBmeOnTree(&mPciDevicePool); > > -} > > - > > /** > > Initialize the PCI devices pool. > > > > @@ -95,27 +29,7 @@ InitializePciDevicePool ( > > VOID > > ) > > { > > - EFI_EVENT ExitBootServicesEvent; > > - EFI_STATUS Status; > > - > > InitializeListHead (&mPciDevicePool); > > - > > - // > > - // DisableBME on ExitBootServices should be synchonized with any IOM= MU > > ExitBootServices routine. > > - // DisableBME should be run before the IOMMU protections are disable= d. > > - // One way to do this is to ensure that the IOMMU ExitBootServices c= allback > > runs at TPL_CALLBACK. > > - // > > - Status =3D gBS->CreateEventEx ( > > - EVT_NOTIFY_SIGNAL, > > - TPL_NOTIFY, > > - OnExitBootServices, > > - NULL, > > - &gEfiEventExitBootServicesGuid, > > - &ExitBootServicesEvent > > - ); > > - if (EFI_ERROR (Status)) { > > - DEBUG ((DEBUG_ERROR, "PciBus: Unable to hook ExitBootServices even= t > > - %r\n", Status)); > > - } > > } > > > > /** > > -- > > 2.15.0.gvfs.1.preview.4 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel