Commit bfb0c9fc authored by Nathan Lynch's avatar Nathan Lynch Committed by Michael Ellerman
Browse files

powerpc/pseries/dlpar: use rtas_get_sensor()



Instead of making bare calls to get-sensor-state, use
rtas_get_sensor(), which correctly handles busy and extended delay
statuses.

Fixes: ab519a01 ("powerpc/pseries: Kernel DLPAR Infrastructure")
Signed-off-by: default avatarNathan Lynch <nathanl@linux.ibm.com>
Reviewed-by: default avatarLaurent Dufour <ldufour@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210504025329.1713878-1-nathanl@linux.ibm.com
parent 4bfa5ddf
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -289,8 +289,7 @@ int dlpar_acquire_drc(u32 drc_index)
{
	int dr_status, rc;

	rc = rtas_call(rtas_token("get-sensor-state"), 2, 2, &dr_status,
		       DR_ENTITY_SENSE, drc_index);
	rc = rtas_get_sensor(DR_ENTITY_SENSE, drc_index, &dr_status);
	if (rc || dr_status != DR_ENTITY_UNUSABLE)
		return -1;

@@ -311,8 +310,7 @@ int dlpar_release_drc(u32 drc_index)
{
	int dr_status, rc;

	rc = rtas_call(rtas_token("get-sensor-state"), 2, 2, &dr_status,
		       DR_ENTITY_SENSE, drc_index);
	rc = rtas_get_sensor(DR_ENTITY_SENSE, drc_index, &dr_status);
	if (rc || dr_status != DR_ENTITY_PRESENT)
		return -1;

@@ -333,8 +331,7 @@ int dlpar_unisolate_drc(u32 drc_index)
{
	int dr_status, rc;

	rc = rtas_call(rtas_token("get-sensor-state"), 2, 2, &dr_status,
				DR_ENTITY_SENSE, drc_index);
	rc = rtas_get_sensor(DR_ENTITY_SENSE, drc_index, &dr_status);
	if (rc || dr_status != DR_ENTITY_PRESENT)
		return -1;