From nobody Mon Apr 29 07:12:31 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 1519897121983129.07985059735313; Thu, 1 Mar 2018 01:38:41 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0208C222630D0; Thu, 1 Mar 2018 01:32:29 -0800 (PST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 3FF2022423851 for ; Thu, 1 Mar 2018 01:32:26 -0800 (PST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Mar 2018 01:38:34 -0800 Received: from ldu-mobl.ccr.corp.intel.com (HELO jiaxinwu-MOBL2.ccr.corp.intel.com) ([10.254.212.250]) by orsmga005.jf.intel.com with ESMTP; 01 Mar 2018 01:38: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.88; helo=mga01.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,407,1515484800"; d="scan'208";a="204681819" From: Jiaxin Wu To: edk2-devel@lists.01.org Date: Thu, 1 Mar 2018 17:38:28 +0800 Message-Id: <20180301093828.16440-2-jiaxin.wu@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20180301093828.16440-1-jiaxin.wu@intel.com> References: <20180301093828.16440-1-jiaxin.wu@intel.com> Subject: [edk2] [Patch] MdeModulePkg/Mtftp4Dxe: Restore the TPL before the poll function. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ye Ting , Wang Fan , Fu Siyuan 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 is to fix the hang issue, which was enrolled by the commit of 39= b0867d. The TPL should be restored before calling poll function at TPL_CALLBACK. Cc: Wang Fan Cc: Fu Siyuan Cc: Ye Ting Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu --- MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c b/MdeMod= ulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c index f5f9e6d8f7..64e0463dd9 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c @@ -507,24 +507,27 @@ Mtftp4Start ( if (EFI_ERROR (Status)) { Status =3D EFI_DEVICE_ERROR; goto ON_ERROR; } =20 + // + // Restore the TPL now, don't call poll function at TPL_CALLBACK. + // + gBS->RestoreTPL (OldTpl); + if (Token->Event !=3D NULL) { - gBS->RestoreTPL (OldTpl); return EFI_SUCCESS; } =20 // // Return immediately for asynchronous operation or poll the // instance for synchronous operation. // while (Token->Status =3D=3D EFI_NOT_READY) { This->Poll (This); } - - gBS->RestoreTPL (OldTpl); + =20 return Token->Status; =20 ON_ERROR: Mtftp4CleanOperation (Instance, Status); gBS->RestoreTPL (OldTpl); --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel