public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: Anthony PERARD <anthony.perard@citrix.com>, devel@edk2.groups.io
Cc: Jordan Justen <jordan.l.justen@intel.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Julien Grall <julien.grall@arm.com>
Subject: Re: [PATCH] OvmfPkg/XenBusDxe: Close XenIoProtocol openned by childs
Date: Sun, 30 Jun 2019 12:56:57 +0200	[thread overview]
Message-ID: <c84d82f9-f551-f6ea-0342-01dc526b23a6@redhat.com> (raw)
In-Reply-To: <20190628161606.13141-1-anthony.perard@citrix.com>

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


(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,
>

  reply	other threads:[~2019-06-30 10:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-28 16:16 [PATCH] OvmfPkg/XenBusDxe: Close XenIoProtocol openned by childs Anthony PERARD
2019-06-30 10:56 ` Laszlo Ersek [this message]
2019-07-01 10:48   ` Anthony PERARD

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=c84d82f9-f551-f6ea-0342-01dc526b23a6@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