From nobody Sat May 4 18:33:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1511745636932400.8154870645948; Sun, 26 Nov 2017 17:20:36 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3C6BD21B00DC1; Sun, 26 Nov 2017 17:16:13 -0800 (PST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 B199021A10989 for ; Sun, 26 Nov 2017 17:16:11 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Nov 2017 17:20:33 -0800 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.15]) by orsmga002.jf.intel.com with ESMTP; 26 Nov 2017 17:20:32 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,462,1505804400"; d="scan'208";a="12249143" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Mon, 27 Nov 2017 09:19:47 +0800 Message-Id: <20171127011948.279312-2-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.15.0.gvfs.1.preview.4 In-Reply-To: <20171127011948.279312-1-ruiyu.ni@intel.com> References: <20171127011948.279312-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH 1/2] MdeModulePkg/AtaAtapiPassThru: Revert patch to disable Bus Master 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: , Cc: Jiewen Yao , Laszlo Ersek , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch caused Windows 10 S4 resume failure. Considering the similar changes are reverted from PciBus driver, revert the patch from AtaAtapiPassThru as well. Revert "MdeModulePkg/AtaAtapiPassThru: disable only BM-DMA at ExitBootServices()" This reverts commit 76fd5a660d704538a1b14a58d03a4eef9682b01c. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Laszlo Ersek Cc: Jiewen Yao Cc: Star Zeng Reviewed-by: Laszlo Ersek Reviewed-by: Star Zeng --- MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c | 5 +++-- MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c b/Mde= ModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c index e10e0d4e65..09064dda18 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c @@ -480,7 +480,8 @@ InitializeAtaAtapiPassThru ( } =20 /** - Disable Bus Master DMA on the device when exiting the boot services. + Disable the device (especially Bus Master DMA) when exiting the boot + services. =20 @param[in] Event Event for which this notification function is being called. @@ -505,7 +506,7 @@ AtaPassThruExitBootServices ( PciIo->Attributes ( PciIo, EfiPciIoAttributeOperationDisable, - Instance->EnabledPciAttributes & EFI_PCI_IO_ATTRIBUTE_BUS_MASTE= R, + Instance->EnabledPciAttributes, NULL ); } diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h b/Mde= ModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h index 92c5bf2001..8d6eac706c 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h @@ -123,7 +123,8 @@ typedef struct { LIST_ENTRY NonBlockingTaskList; =20 // - // For disabling Bus Master DMA on the device at ExitBootServices(). + // For disabling the device (especially Bus Master DMA) at + // ExitBootServices(). // EFI_EVENT ExitBootEvent; } ATA_ATAPI_PASS_THRU_INSTANCE; --=20 2.15.0.gvfs.1.preview.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 18:33:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1511745639086606.0065078751213; Sun, 26 Nov 2017 17:20:39 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7A6B7220C1603; Sun, 26 Nov 2017 17:16:15 -0800 (PST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 34B2F21A1099E for ; Sun, 26 Nov 2017 17:16:13 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Nov 2017 17:20:34 -0800 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.15]) by orsmga002.jf.intel.com with ESMTP; 26 Nov 2017 17:20:33 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,462,1505804400"; d="scan'208";a="12249146" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Mon, 27 Nov 2017 09:19:48 +0800 Message-Id: <20171127011948.279312-3-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.15.0.gvfs.1.preview.4 In-Reply-To: <20171127011948.279312-1-ruiyu.ni@intel.com> References: <20171127011948.279312-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH 2/2] MdeModulePkg/AtaAtapiPassThru: Revert patch to disable PCI attributes 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: , Cc: Jiewen Yao , Laszlo Ersek , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch caused Windows 10 S4 resume failure. Considering the similar changes are reverted from PciBus driver, revert the patch from AtaAtapiPassThru as well. Revert "MdeModulePkg/AtaAtapiPassThru: disable the device at ExitBootServices()" This reverts commit 6fb8ddd36bde45614b0a069528cdc97077835a74. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Laszlo Ersek Cc: Jiewen Yao Cc: Star Zeng Reviewed-by: Laszlo Ersek Reviewed-by: Star Zeng --- .../Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c | 59 +-----------------= ---- .../Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h | 6 --- 2 files changed, 1 insertion(+), 64 deletions(-) diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c b/Mde= ModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c index 09064dda18..a48b295d26 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c @@ -104,8 +104,7 @@ ATA_ATAPI_PASS_THRU_INSTANCE gAtaAtapiPassThruInstanceT= emplate =3D { { // NonBlocking TaskList NULL, NULL - }, - NULL, // ExitBootEvent + } }; =20 ATAPI_DEVICE_PATH mAtapiDevicePathTemplate =3D { @@ -479,38 +478,6 @@ InitializeAtaAtapiPassThru ( return Status; } =20 -/** - Disable the device (especially Bus Master DMA) when exiting the boot - services. - - @param[in] Event Event for which this notification function is being - called. - @param[in] Context Pointer to the ATA_ATAPI_PASS_THRU_INSTANCE that - represents the HBA. -**/ -VOID -EFIAPI -AtaPassThruExitBootServices ( - IN EFI_EVENT Event, - IN VOID *Context - ) -{ - ATA_ATAPI_PASS_THRU_INSTANCE *Instance; - EFI_PCI_IO_PROTOCOL *PciIo; - - DEBUG ((DEBUG_VERBOSE, "%a: Context=3D0x%p\n", __FUNCTION__, Context)); - - Instance =3D Context; - PciIo =3D Instance->PciIo; - - PciIo->Attributes ( - PciIo, - EfiPciIoAttributeOperationDisable, - Instance->EnabledPciAttributes, - NULL - ); -} - /** Tests to see if this driver supports a given controller. If a child devi= ce is provided, it further tests to see if this driver supports creating a handle for th= e specified child device. @@ -790,17 +757,6 @@ AtaAtapiPassThruStart ( InitializeListHead(&Instance->DeviceList); InitializeListHead(&Instance->NonBlockingTaskList); =20 - Status =3D gBS->CreateEvent ( - EVT_SIGNAL_EXIT_BOOT_SERVICES, - TPL_CALLBACK, - AtaPassThruExitBootServices, - Instance, - &Instance->ExitBootEvent - ); - if (EFI_ERROR (Status)) { - goto ErrorExit; - } - Instance->TimerEvent =3D NULL; =20 Status =3D gBS->CreateEvent ( @@ -854,10 +810,6 @@ ErrorExit: gBS->CloseEvent (Instance->TimerEvent); } =20 - if ((Instance !=3D NULL) && (Instance->ExitBootEvent !=3D NULL)) { - gBS->CloseEvent (Instance->ExitBootEvent); - } - // // Remove all inserted ATA devices. // @@ -956,15 +908,6 @@ AtaAtapiPassThruStop ( Instance->TimerEvent =3D NULL; } DestroyAsynTaskList (Instance, FALSE); - - // - // Close event signaled at gBS->ExitBootServices(). - // - if (Instance->ExitBootEvent !=3D NULL) { - gBS->CloseEvent (Instance->ExitBootEvent); - Instance->ExitBootEvent =3D NULL; - } - // // Free allocated resource // diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h b/Mde= ModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h index 8d6eac706c..85e5a55539 100644 --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.h @@ -121,12 +121,6 @@ typedef struct { // EFI_EVENT TimerEvent; LIST_ENTRY NonBlockingTaskList; - - // - // For disabling the device (especially Bus Master DMA) at - // ExitBootServices(). - // - EFI_EVENT ExitBootEvent; } ATA_ATAPI_PASS_THRU_INSTANCE; =20 // --=20 2.15.0.gvfs.1.preview.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel