From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 1F177D80186 for ; Tue, 6 Feb 2024 22:35:40 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=qc2XZ9d7UoSW0e5cF07k1D8oRmssKhe/oTtRdowaaMI=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1707258939; v=1; b=FkkLLcUqLfd3ImTWLe+TLoH+E6JhyIwSkTMrmLtbb1ICBzEcFDVc7ycYGOH60g9okcs1rrgX UMC5nBGQBKgB8S0oBEWINzEwyQfOP/kqsUgDMMcS2H85/LEUw/vtswMffsloYIvs3EvVBJZqhWC EkPosoRaD0w/hRtPsZMkRXMw= X-Received: by 127.0.0.2 with SMTP id to9PYY7687511xL91anbhu6b; Tue, 06 Feb 2024 14:35:39 -0800 X-Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.62]) by mx.groups.io with SMTP id smtpd.web10.6977.1707258938924520189 for ; Tue, 06 Feb 2024 14:35:39 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YBLF/6KS3JTvzf8qYdnPn91/yhgEJopEqXghe9LVJHJOp7aYcfaIY/koYk9nRjbnufzkZYNVYQhxR0xCgtvWHJGeyQ9puB2Z+49X4tDGVvE4eyUy/XAtNUJzPdXWP/LYJDThp0GWl4ri63eLEmLc9YFVgvSZl+N4MuanrCCxRv7LakoqJU4DVJPPu8PFbd0zxb1l2oNcD6abtO3i0h/9b9+J6EptfTLzHkWQCHE1UhkRyBcJSoW6mH21zclPfcA7Qf0td+WrPCIDkr6NePyhotvXT6WhQ0pOiXYS7BiOzjg1yfp3UflHmGHIgtfmHLjLu8q7yVgdvYzlToVW3AaFXA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EPaDNc49dtkrO4Xk0Y/h16S5tMtImi87i8ooB4asNjc=; b=f1Wzfkt70gbEbK9tJsGoGK3PqkLqjYx2MOnbLwiSSsH2lIQ0gXG1cb92Ri+nfTt6yrbGwN2YNwL2+AxIJ6WMJagCzXndWK0aplUt4IV9uQjMMDy1aZeGeEYLwOU9yAEDhps+crlT2ZfLd8ZHI142F7CGqY7j3Vv2kQv8FwquSW1IJK2yPa+wNx7o/Btk736EjOtz0jrsefIuUkyk4d/vMSDsLxxIxscCSqs1UQnERYMvH8N77qfX931C3LUTEXLrPFtE+xQi/bN/1pJrOyJ5m098gpoE/7KZ3EC/YqxzFK264vrtqlmCPpLxcNdTpShxwclbcy5TWVcbL8uoPjV3DA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from DM6PR03CA0098.namprd03.prod.outlook.com (2603:10b6:5:333::31) by MN2PR12MB4128.namprd12.prod.outlook.com (2603:10b6:208:1dd::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.17; Tue, 6 Feb 2024 22:35:35 +0000 X-Received: from DS1PEPF0001709B.namprd05.prod.outlook.com (2603:10b6:5:333:cafe::95) by DM6PR03CA0098.outlook.office365.com (2603:10b6:5:333::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.36 via Frontend Transport; Tue, 6 Feb 2024 22:35:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF0001709B.mail.protection.outlook.com (10.167.18.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7249.19 via Frontend Transport; Tue, 6 Feb 2024 22:35:35 +0000 X-Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Tue, 6 Feb 2024 16:35:34 -0600 From: "Hsueh, Hong-Chih (Neo) via groups.io" To: CC: , , , , , Neo Hsueh Subject: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Fix hotplug functionality for USB4 bridge Date: Tue, 6 Feb 2024 16:34:34 -0600 Message-ID: <76e2a0274cd2620ee43a5942c307d63c6c095d3b.1707258489.git.Hong-Chih.Hsueh@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001709B:EE_|MN2PR12MB4128:EE_ X-MS-Office365-Filtering-Correlation-Id: 5150846f-f6e8-4776-6c2d-08dc2763ef78 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: KzHfFeo8CGFDNm1ogIBrYkv+cUP3428FJ6C1/1WSY6zKDiX0QTC3y8s5MAKnISfOdP+YSuz+vdj/yNwUNRqlFVTDZHhZrEixJ6jULKgChnLCtyMD0Q0YvOAeFRmrN31XIs+tOvoTdd06KPgWwAM9i8aDOlRrx6ZOlsuzGp39Bm32OtpqgelDiB8wbofnsFmnYxDmxHIEk8dBW8hI2cnxYMyA35iSEGV0LG2mFFoMWW1PpWFXzV1pDQnLsbM+vjHc7g7UpVKq4ybsYPARQbkCrApkurPt0revMgQOu44m86WvNoJb6zTIzqIy0vOE86+wMFpSt9Wb9DOARhP2rullBx/0URgKdQUeHLNHo9su+tGWhQ8dvU08ZeqptEpn+Prz/X/MZnem3WAq+a1itz7ipOfIfpQtF7XX4krcw2eNlNajj7qS7ajvS/sgvLl7g/RSlpOVLw8CHSTHa7G6d3gQgdtHKPKCJ4+Nwm+ozzQ0nXfwfJteogYbTzYGD/tL6XP56Vo5FGw3iEJbftNpkG85/vRzTsTmay1zZ4zy5tJy/oE2/8omdN/94xqeVTVrvshRbAnCTWps/alDAE6GhbOtXdN6QbIzmYjAH14aVIuLCj/RHlLmjuzm1AvTg0RLruAeniSe2ANidEn3omdmexuhScNPGT0TPFN9yL6IbRUNYVwbDqpRuz9qfPz82YqaWygfMmmHzWhxn75EOK+9gP7/pLe6WzKfFU0ufDnoO3+bGuFfyI+4TfULBDLj3nlvAAg1/+2cFLWH67vYyfZvf0OKDQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2024 22:35:35.1722 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5150846f-f6e8-4776-6c2d-08dc2763ef78 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0001709B.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4128 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,hong-chih.hsueh@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 0LFryYbMLuGN2GwJZJboyOFnx7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=FkkLLcUq; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=pass (policy=none) header.from=groups.io; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") A USB4 or TBT bridge can be plugged or unplugged on USB4 port. The actions = require PciHotPlugRequestNotify to add a root bridge or remove a root bridg= e completely. In the plug-unplug-plug scenerio, PciHotPlugRequestNotify will return with = no-action on second plug because bridge tree shows configured. Destroy Pci Device Tree in function PciHotPlugRequestNotify for unplug even= t to fix this issue. Cc: Feng Ding Cc: Jiangang He Signed-off-by: Neo Hsueh --- MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c b/MdeModulePkg/= Bus/Pci/PciBusDxe/PciEnumerator.c index 3f8c6e6da7..2b7af60e0a 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c @@ -2103,6 +2103,8 @@ PciHotPlugRequestNotify ( } } =20 + DestroyPciDeviceTree (Bridge); + // // End for // --=20 2.40.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115190): https://edk2.groups.io/g/devel/message/115190 Mute This Topic: https://groups.io/mt/104208348/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-