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 bridge 
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 event to 
fix this issue.

Cc: Feng Ding <feng1.d...@amd.com>
Cc: Jiangang He <jiangang...@amd.com>
Signed-off-by: Neo Hsueh <hong-chih.hs...@amd.com>
---
 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 (
       }
     }
 
+    DestroyPciDeviceTree (Bridge);
+
     //
     // End for
     //
-- 
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115833): https://edk2.groups.io/g/devel/message/115833
Mute This Topic: https://groups.io/mt/104511503/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to