[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)
signature.asc
Description: OpenPGP digital signature
- [PATCH 1/2] efidisk: move device path helpers in core for efinet, Andrei Borzenkov, 2015/04/19
- [PATCH 2/2] efinet: fix lost packets due to active MNP instances, Andrei Borzenkov, 2015/04/19
- Re: [PATCH 2/2] efinet: fix lost packets due to active MNP instances, Michael Chang, 2015/04/20
- Re: [edk2] [PATCH 2/2] efinet: fix lost packets due to active MNP instances, Michael Chang, 2015/04/21
- Re: [edk2] [PATCH 2/2] efinet: fix lost packets due to active MNP instances, Michael Chang, 2015/04/21
- Re: [edk2] [PATCH 2/2] efinet: fix lost packets due to active MNP instances, Laszlo Ersek, 2015/04/21
- Re: [edk2] [PATCH 2/2] efinet: fix lost packets due to active MNP instances, Michael Chang, 2015/04/22
- Re: [edk2] [PATCH 2/2] efinet: fix lost packets due to active MNP instances, Laszlo Ersek, 2015/04/22
- Re: [edk2] [PATCH 2/2] efinet: fix lost packets due to active MNP instances, Andrei Borzenkov, 2015/04/25
- Re: [edk2] [PATCH 2/2] efinet: fix lost packets due to active MNP instances, Michael Chang, 2015/04/27
- Re: [edk2] [PATCH 2/2] efinet: fix lost packets due to active MNP instances,
Vladimir 'φ-coder/phcoder' Serbinenko <=
- Re: [edk2] [PATCH 2/2] efinet: fix lost packets due to active MNP instances, Andrei Borzenkov, 2015/04/26
- Re: [edk2] [PATCH 2/2] efinet: fix lost packets due to active MNP instances, Andrei Borzenkov, 2015/04/26
- Re: [edk2] [PATCH 2/2] efinet: fix lost packets due to active MNP instances, Michael Chang, 2015/04/27
- Re: [edk2] [PATCH 2/2] efinet: fix lost packets due to active MNP instances, Michael Chang, 2015/04/28
- Re: [edk2] [PATCH 2/2] efinet: fix lost packets due to active MNP instances, Michael Chang, 2015/04/28
- Re: [PATCH 1/2] efidisk: move device path helpers in core for efinet, Vladimir 'phcoder' Serbinenko, 2015/04/29