public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: Neo Hsueh <Hong-Chih.Hsueh@amd.com>, devel@edk2.groups.io
Cc: feng1.ding@amd.com, jiangang.he@amd.com, abner.chang@amd.com,
	ray.ni@intel.com, gaoliming@byosoft.com.cn
Subject: Re: [edk2-devel] [PATCH v2] MdeModulePkg/PciBusDxe: plug device hierarchy leak upon bridge hot-unplug
Date: Sun, 25 Feb 2024 14:59:10 +0100	[thread overview]
Message-ID: <a19bd96e-19d8-d2ad-e607-223a4433a3ee@redhat.com> (raw)
In-Reply-To: <3a640aa0f5555ccc327588ef7bb8d4ba5941442d.1708619173.git.Hong-Chih.Hsueh@amd.com>

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 <feng1.ding@amd.com>
> Cc: Jiangang He <jiangang.he@amd.com>
> Signed-off-by: Neo Hsueh <Hong-Chih.Hsueh@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
>      //

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 <lersek@redhat.com>

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 (#115926): https://edk2.groups.io/g/devel/message/115926
Mute This Topic: https://groups.io/mt/104511503/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2024-02-25 13:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-22 16:28 [edk2-devel] [PATCH v2] MdeModulePkg/PciBusDxe: plug device hierarchy leak upon bridge hot-unplug Hsueh, Hong-Chih (Neo) via groups.io
2024-02-25 13:59 ` Laszlo Ersek [this message]
2024-04-30 18:24   ` Hsueh, Hong-Chih (Neo) via groups.io
2024-05-08  3:25     ` Ni, Ray
2024-05-17  0:39       ` Ding, Feng (Sunnyvale) via groups.io
2024-05-17  5:51         ` Ni, Ray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a19bd96e-19d8-d2ad-e607-223a4433a3ee@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox