Lines Matching +full:suspend +full:- +full:in +full:- +full:wait

1 // SPDX-License-Identifier: GPL-2.0-only
31 #include "papr-hvpipe.h" /* hvpipe_migration_handler() */
51 #define PRRN_SCOPE -2
97 is_platfac = of_node_is_type(dn, "ibm,platform-facilities") || in delete_dt_node()
98 of_node_is_type(pdn, "ibm,platform-facilities"); in delete_dt_node()
102 * The drivers that bind to nodes in the platform-facilities in delete_dt_node()
126 * value is contained in the buffer and we need to call in update_dt_property()
127 * ibm,update-properties again to get the rest of the value. in update_dt_property()
138 char *new_data = kzalloc(new_prop->length + vd, GFP_KERNEL); in update_dt_property()
140 return -ENOMEM; in update_dt_property()
142 memcpy(new_data, new_prop->value, new_prop->length); in update_dt_property()
143 memcpy(new_data + new_prop->length, value, vd); in update_dt_property()
145 kfree(new_prop->value); in update_dt_property()
146 new_prop->value = new_data; in update_dt_property()
147 new_prop->length += vd; in update_dt_property()
151 return -ENOMEM; in update_dt_property()
153 new_prop->name = kstrdup(name, GFP_KERNEL); in update_dt_property()
154 if (!new_prop->name) { in update_dt_property()
156 return -ENOMEM; in update_dt_property()
159 new_prop->length = vd; in update_dt_property()
160 new_prop->value = kzalloc(new_prop->length, GFP_KERNEL); in update_dt_property()
161 if (!new_prop->value) { in update_dt_property()
162 kfree(new_prop->name); in update_dt_property()
164 return -ENOMEM; in update_dt_property()
167 memcpy(new_prop->value, value, vd); in update_dt_property()
193 return -EINVAL; in update_dt_node()
197 return -ENOMEM; in update_dt_node()
200 upwa->phandle = cpu_to_be32(dn->phandle); in update_dt_node()
209 nprops = be32_to_cpu(upwa->nprops); in update_dt_node()
211 /* On the first call to ibm,update-properties for a node the in update_dt_node()
220 nprops--; in update_dt_node()
271 return -ENOENT; in add_dt_node()
275 * necessary counterpart. We also know that a platform-facilities in add_dt_node()
280 if (of_node_is_type(dn, "ibm,platform-facilities")) { in add_dt_node()
308 return -ENOMEM; in pseries_devicetree_update()
390 /* Reinitialise system information for hv-24x7 */ in post_mobility_fixup()
409 ret = -EINVAL; in poll_vasi_state()
412 ret = -EOPNOTSUPP; in poll_vasi_state()
417 ret = -EIO; in poll_vasi_state()
429 * Wait for transition from H_VASI_ENABLED to in wait_for_vasi_session_suspending()
441 ret = -EIO; in wait_for_vasi_session_suspending()
448 * ibm,suspend-me are also unimplemented, we'll recover then. in wait_for_vasi_session_suspending()
450 if (ret == -EOPNOTSUPP) in wait_for_vasi_session_suspending()
464 * Wait for transition from H_VASI_RESUMED to H_VASI_COMPLETED. in wait_for_vasi_session_completed()
472 * which is translate in EINVAL by poll_vasi_state(). in wait_for_vasi_session_completed()
474 if (ret == -EINVAL || (!ret && state == H_VASI_COMPLETED)) { in wait_for_vasi_session_completed()
535 pr_info("calling ibm,suspend-me on CPU %i\n", smp_processor_id()); in do_suspend()
540 * before suspending in order to minimize the possibility of in do_suspend()
541 * programming non-existent entries on the destination. If in do_suspend()
542 * suspend fails, we restore it before returning. On success in do_suspend()
550 pr_err("ibm,suspend-me error: %d\n", status); in do_suspend()
558 * struct pseries_suspend_info - State shared between CPUs for join/suspend.
559 * @counter: Threads are to increment this upon resuming from suspend
563 * @done: False if join/suspend is in progress. True if the operation is
574 atomic_t *counter = &info->counter; in do_join()
586 * All other CPUs are offline or in H_JOIN. This CPU in do_join()
587 * attempts the suspend. in do_join()
593 * The suspend is complete and this cpu has received a in do_join()
599 * the load of info->done. It pairs with the barrier in do_join()
600 * in the wakeup/prod path below. in do_join()
603 if (READ_ONCE(info->done) == false) { in do_join()
613 ret = -EIO; in do_join()
621 WRITE_ONCE(info->done, true); in do_join()
623 * This barrier orders the store to info->done vs subsequent in do_join()
625 * in the H_SUCCESS case above. in do_join()
692 * in Suspending state, it's likely a transient in pseries_suspend()
693 * condition related to some device in the partition in pseries_suspend()
694 * and we can retry in the hope that the cause has in pseries_suspend()
698 * for the suspend and avoid conditions which prevent in pseries_suspend()
699 * the suspend from succeeding. For now, we have this in pseries_suspend()
702 pr_notice("Partition suspend attempt %u of %u error: %d\n", in pseries_suspend()
711 pr_notice("VASI state %lu after failed suspend\n", in pseries_suspend()
715 } else if (vasi_err != -EOPNOTSUPP) { in pseries_suspend()
720 pr_notice("Will retry partition suspend after %u ms\n", in pseries_suspend()
761 * Wait until the memory transfer is complete, so that the user in pseries_migrate_partition()
820 return -ENOMEM; in mobility_sysfs_init()