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

powerpc/pseries: Introduce dlpar_unisolate_drc()

Next patch will execute a set-indicator call in hotplug-cpu.c.

Create a dlpar_unisolate_drc() helper to avoid spreading more
rtas_set_indicator() calls outside of dlpar.c.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210416210216.380291-2-danielhb413@gmail.com

authored by

Daniel Henrique Barboza and committed by
Michael Ellerman
0e3b3ff8 864ec4d4

+15
+14
arch/powerpc/platforms/pseries/dlpar.c
··· 329 329 return 0; 330 330 } 331 331 332 + int dlpar_unisolate_drc(u32 drc_index) 333 + { 334 + int dr_status, rc; 335 + 336 + rc = rtas_call(rtas_token("get-sensor-state"), 2, 2, &dr_status, 337 + DR_ENTITY_SENSE, drc_index); 338 + if (rc || dr_status != DR_ENTITY_PRESENT) 339 + return -1; 340 + 341 + rtas_set_indicator(ISOLATION_STATE, drc_index, UNISOLATE); 342 + 343 + return 0; 344 + } 345 + 332 346 int handle_dlpar_errorlog(struct pseries_hp_errorlog *hp_elog) 333 347 { 334 348 int rc;
+1
arch/powerpc/platforms/pseries/pseries.h
··· 52 52 extern int dlpar_detach_node(struct device_node *); 53 53 extern int dlpar_acquire_drc(u32 drc_index); 54 54 extern int dlpar_release_drc(u32 drc_index); 55 + extern int dlpar_unisolate_drc(u32 drc_index); 55 56 56 57 void queue_hotplug_event(struct pseries_hp_errorlog *hp_errlog); 57 58 int handle_dlpar_errorlog(struct pseries_hp_errorlog *hp_errlog);