From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Sun, 30 Jun 2019 03:58:01 -0700 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E588E307D90E; Sun, 30 Jun 2019 10:58:00 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-76.ams2.redhat.com [10.36.116.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id 949D05C1B5; Sun, 30 Jun 2019 10:57:42 +0000 (UTC) Subject: Re: [PATCH] OvmfPkg/XenBusDxe: Close XenIoProtocol openned by childs To: Anthony PERARD , devel@edk2.groups.io Cc: Jordan Justen , Ard Biesheuvel , Julien Grall References: <20190628161606.13141-1-anthony.perard@citrix.com> From: "Laszlo Ersek" Message-ID: Date: Sun, 30 Jun 2019 12:56:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190628161606.13141-1-anthony.perard@citrix.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Sun, 30 Jun 2019 10:58:01 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Hi Anthony, the patch is good; please post a v2 with the following minor improvements: On 06/28/19 18:16, Anthony PERARD wrote: > In XenBusDxe, the XenBusAddDevice() opens the gXenIoProtocolGuid on > behalf of child controllers. It is never closed and prevent from (1) s/prevent/prevents us/ > uninstalling the protocol. > > Close it were we stop all the childs in XenBusDxe->Stop(). (2) s/were/where/ (3) s/childs/children/ -- applies to the subject line as well > > Signed-off-by: Anthony PERARD > --- > OvmfPkg/XenBusDxe/XenBusDxe.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/OvmfPkg/XenBusDxe/XenBusDxe.c b/OvmfPkg/XenBusDxe/XenBusDxe.c > index 0e63707f50..fac6f3a09d 100644 > --- a/OvmfPkg/XenBusDxe/XenBusDxe.c > +++ b/OvmfPkg/XenBusDxe/XenBusDxe.c > @@ -453,6 +453,11 @@ XenBusDxeDriverBindingStop ( > continue; > } > > + Status = gBS->CloseProtocol (Dev->ControllerHandle, &gXenIoProtocolGuid, > + Dev->This->DriverBindingHandle, > + ChildData->Handle); > + ASSERT_EFI_ERROR (Status); > + (4) The indentation of function call arguments is inconsistent in this driver. Still, if it's not a lot of trouble, please correct the indentation here. Please pick one of the two below: (4a) Status = gBS->CloseProtocol ( Dev->ControllerHandle, &gXenIoProtocolGuid, Dev->This->DriverBindingHandle, ChildData->Handle ); (4b) Status = gBS->CloseProtocol (Dev->ControllerHandle, &gXenIoProtocolGuid, Dev->This->DriverBindingHandle, ChildData->Handle); With those updates, please add, to v2: Reviewed-by: Laszlo Ersek (5) Side remark (no need to do anything about it in the scope of this patch): I think the DisconnectController() call in XenBusDxeDriverBindingStop() is superfluous. That kind of disconnection is not the job of EFI_DRIVER_BINDING_PROTOCOL.Stop(). Thanks Laszlo > Status = gBS->UninstallMultipleProtocolInterfaces ( > ChildData->Handle, > &gEfiDevicePathProtocolGuid, ChildData->DevicePath, >