public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ding, Feng (Sunnyvale) via groups.io" <feng1.ding=amd.com@groups.io>
To: Laszlo Ersek <lersek@redhat.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Hsueh, Hong-Chih (Neo)" <Hong-Chih.Hsueh@amd.com>
Cc: "He, Jiangang" <Jiangang.He@amd.com>,
	"Chang, Abner" <Abner.Chang@amd.com>,
	"ray.ni@intel.com" <ray.ni@intel.com>,
	"gaoliming@byosoft.com.cn" <gaoliming@byosoft.com.cn>,
	"Gopal, Pradeep" <Pradeep.Gopal@amd.com>
Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Fix hotplug functionality for USB4 bridge
Date: Thu, 8 Feb 2024 23:09:58 +0000	[thread overview]
Message-ID: <BL1PR12MB5288961D8899A001D92D70F3CC442@BL1PR12MB5288.namprd12.prod.outlook.com> (raw)
In-Reply-To: <200b9430-0263-e76e-afca-d4ea14f23612@redhat.com>

[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 <lersek@redhat.com>
Sent: Wednesday, February 7, 2024 12:51 PM
To: devel@edk2.groups.io; Hsueh, Hong-Chih (Neo) <Hong-Chih.Hsueh@amd.com>
Cc: Ding, Feng (Sunnyvale) <feng1.ding@amd.com>; He, Jiangang <Jiangang.He@amd.com>; Chang, Abner <Abner.Chang@amd.com>; 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 <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
>      //

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 (#115298): https://edk2.groups.io/g/devel/message/115298
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]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2024-02-09 10:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 22:34 [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Fix hotplug functionality for USB4 bridge Hsueh, Hong-Chih (Neo) via groups.io
2024-02-07 20:51 ` Laszlo Ersek
2024-02-08 23:09   ` Ding, Feng (Sunnyvale) via groups.io [this message]
2024-02-20 19:48     ` [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: plug device hierarchy leak upon bridge hot-unplug Hsueh, Hong-Chih (Neo) via groups.io
2024-02-21 20:05       ` Laszlo Ersek
2024-02-22 16:33       ` Hsueh, Hong-Chih (Neo) via groups.io
2024-08-16  2:33     ` [edk2-devel] [PATCH] MdeModulePkg/PciBusDxe: Fix hotplug functionality for USB4 bridge Yoshinoya
2024-08-16  6:55       ` 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=BL1PR12MB5288961D8899A001D92D70F3CC442@BL1PR12MB5288.namprd12.prod.outlook.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