grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [edk2] [PATCH 2/2] efinet: fix lost packets due to active MNP instan


From: Vladimir 'φ-coder/phcoder' Serbinenko
Subject: Re: [edk2] [PATCH 2/2] efinet: fix lost packets due to active MNP instances
Date: Wed, 29 Apr 2015 15:47:44 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0

On 25.04.2015 16:12, Andrei Borzenkov wrote:
> ---
>  grub-core/net/drivers/efi/efinet.c | 101 
> ++++++++++++++++++++++++++++++++++++-
>  1 file changed, 99 insertions(+), 2 deletions(-)
> 
> diff --git a/grub-core/net/drivers/efi/efinet.c 
> b/grub-core/net/drivers/efi/efinet.c
> index f171f20..46e337a 100644
> --- a/grub-core/net/drivers/efi/efinet.c
> +++ b/grub-core/net/drivers/efi/efinet.c
> @@ -142,9 +142,52 @@ get_card_packet (struct grub_net_card *dev)
>    return nb;
>  }
>  
> +static grub_err_t
> +open_card (struct grub_net_card *dev)
> +{
> +  grub_efi_simple_network_t *net;
> +
> +  /* Try to reopen SNP exlusively to close any active MNP protocol instance
> +     that may compete for packet polling
> +   */
> +  net = grub_efi_open_protocol (dev->efi_handle, &net_io_guid,
> +                             GRUB_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE);
> +  if (net)
> +    {
> +      if (net->mode->state == GRUB_EFI_NETWORK_STOPPED
> +       && efi_call_1 (net->start, net) != GRUB_EFI_SUCCESS)
> +     return GRUB_ERR_BAD_DEVICE;
> +
Please use proper grub_error.
> +      if (net->mode->state == GRUB_EFI_NETWORK_STOPPED)
> +     return GRUB_ERR_BAD_DEVICE;
> +
Ditto
> +      if (net->mode->state == GRUB_EFI_NETWORK_STARTED
> +       && efi_call_3 (net->initialize, net, 0, 0) != GRUB_EFI_SUCCESS)
> +     return GRUB_ERR_BAD_DEVICE;
> +
Ditto

Otherwise patch looks good. If you're comfortable with it, please
commit. Make sure to credit all relevant authors, feel free to use
Also-By to credit several authors (AFAIU Martin as main author and you
in Also-By)

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]