[AMD Official Use Only - General] Please kindly ignore this mail thread as I have created and sent out [PATCH V2] with correct title in another mail thread for review. Thank you. Regards, Neo ________________________________ From: Hsueh, Hong-Chih (Neo) Sent: Tuesday, February 20, 2024 1:48 PM To: Ding, Feng (Sunnyvale) ; Laszlo Ersek ; devel@edk2.groups.io Cc: He, Jiangang ; Chang, Abner ; ray.ni@intel.com ; gaoliming@byosoft.com.cn ; Gopal, Pradeep Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: plug device hierarchy leak upon bridge hot-unplug Hi Feng & Laszlo, Thank you for the feedback, I have changed the title of this email and the title of the commit message of this patch. The new patch as attached. If this patch looks good to you, could you please help to add reviewed-by? Thanks! Regards, Neo ________________________________ From: Ding, Feng (Sunnyvale) Sent: Thursday, February 8, 2024 5:09 PM To: Laszlo Ersek ; devel@edk2.groups.io ; Hsueh, Hong-Chih (Neo) Cc: He, Jiangang ; Chang, Abner ; ray.ni@intel.com ; gaoliming@byosoft.com.cn ; Gopal, Pradeep Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Fix hotplug functionality for USB4 bridge [AMD Official Use Only - General] Hi Laszlo, " MdeModulePkg/PciBusDxe: plug device hierarchy leak upon bridge hot-unplug " is perfect description for the issue. "a root bridge" is "a (PCIe Hotplug) bridge", locating anywhere. Thanks feng -----Original Message----- From: Laszlo Ersek Sent: Wednesday, February 7, 2024 12:51 PM To: devel@edk2.groups.io; Hsueh, Hong-Chih (Neo) Cc: Ding, Feng (Sunnyvale) ; He, Jiangang ; Chang, Abner ; ray.ni@intel.com; gaoliming@byosoft.com.cn Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Fix hotplug functionality for USB4 bridge Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding. On 2/6/24 23:34, Hsueh, Hong-Chih (Neo) via groups.io wrote: > 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 > 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 ( > } > } > > + DestroyPciDeviceTree (Bridge); > + > // > // End for > // I think the subject line is too specific. This patch appears to fix a general resource leak in the PCI hot-unplug functionality. Writing up the USB4 angle in the commit message is welcome in my opinion, but the subject should state something like: MdeModulePkg/PciBusDxe: plug device hierarchy leak upon bridge hot-unplug (And I think the bridge doesn't even have to be a *root* bridge for the leak to occur; is that right?) Laszlo -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115834): https://edk2.groups.io/g/devel/message/115834 Mute This Topic: https://groups.io/mt/104474693/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-