All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [edk2] [PATCH 2/2] efinet: fix lost packets due to active MNP instances
Date: Wed, 29 Apr 2015 15:47:44 +0200	[thread overview]
Message-ID: <5540E100.2000303@gmail.com> (raw)
In-Reply-To: <20150425171233.19436c4e@opensuse.site>

[-- Attachment #1: Type: text/plain, Size: 1576 bytes --]

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

  parent reply	other threads:[~2015-04-29 13:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-19  8:01 [PATCH 1/2] efidisk: move device path helpers in core for efinet Andrei Borzenkov
2015-04-19  8:01 ` [PATCH 2/2] efinet: fix lost packets due to active MNP instances Andrei Borzenkov
2015-04-20  6:30   ` Michael Chang
2015-04-21  6:12     ` [edk2] " Michael Chang
2015-04-21  6:49       ` Michael Chang
2015-04-21 12:30         ` Laszlo Ersek
2015-04-22  9:57           ` Michael Chang
2015-04-22 10:50             ` Laszlo Ersek
2015-04-25 14:12       ` Andrei Borzenkov
2015-04-27  6:42         ` Michael Chang
2015-04-29 13:47         ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2015-05-07 17:39           ` Andrei Borzenkov
2015-04-26  6:42       ` Andrei Borzenkov
2015-04-26 10:44         ` Andrei Borzenkov
2015-04-27  6:47         ` Michael Chang
2015-04-28  6:03           ` Michael Chang
2015-04-28  8:45             ` Michael Chang
2015-04-29 15:42 ` [PATCH 1/2] efidisk: move device path helpers in core for efinet Vladimir 'phcoder' Serbinenko
2015-05-07 14:53 ` Vladimir 'φ-coder/phcoder' Serbinenko

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-all 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=5540E100.2000303@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.