From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.63]) by mx.groups.io with SMTP id smtpd.web11.9891.1604919794727220619 for ; Mon, 09 Nov 2020 03:03:14 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=rMesg2yW; spf=pass (domain: xilinx.com, ip: 40.107.237.63, mailfrom: sdhanvad@xilinx.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QaqtuCsjyv/QTLamLYuCKS8cqtpBnEf2v1Ijk4aoMTw3ABh9h1ELGrk4xMvUyxetyFVNUuLS2BjYtuDfC6iIedOaZ7dvsx/G6QU1Rflp1vFb2/VcllZVhjndT9Hi8MLaHJus7bY90YcGmP2yIYscSzeSsutX0NHBnKq4h9LwS57JcWoqmHwr5pLzMcScGA+2CJhAcvM+AIL+etEdcDyROBYDeo//fVkTws++kSUUA/idnWMR4e6qL+LgOvP9AC7e2y/GDfh2XUqrU35KVqynUjDMJgp2qIRp2LyHkvR8zmrH17+x7oIsQtjhOmGuD4LuzQWtcx/Jsp9jyH6iDwyQMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5ECWTFSKh/ii7gCWKvnCit6evfVGbHjY3gQuzthlRnE=; b=dxiFNsbsIzAHMeboirXFxY/6jdWzDwNQqKnurJtvVjjs805gjvuedrnYaEpwYbAGiaXwOvOrvmUjmcMVUtPqZD3YTbShE5fTCBGfTO+RRLeU2jScPNqH6/PKA6bfHKUs6HlmckpIrPsS2ka0TrFiZ+cguI4kytnISpoTp/SYjpU8Rq2iMsCKMH1v2j4QC7KNfpY8fVfWcy3vZ7Bqn8sWDwVsfB/8J3g6lBTaBmLQa+3soDZ2FiIC19v87bLZ4wuBjLhqd4kRgAqIJYUKE4VL6CLojgo7HLxwKLh+o7xuVC4qugFSuq/BIWuSyNvvOtDzEUsQcKllDOAA2bJkcZ+qXw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5ECWTFSKh/ii7gCWKvnCit6evfVGbHjY3gQuzthlRnE=; b=rMesg2yWDftDZkTtIp/Cqsuqt+LT0FqD8jHXsHKRozNlzyZArLypZ2Huq1eKs6YSEnY7r+WCkCARl0PWu+NwjMdbSqHR0kahcmRyLMVb09Bb+wi75BJCy97SqP7/A5xtfuWB34Ay1EYR5q4yUTnFQBOy0teGvwJfAvF3z2SHimw= Received: from MN2PR22CA0016.namprd22.prod.outlook.com (2603:10b6:208:238::21) by CH2PR02MB6181.namprd02.prod.outlook.com (2603:10b6:610:1::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.23; Mon, 9 Nov 2020 11:03:12 +0000 Received: from BL2NAM02FT005.eop-nam02.prod.protection.outlook.com (2603:10b6:208:238:cafe::ce) by MN2PR22CA0016.outlook.office365.com (2603:10b6:208:238::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.21 via Frontend Transport; Mon, 9 Nov 2020 11:03:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by BL2NAM02FT005.mail.protection.outlook.com (10.152.76.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.3541.17 via Frontend Transport; Mon, 9 Nov 2020 11:03:11 +0000 Received: from xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Mon, 9 Nov 2020 03:03:11 -0800 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server id 15.1.1913.5 via Frontend Transport; Mon, 9 Nov 2020 03:03:11 -0800 Return-Path: SDHANVAD@xilinx.com Envelope-to: sandeep.dhanvada@xilinx.com, devel@edk2.groups.io Received: from [172.23.155.43] (port=42892 helo=xhdengvm155043.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1kc4x5-0004jf-4P; Mon, 09 Nov 2020 03:03:11 -0800 From: "Sandeep Dhanvada" To: CC: Subject: [PATCH 1/2] MdeModulePkg: Capsule upgrade fixes. Date: Mon, 9 Nov 2020 16:33:03 +0530 Message-ID: <8c8e1cbd38d4f7daaf135b1728d57dfa70fab7c3.1604918017.git.sandeep.dhanvada@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: References: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 44900af2-5d11-4552-6d52-08d8849f0c9e X-MS-TrafficTypeDiagnostic: CH2PR02MB6181: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fCqd994q0jDaAE+orrwcqsFKYx4GN4WEzHCs/YYGwF8yUvbuR3Wih4atfmhjdHlfnqPH7nnb3ut6+nwYqyMPCFCizb6n9neu0CVtcIINYE1KhdKh9hMzCS2+QkNA8AuzNLgkdnf+fdeSEvgj7S1vVMR7VAaMNx1ie+pQWsJJ0/YJ2UbaoOQn+3JM+5jxl57IARYudCvR3fFO+hm7l0HzieTt5v85UGs5o/LHvYqtzFVBYMJ/iqHL+slvAfP509nuK8tSogg/MxE+2kePxNGayn+wsWJsAE0m9KeDPIZu2Dwv7H/qUK+g/O0/1rMc1dXPfcm7YreK17L4t6StYyvNE1WYtgFjDUBjdaSibbmsdWRy/ukyneft2uy91rMhSlvStM2GTfeBBo3rBHbxbp3FRtHEcELskrmm49Qc+z7Xc/0= X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch01.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(4636009)(376002)(346002)(396003)(39850400004)(136003)(46966005)(316002)(8936002)(478600001)(36756003)(70206006)(5660300002)(19627235002)(2906002)(186003)(6666004)(83380400001)(44832011)(6916009)(4326008)(8676002)(82310400003)(26005)(70586007)(2616005)(356005)(9786002)(7636003)(47076004)(107886003)(82740400003)(7696005)(426003)(36906005)(336012)(102446001);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2020 11:03:11.7893 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 44900af2-5d11-4552-6d52-08d8849f0c9e X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: BL2NAM02FT005.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR02MB6181 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable ConnectAllControlers() function is taken from ShellPkg/Library/UefiShellLevel2CommandsLib/Load.c:ConnectAllEfi() without this function call, connect command should be explicitly exeucted on shell for the FMP SetImage to be executed after capsule update. Signed-off-by: Sandeep Dhanvada --- .../Library/DxeCapsuleLibFmp/DxeCapsuleLib.c | 43 ++++++++++++++++++= ++++ 1 file changed, 43 insertions(+) diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c b/MdeMod= ulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c index 9094213..818a91b 100644 --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c @@ -1001,6 +1001,48 @@ SetFmpImageData ( } /** + This function will connect all current system handles recursively. The + connection will finish until every handle's child handle created if it h= ave. + + This function is taken from ShellPkg/Library/UefiShellLevel2CommandsLib/= Load.c + + @retval EFI_SUCCESS All handles and it's child handle have bee= n + connected + @retval EFI_STATUS Return the status of gBS->LocateHandleBuff= er(). + +**/ + +EFI_STATUS +ConnectAllControllers (VOID) +{ + EFI_STATUS Status; + UINTN HandleCount; + EFI_HANDLE *HandleBuffer; + UINTN Index; + + Status =3D gBS->LocateHandleBuffer ( + AllHandles, + NULL, + NULL, + &HandleCount, + &HandleBuffer + ); + if (EFI_ERROR (Status)) { + return Status; + } + + for (Index =3D 0; Index < HandleCount; Index++) { + Status =3D gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TR= UE); + } + + if (HandleBuffer !=3D NULL) { + FreePool (HandleBuffer); + } + + return EFI_SUCCESS; +} + +/** Start a UEFI image in the FMP payload. @param[in] ImageBuffer A pointer to the memory location containing a = copy of the image to be loaded.. @@ -1067,6 +1109,7 @@ StartFmpImage ( DEBUG ((DEBUG_ERROR, "Driver Return Status =3D %r\n", Status)); } + ConnectAllControllers(); FreePool(DriverDevicePath); return Status; } -- 2.1.1 This email and any attachments are intended for the sole use of the named r= ecipient(s) and contain(s) confidential information that may be proprietary= , privileged or copyrighted under applicable law. If you are not the intend= ed recipient, do not read, copy, or forward this email message or any attac= hments. Delete this email message and any attachments immediately.