@@ -78,6 +78,12 @@ static int validate_enumeration_input(int instance_id, const char *buf)
strscpy(bioscfg_drv.enumeration_data[instance_id].new_value,
buf,
sizeof(bioscfg_drv.enumeration_data[instance_id].new_value));
+ /*
+ * set pending reboot flag depending on
+ * "RequiresPhysicalPresence" value
+ */
+ if (bioscfg_drv.enumeration_data[instance_id].requires_physical_presence)
+ bioscfg_drv.pending_reboot = TRUE;
exit_validate_enum_input:
kfree(options);
@@ -56,7 +56,12 @@ static int validate_integer_input(int instance_id, char *buf)
return -EINVAL;
bioscfg_drv.integer_data[instance_id].new_value = in_val;
-
+ /*
+ * set pending reboot flag depending on
+ * "RequiresPhysicalPresence" value
+ */
+ if (bioscfg_drv.integer_data[instance_id].requires_physical_presence)
+ bioscfg_drv.pending_reboot = TRUE;
return 0;
}
@@ -127,6 +127,12 @@ static int validate_ordered_list_input(int instance_id, const char *buf)
strscpy(bioscfg_drv.ordered_list_data[instance_id].new_value,
buf,
sizeof(bioscfg_drv.ordered_list_data[instance_id].new_value));
+ /*
+ * set pending reboot flag depending on
+ * "RequiresPhysicalPresence" value
+ */
+ if (bioscfg_drv.ordered_list_data[instance_id].requires_physical_presence)
+ bioscfg_drv.pending_reboot = TRUE;
validate_ordered_list_exit:
return ret;
@@ -100,10 +100,17 @@ static ssize_t current_password_store(struct kobject *kobj,
if (id >= 0)
ret = validate_password_input(id, buf_cp);
- if (!ret)
+ if (!ret) {
strscpy(bioscfg_drv.password_data[id].current_password,
buf_cp,
sizeof(bioscfg_drv.password_data[id].current_password));
+ /*
+ * set pending reboot flag depending on
+ * "RequiresPhysicalPresence" value
+ */
+ if (bioscfg_drv.password_data[id].requires_physical_presence)
+ bioscfg_drv.pending_reboot = TRUE;
+ }
exit_current_password:
kfree(buf_cp);
@@ -158,14 +158,29 @@ int update_attribute_value(char *attr_name, char *attr_value)
strscpy(bioscfg_drv.string_data[instance].current_value,
attr_value,
sizeof(bioscfg_drv.string_data[instance].current_value));
+
+ /*
+ * set pending reboot flag depending on
+ * "RequiresPhysicalPresence" value
+ */
+ if (bioscfg_drv.string_data[instance].requires_physical_presence)
+ bioscfg_drv.pending_reboot = TRUE;
goto exit_update_attribute;
}
instance = get_instance_id_for_integer(attr_name);
if (instance >= 0) {
ret = kstrtoint(attr_value, 10, &int_val);
- if (!ret)
+ if (!ret) {
bioscfg_drv.integer_data[instance].current_value = int_val;
+ /*
+ * set pending reboot flag depending on
+ * "RequiresPhysicalPresence" value
+ */
+ if (bioscfg_drv.integer_data[instance].requires_physical_presence)
+ bioscfg_drv.pending_reboot = TRUE;
+ }
+
goto exit_update_attribute;
}
@@ -174,14 +189,29 @@ int update_attribute_value(char *attr_name, char *attr_value)
strscpy(bioscfg_drv.enumeration_data[instance].current_value,
attr_value,
sizeof(bioscfg_drv.enumeration_data[instance].current_value));
+ /*
+ * set pending reboot flag depending on
+ * "RequiresPhysicalPresence" value
+ */
+ if (bioscfg_drv.enumeration_data[instance].requires_physical_presence)
+ bioscfg_drv.pending_reboot = TRUE;
+
goto exit_update_attribute;
}
instance = get_instance_id_for_ordered_list(attr_name);
- if (instance >= 0)
+ if (instance >= 0) {
strscpy(bioscfg_drv.ordered_list_data[instance].current_value,
attr_value,
sizeof(bioscfg_drv.ordered_list_data[instance].current_value));
+ /*
+ * set pending reboot flag depending on
+ * "RequiresPhysicalPresence" value
+ */
+ if (bioscfg_drv.ordered_list_data[instance].requires_physical_presence)
+ bioscfg_drv.pending_reboot = TRUE;
+ }
+
exit_update_attribute:
return instance;
}
There is not a reliable mechanism to programmatically determine which BIOS settings require a reboot to be updated. The latest changes leverages “RequiredPhysicalPresence” reported value to set pending_reboot. Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com> --- Based on the latest platform-drivers-x86.git/for-next --- drivers/platform/x86/hp/enum-attributes.c | 6 ++++ drivers/platform/x86/hp/int-attributes.c | 7 +++- drivers/platform/x86/hp/ordered-attributes.c | 6 ++++ .../platform/x86/hp/passwdobj-attributes.c | 9 ++++- .../platform/x86/hp/sureadmin-attributes.c | 34 +++++++++++++++++-- 5 files changed, 58 insertions(+), 4 deletions(-)