From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id D582C7803CD for ; Sun, 25 Feb 2024 13:59:19 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=JE+ILULgAA/lmjHCKUAx/qr3J9r+uwnwmp0cBsEWRqA=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1708869558; v=1; b=VVYx95Gml3zFB5phrJpMFUtY6STtYshujRwU9925gQVyHEubcLJIwjFkUMxg7ZjilMI2ANdV T9taUE9ZDtWrZzCDjnOLeyhdgs4aYgcL8jbx47tGim8OOl0lZACdyNo+v3N1oTFYtxpfqsKXHMd FsV5nOO9Y+lMcxzGQDtR599s= X-Received: by 127.0.0.2 with SMTP id LAUjYY7687511xgdT74lwEXA; Sun, 25 Feb 2024 05:59:18 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.39180.1708869557843192605 for ; Sun, 25 Feb 2024 05:59:18 -0800 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-204-5yHcqLuYN8KV1B7pka6zMg-1; Sun, 25 Feb 2024 08:59:13 -0500 X-MC-Unique: 5yHcqLuYN8KV1B7pka6zMg-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A6AE63C025D2; Sun, 25 Feb 2024 13:59:12 +0000 (UTC) X-Received: from [10.39.192.57] (unknown [10.39.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 150342864; Sun, 25 Feb 2024 13:59:10 +0000 (UTC) Message-ID: Date: Sun, 25 Feb 2024 14:59:10 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v2] MdeModulePkg/PciBusDxe: plug device hierarchy leak upon bridge hot-unplug To: Neo Hsueh , 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 References: <3a640aa0f5555ccc327588ef7bb8d4ba5941442d.1708619173.git.Hong-Chih.Hsueh@amd.com> From: "Laszlo Ersek" In-Reply-To: <3a640aa0f5555ccc327588ef7bb8d4ba5941442d.1708619173.git.Hong-Chih.Hsueh@amd.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: JsU1zg68Bchc1Dx4fyxQpI7rx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=VVYx95Gm; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On 2/22/24 17:28, Neo Hsueh wrote: > A USB4 or TBT bridge can be plugged or unplugged on USB4 port. The action= s require PciHotPlugRequestNotify to add a root bridge or remove a root bri= dge completely. > In the plug-unplug-plug scenerio, PciHotPlugRequestNotify will return wit= h no-action on second plug because bridge tree shows configured. > Destroy Pci Device Tree in function PciHotPlugRequestNotify for unplug ev= ent to fix this issue. >=20 > Cc: Feng Ding > Cc: Jiangang He > Signed-off-by: Neo Hsueh > --- > MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c b/MdeModulePk= g/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 ( > } > } > =20 > + 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 but the patch should not be merged until Ray provides an R-b. Laszlo -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- 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] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-