chreipl: correct fcp reipl sysfs write sequence
chreipl: correct fcp reipl sysfs write sequence

kdump reipl implementation relies on os_info kernel structure
residing in old memory being dumped. os_info contains reipl block, which
is used (if valid) by the kdump kernel for reipl parameters.

The problem is that the reipl block and its checksum inside
os_info is updated only when /sys/firmware/reipl/reipl_type is
written. This sets an offset of a reipl block for "reipl_type" and
re-calculates reipl block checksum. Any further alteration of values
under /sys/firmware/reipl/{reipl_type}/ without subsequent write to
/sys/firmware/reipl/reipl_type lead to incorrect os_info reipl block
checksum. In such a case kdump kernel ignores it and reboots using
default logic.

This change makes sure that all fcp values are written before
reipl_type, to avoid potential problem with incorrect checksum.

Reviewed-by: Heiko Carstens <8dcf0f69152f32f23184f83357a3731522e56b9c@de.ibm.com>
Signed-off-by: Vasily Gorbik <fd6608149f5f589003abf198bcd5ef1b94afa26b@linux.ibm.com>
Signed-off-by: Jan Höppner <96138615ab4af0813785fa10d283f3d37eca3b78@linux.ibm.com>

ibm-s390-tools/s390-tools,ibm-s390-tools/s390-tools,ibm-s390-tools/s390-tools,ibm-s390-tools/s390-tools