Parcourir la source

[efi] Ignore failures when attempting to install SNP HII protocol

HII seems to fail on several systems.  Since it is non-essential,
treat HII problems as non-fatal.

Debugged-by: Curtis Larsen <larsen@dixie.edu>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown il y a 10 ans
Parent
révision
7cfb502fff
2 fichiers modifiés avec 13 ajouts et 6 suppressions
  1. 8
    4
      src/interface/efi/efi_snp.c
  2. 5
    2
      src/interface/efi/efi_snp_hii.c

+ 8
- 4
src/interface/efi/efi_snp.c Voir le fichier

@@ -1053,7 +1053,10 @@ static int efi_snp_probe ( struct net_device *netdev ) {
1053 1053
 	if ( ( rc = efi_snp_hii_install ( snpdev ) ) != 0 ) {
1054 1054
 		DBGC ( snpdev, "SNPDEV %p could not install HII: %s\n",
1055 1055
 		       snpdev, strerror ( rc ) );
1056
-		goto err_hii_install;
1056
+		/* HII fails on several platforms.  It's
1057
+		 * non-essential, so treat this as a non-fatal
1058
+		 * error.
1059
+		 */
1057 1060
 	}
1058 1061
 
1059 1062
 	/* Add to list of SNP devices */
@@ -1064,8 +1067,8 @@ static int efi_snp_probe ( struct net_device *netdev ) {
1064 1067
 	       efi_devpath_text ( &snpdev->path ) );
1065 1068
 	return 0;
1066 1069
 
1067
-	efi_snp_hii_uninstall ( snpdev );
1068
- err_hii_install:
1070
+	if ( snpdev->package_list )
1071
+		efi_snp_hii_uninstall ( snpdev );
1069 1072
 	efidev_child_del ( efidev, snpdev->handle );
1070 1073
  err_efidev_child_add:
1071 1074
 	bs->UninstallMultipleProtocolInterfaces (
@@ -1130,7 +1133,8 @@ static void efi_snp_remove ( struct net_device *netdev ) {
1130 1133
 	}
1131 1134
 
1132 1135
 	/* Uninstall the SNP */
1133
-	efi_snp_hii_uninstall ( snpdev );
1136
+	if ( snpdev->package_list )
1137
+		efi_snp_hii_uninstall ( snpdev );
1134 1138
 	efidev_child_del ( snpdev->efidev, snpdev->handle );
1135 1139
 	list_del ( &snpdev->list );
1136 1140
 	bs->UninstallMultipleProtocolInterfaces (

+ 5
- 2
src/interface/efi/efi_snp_hii.c Voir le fichier

@@ -649,8 +649,10 @@ int efi_snp_hii_install ( struct efi_snp_device *snpdev ) {
649 649
 	int rc;
650 650
 
651 651
 	/* Do nothing if HII database protocol is not supported */
652
-	if ( ! efihii )
653
-		return 0;
652
+	if ( ! efihii ) {
653
+		rc = -ENOTSUP;
654
+		goto err_no_hii;
655
+	}
654 656
 
655 657
 	/* Initialise HII protocol */
656 658
 	memcpy ( &snpdev->hii, &efi_snp_device_hii, sizeof ( snpdev->hii ) );
@@ -697,6 +699,7 @@ int efi_snp_hii_install ( struct efi_snp_device *snpdev ) {
697 699
 	free ( snpdev->package_list );
698 700
 	snpdev->package_list = NULL;
699 701
  err_build_package_list:
702
+ err_no_hii:
700 703
 	return rc;
701 704
 }
702 705
 

Chargement…
Annuler
Enregistrer