From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YnSL7-0003uF-AI for mharc-grub-devel@gnu.org; Wed, 29 Apr 2015 09:47:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnSL5-0003tQ-Kc for grub-devel@gnu.org; Wed, 29 Apr 2015 09:47:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnSL4-000564-O7 for grub-devel@gnu.org; Wed, 29 Apr 2015 09:47:47 -0400 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:33460) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnSL4-00055y-HA for grub-devel@gnu.org; Wed, 29 Apr 2015 09:47:46 -0400 Received: by wief7 with SMTP id f7so40721310wie.0 for ; Wed, 29 Apr 2015 06:47:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=VPjQPt8YiYCcxQKsDh3MS4r2yFxZT0S+D0fdYAwBxFA=; b=TSc6EFWS5bjOdep9UAMP2sVoDZRr4a8JeKGJY6y++rNRXkPsRH9XNI/yBBCtiiWtTS I1wQrs4yHKWfaR+A3vho+1fx0nFZlWrJ4005L99y257mWylZdG1ZDOOyJoZu8t0+V5tp EPRSdDhI03P2f1NjT2gzAlMnAEjdPs1wnXi8/NuHchJdWSM5YGgebJkMfaxY8InYI5uH HxzgvdPzm2O/c7dwOnALYsR69WA2lixoV6cluwNFlnCulKBRqsjC3oDDjpex2yamN2dB ERfNFoylZ0CQJ9IE2CELoBkRClAJzNTnmChCRPvSUn23EzoJoWxWhPqCWnXKrKZIU8vZ 5ZLA== X-Received: by 10.180.85.9 with SMTP id d9mr6202344wiz.28.1430315265569; Wed, 29 Apr 2015 06:47:45 -0700 (PDT) Received: from ?IPv6:2620:0:105f:fd00:863a:4bff:fe50:abc4? ([2620:0:105f:fd00:863a:4bff:fe50:abc4]) by mx.google.com with ESMTPSA id z13sm39136562wjr.44.2015.04.29.06.47.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Apr 2015 06:47:44 -0700 (PDT) Message-ID: <5540E100.2000303@gmail.com> Date: Wed, 29 Apr 2015 15:47:44 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [edk2] [PATCH 2/2] efinet: fix lost packets due to active MNP instances References: <1429430471-7229-1-git-send-email-arvidjaar@gmail.com> <1429430471-7229-2-git-send-email-arvidjaar@gmail.com> <20150420063000.GA19089@linux-dsax.tai.apac.novell.com> <20150421061254.GA19491@linux-dsax.tai.apac.novell.com> <20150425171233.19436c4e@opensuse.site> In-Reply-To: <20150425171233.19436c4e@opensuse.site> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mThEMFu6VeQ8nHoW0U2r103fJNbjujp6I" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::234 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2015 13:47:48 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mThEMFu6VeQ8nHoW0U2r103fJNbjujp6I Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 25.04.2015 16:12, Andrei Borzenkov wrote: > --- > grub-core/net/drivers/efi/efinet.c | 101 +++++++++++++++++++++++++++++= +++++++- > 1 file changed, 99 insertions(+), 2 deletions(-) >=20 > 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; > } > =20 > +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 ins= tance > + that may compete for packet polling > + */ > + net =3D grub_efi_open_protocol (dev->efi_handle, &net_io_guid, > + GRUB_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE); > + if (net) > + { > + if (net->mode->state =3D=3D GRUB_EFI_NETWORK_STOPPED > + && efi_call_1 (net->start, net) !=3D GRUB_EFI_SUCCESS) > + return GRUB_ERR_BAD_DEVICE; > + Please use proper grub_error. > + if (net->mode->state =3D=3D GRUB_EFI_NETWORK_STOPPED) > + return GRUB_ERR_BAD_DEVICE; > + Ditto > + if (net->mode->state =3D=3D GRUB_EFI_NETWORK_STARTED > + && efi_call_3 (net->initialize, net, 0, 0) !=3D 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) --mThEMFu6VeQ8nHoW0U2r103fJNbjujp6I Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iF4EAREKAAYFAlVA4QAACgkQmBXlbbo5nOuT7AD/chjblsuaxEEITKEUACm6BdN2 gcoWJCUJdwnbvxVdYBwA/0fDJaT5sowOU3VvRTz14izpMEorC3BQjpHKh0g4zP7T =60U7 -----END PGP SIGNATURE----- --mThEMFu6VeQ8nHoW0U2r103fJNbjujp6I--