Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: ab519a011caa ("powerpc/pseries: Kernel DLPAR Infrastructure")
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210504025329.1713878-1-nathanl@linux.ibm.com

authored by

Nathan Lynch and committed by
Michael Ellerman
bfb0c9fc 4bfa5ddf

+3 -6
+3 -6
arch/powerpc/platforms/pseries/dlpar.c
··· 289 289 { 290 290 int dr_status, rc; 291 291 292 - rc = rtas_call(rtas_token("get-sensor-state"), 2, 2, &dr_status, 293 - DR_ENTITY_SENSE, drc_index); 292 + rc = rtas_get_sensor(DR_ENTITY_SENSE, drc_index, &dr_status); 294 293 if (rc || dr_status != DR_ENTITY_UNUSABLE) 295 294 return -1; 296 295 ··· 310 311 { 311 312 int dr_status, rc; 312 313 313 - rc = rtas_call(rtas_token("get-sensor-state"), 2, 2, &dr_status, 314 - DR_ENTITY_SENSE, drc_index); 314 + rc = rtas_get_sensor(DR_ENTITY_SENSE, drc_index, &dr_status); 315 315 if (rc || dr_status != DR_ENTITY_PRESENT) 316 316 return -1; 317 317 ··· 331 333 { 332 334 int dr_status, rc; 333 335 334 - rc = rtas_call(rtas_token("get-sensor-state"), 2, 2, &dr_status, 335 - DR_ENTITY_SENSE, drc_index); 336 + rc = rtas_get_sensor(DR_ENTITY_SENSE, drc_index, &dr_status); 336 337 if (rc || dr_status != DR_ENTITY_PRESENT) 337 338 return -1; 338 339