[AMD Official Use Only - AMD Internal Distribution Only]

Hi Ray,

You are right. The change is NOT necessary.

Thanks
feng

From: Ni, Ray <[email protected]>
Sent: Tuesday, May 7, 2024 8:26 PM
To: Hsueh, Hong-Chih (Neo) <[email protected]>; Laszlo Ersek 
<[email protected]>; [email protected]
Cc: Ding, Feng (Sunnyvale) <[email protected]>; He, Jiangang 
<[email protected]>; Chang, Abner <[email protected]>; 
[email protected]
Subject: Re: [PATCH v2] MdeModulePkg/PciBusDxe: plug device hierarchy leak upon 
bridge hot-unplug

Caution: This message originated from an External Source. Use proper caution 
when opening attachments, clicking links, or responding.

Neo,
I don't think your change is needed because of the following existing logic 
where RemoveAllPciDeviceOnBridge() is called to destroy/free all PCI nodes.




  if (Operation == EfiPciHotplugRequestRemove) {

    if (*NumberOfChildren == 0) {

      //

      // Remove all devices on the bridge

      //

      RemoveAllPciDeviceOnBridge (RootBridgeHandle, Bridge);

      return EFI_SUCCESS;

    }


Thanks,
Ray
________________________________
From: Hsueh, Hong-Chih (Neo) 
<[email protected]<mailto:[email protected]>>
Sent: Wednesday, May 1, 2024 2:24
To: Laszlo Ersek <[email protected]<mailto:[email protected]>>; 
[email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>>; Ni, Ray 
<[email protected]<mailto:[email protected]>>
Cc: Ding, Feng (Sunnyvale) <[email protected]<mailto:[email protected]>>; He, 
Jiangang <[email protected]<mailto:[email protected]>>; Chang, Abner 
<[email protected]<mailto:[email protected]>>; 
[email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH v2] MdeModulePkg/PciBusDxe: plug device hierarchy leak upon 
bridge hot-unplug


[AMD Official Use Only - General]

Hi @[email protected]<mailto:[email protected]>,

Sorry you bother you, may I have your feedback for this patch?
If it looks good to you could you help to give me an R-b ?

Thank you.

Regards,
Neo

________________________________
From: Laszlo Ersek <[email protected]<mailto:[email protected]>>
Sent: Sunday, February 25, 2024 7:59 AM
To: Hsueh, Hong-Chih (Neo) 
<[email protected]<mailto:[email protected]>>; 
[email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>>
Cc: Ding, Feng (Sunnyvale) <[email protected]<mailto:[email protected]>>; He, 
Jiangang <[email protected]<mailto:[email protected]>>; Chang, Abner 
<[email protected]<mailto:[email protected]>>; 
[email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>>; 
[email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>>
Subject: Re: [PATCH v2] MdeModulePkg/PciBusDxe: plug device hierarchy leak upon 
bridge hot-unplug

Caution: This message originated from an External Source. Use proper caution 
when opening attachments, clicking links, or responding.


On 2/22/24 17:28, Neo Hsueh 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 <[email protected]<mailto:[email protected]>>
> Cc: Jiangang He <[email protected]<mailto:[email protected]>>
> Signed-off-by: Neo Hsueh 
> <[email protected]<mailto:[email protected]>>
> ---
>  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
>      //

This looks convincing to me, but I don't now nearly enough about
PciBusDxe internals (resource management in particular) to confidently
approve this patch. I can give an

Acked-by: Laszlo Ersek <[email protected]<mailto:[email protected]>>

but the patch should not be merged until Ray provides an R-b.

Laszlo


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119051): https://edk2.groups.io/g/devel/message/119051
Mute This Topic: https://groups.io/mt/104511503/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to