Browse 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 10 years ago
parent
commit
7cfb502fff
2 changed files with 13 additions and 6 deletions
  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 View File

1053
 	if ( ( rc = efi_snp_hii_install ( snpdev ) ) != 0 ) {
1053
 	if ( ( rc = efi_snp_hii_install ( snpdev ) ) != 0 ) {
1054
 		DBGC ( snpdev, "SNPDEV %p could not install HII: %s\n",
1054
 		DBGC ( snpdev, "SNPDEV %p could not install HII: %s\n",
1055
 		       snpdev, strerror ( rc ) );
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
 	/* Add to list of SNP devices */
1062
 	/* Add to list of SNP devices */
1064
 	       efi_devpath_text ( &snpdev->path ) );
1067
 	       efi_devpath_text ( &snpdev->path ) );
1065
 	return 0;
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
 	efidev_child_del ( efidev, snpdev->handle );
1072
 	efidev_child_del ( efidev, snpdev->handle );
1070
  err_efidev_child_add:
1073
  err_efidev_child_add:
1071
 	bs->UninstallMultipleProtocolInterfaces (
1074
 	bs->UninstallMultipleProtocolInterfaces (
1130
 	}
1133
 	}
1131
 
1134
 
1132
 	/* Uninstall the SNP */
1135
 	/* Uninstall the SNP */
1133
-	efi_snp_hii_uninstall ( snpdev );
1136
+	if ( snpdev->package_list )
1137
+		efi_snp_hii_uninstall ( snpdev );
1134
 	efidev_child_del ( snpdev->efidev, snpdev->handle );
1138
 	efidev_child_del ( snpdev->efidev, snpdev->handle );
1135
 	list_del ( &snpdev->list );
1139
 	list_del ( &snpdev->list );
1136
 	bs->UninstallMultipleProtocolInterfaces (
1140
 	bs->UninstallMultipleProtocolInterfaces (

+ 5
- 2
src/interface/efi/efi_snp_hii.c View File

649
 	int rc;
649
 	int rc;
650
 
650
 
651
 	/* Do nothing if HII database protocol is not supported */
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
 	/* Initialise HII protocol */
657
 	/* Initialise HII protocol */
656
 	memcpy ( &snpdev->hii, &efi_snp_device_hii, sizeof ( snpdev->hii ) );
658
 	memcpy ( &snpdev->hii, &efi_snp_device_hii, sizeof ( snpdev->hii ) );
697
 	free ( snpdev->package_list );
699
 	free ( snpdev->package_list );
698
 	snpdev->package_list = NULL;
700
 	snpdev->package_list = NULL;
699
  err_build_package_list:
701
  err_build_package_list:
702
+ err_no_hii:
700
 	return rc;
703
 	return rc;
701
 }
704
 }
702
 
705
 

Loading…
Cancel
Save