Lines Matching +full:x +full:- +full:rc
1 // SPDX-License-Identifier: GPL-2.0
48 int rc; in sclp_sync_request_timeout() local
52 return -ENOMEM; in sclp_sync_request_timeout()
54 request->queue_timeout = timeout; in sclp_sync_request_timeout()
55 request->command = cmd; in sclp_sync_request_timeout()
56 request->sccb = sccb; in sclp_sync_request_timeout()
57 request->status = SCLP_REQ_FILLED; in sclp_sync_request_timeout()
58 request->callback = sclp_sync_callback; in sclp_sync_request_timeout()
59 request->callback_data = &completion; in sclp_sync_request_timeout()
63 rc = sclp_add_request(request); in sclp_sync_request_timeout()
64 if (rc) in sclp_sync_request_timeout()
69 if (request->status != SCLP_REQ_DONE) { in sclp_sync_request_timeout()
70 pr_warn("sync request failed (cmd=0x%08x, status=0x%02x)\n", in sclp_sync_request_timeout()
71 cmd, request->status); in sclp_sync_request_timeout()
72 rc = -EIO; in sclp_sync_request_timeout()
76 return rc; in sclp_sync_request_timeout()
88 int rc; in _sclp_get_core_info() local
93 return -EOPNOTSUPP; in _sclp_get_core_info()
97 return -ENOMEM; in _sclp_get_core_info()
98 sccb->header.length = length; in _sclp_get_core_info()
99 sccb->header.control_mask[2] = 0x80; in _sclp_get_core_info()
100 rc = sclp_sync_request_timeout(SCLP_CMDW_READ_CPU_INFO, sccb, in _sclp_get_core_info()
102 if (rc) in _sclp_get_core_info()
104 if (sccb->header.response_code != 0x0010) { in _sclp_get_core_info()
105 pr_warn("readcpuinfo failed (response=0x%04x)\n", in _sclp_get_core_info()
106 sccb->header.response_code); in _sclp_get_core_info()
107 rc = -EIO; in _sclp_get_core_info()
113 return rc; in _sclp_get_core_info()
123 int rc; in do_core_configure() local
126 return -EOPNOTSUPP; in do_core_configure()
133 return -ENOMEM; in do_core_configure()
134 sccb->header.length = sizeof(*sccb); in do_core_configure()
135 rc = sclp_sync_request_timeout(cmd, sccb, SCLP_QUEUE_INTERVAL); in do_core_configure()
136 if (rc) in do_core_configure()
138 switch (sccb->header.response_code) { in do_core_configure()
143 pr_warn("configure cpu failed (cmd=0x%08x, response=0x%04x)\n", in do_core_configure()
144 cmd, sccb->header.response_code); in do_core_configure()
145 rc = -EIO; in do_core_configure()
150 return rc; in do_core_configure()
190 return (unsigned long long) (rn - 1) * sclp.rzm; in rn2addr()
196 int rc; in do_assign_storage() local
200 return -ENOMEM; in do_assign_storage()
201 sccb->header.length = PAGE_SIZE; in do_assign_storage()
202 sccb->rn = rn; in do_assign_storage()
203 rc = sclp_sync_request_timeout(cmd, sccb, SCLP_QUEUE_INTERVAL); in do_assign_storage()
204 if (rc) in do_assign_storage()
206 switch (sccb->header.response_code) { in do_assign_storage()
211 pr_warn("assign storage failed (cmd=0x%08x, response=0x%04x, rn=0x%04x)\n", in do_assign_storage()
212 cmd, sccb->header.response_code, rn); in do_assign_storage()
213 rc = -EIO; in do_assign_storage()
218 return rc; in do_assign_storage()
224 int rc; in sclp_assign_storage() local
226 rc = do_assign_storage(0x000d0001, rn); in sclp_assign_storage()
227 if (rc) in sclp_assign_storage()
228 return rc; in sclp_assign_storage()
250 int rc; in sclp_attach_storage() local
255 return -ENOMEM; in sclp_attach_storage()
256 sccb->header.length = PAGE_SIZE; in sclp_attach_storage()
257 sccb->header.function_code = 0x40; in sclp_attach_storage()
258 rc = sclp_sync_request_timeout(0x00080001 | id << 8, sccb, in sclp_attach_storage()
260 if (rc) in sclp_attach_storage()
262 switch (sccb->header.response_code) { in sclp_attach_storage()
265 for (i = 0; i < sccb->assigned; i++) { in sclp_attach_storage()
266 if (sccb->entries[i]) in sclp_attach_storage()
267 sclp_unassign_storage(sccb->entries[i] >> 16); in sclp_attach_storage()
271 rc = -EIO; in sclp_attach_storage()
276 return rc; in sclp_attach_storage()
284 int rc = 0; in sclp_mem_change_state() local
287 istart = rn2addr(incr->rn); in sclp_mem_change_state()
288 if (start + size - 1 < istart) in sclp_mem_change_state()
290 if (start > istart + sclp.rzm - 1) in sclp_mem_change_state()
293 rc |= sclp_assign_storage(incr->rn); in sclp_mem_change_state()
295 sclp_unassign_storage(incr->rn); in sclp_mem_change_state()
296 if (rc == 0) in sclp_mem_change_state()
297 incr->standby = online ? 0 : 1; in sclp_mem_change_state()
299 return rc ? -EIO : 0; in sclp_mem_change_state()
308 istart = rn2addr(incr->rn); in contains_standby_increment()
309 if (end - 1 < istart) in contains_standby_increment()
311 if (start > istart + sclp.rzm - 1) in contains_standby_increment()
313 if (incr->standby) in contains_standby_increment()
325 int rc = 0; in sclp_mem_notifier() local
328 start = arg->start_pfn << PAGE_SHIFT; in sclp_mem_notifier()
329 size = arg->nr_pages << PAGE_SHIFT; in sclp_mem_notifier()
341 rc = -EPERM; in sclp_mem_notifier()
347 rc = sclp_mem_change_state(start, size, 1); in sclp_mem_notifier()
356 rc = -EINVAL; in sclp_mem_notifier()
360 return rc ? NOTIFY_BAD : NOTIFY_OK; in sclp_mem_notifier()
374 size_align = rounddown(*start + *size, alignment) - start_align; in align_to_block_size()
376 pr_info("Standby memory at 0x%llx (%lluM of %lluM usable)\n", in align_to_block_size()
398 size = ident_map_size - start; in add_memory_merged()
415 if (incr->standby) in sclp_add_standby_memory()
416 add_memory_merged(incr->rn); in sclp_add_standby_memory()
429 new_incr->rn = rn; in insert_increment()
430 new_incr->standby = standby; in insert_increment()
434 if (assigned && incr->rn > rn) in insert_increment()
436 if (!assigned && incr->rn - last_rn > 1) in insert_increment()
438 last_rn = incr->rn; in insert_increment()
439 prev = &incr->list; in insert_increment()
442 new_incr->rn = last_rn + 1; in insert_increment()
443 if (new_incr->rn > sclp.rnmax) { in insert_increment()
447 list_add(&new_incr->list, prev); in insert_increment()
453 int i, id, assigned, rc; in sclp_detect_standby_memory() local
459 rc = -ENOMEM; in sclp_detect_standby_memory()
466 sccb->header.length = PAGE_SIZE; in sclp_detect_standby_memory()
467 rc = sclp_sync_request(SCLP_CMDW_READ_STORAGE_INFO | id << 8, sccb); in sclp_detect_standby_memory()
468 if (rc) in sclp_detect_standby_memory()
470 switch (sccb->header.response_code) { in sclp_detect_standby_memory()
473 for (i = 0; i < sccb->assigned; i++) { in sclp_detect_standby_memory()
474 if (!sccb->entries[i]) in sclp_detect_standby_memory()
477 insert_increment(sccb->entries[i] >> 16, 0, 1); in sclp_detect_standby_memory()
483 for (i = 0; i < sccb->assigned; i++) { in sclp_detect_standby_memory()
484 if (!sccb->entries[i]) in sclp_detect_standby_memory()
487 insert_increment(sccb->entries[i] >> 16, 1, 1); in sclp_detect_standby_memory()
491 rc = -EIO; in sclp_detect_standby_memory()
494 if (!rc) in sclp_detect_standby_memory()
495 sclp_max_storage_id = sccb->max_id; in sclp_detect_standby_memory()
497 if (rc || list_empty(&sclp_mem_list)) in sclp_detect_standby_memory()
499 for (i = 1; i <= sclp.rnmax - assigned; i++) in sclp_detect_standby_memory()
501 rc = register_memory_notifier(&sclp_mem_nb); in sclp_detect_standby_memory()
502 if (rc) in sclp_detect_standby_memory()
507 return rc; in sclp_detect_standby_memory()
531 int rc; in do_chp_configure() local
534 return -EOPNOTSUPP; in do_chp_configure()
538 return -ENOMEM; in do_chp_configure()
539 sccb->header.length = sizeof(*sccb); in do_chp_configure()
540 rc = sclp_sync_request(cmd, sccb); in do_chp_configure()
541 if (rc) in do_chp_configure()
543 switch (sccb->header.response_code) { in do_chp_configure()
550 pr_warn("configure channel-path failed (cmd=0x%08x, response=0x%04x)\n", in do_chp_configure()
551 cmd, sccb->header.response_code); in do_chp_configure()
552 rc = -EIO; in do_chp_configure()
557 return rc; in do_chp_configure()
561 * sclp_chp_configure - perform configure channel-path sclp command
562 * @chpid: channel-path ID
564 * Perform configure channel-path command sclp command for specified chpid.
565 * Return 0 after command successfully finished, non-zero otherwise.
573 * sclp_chp_deconfigure - perform deconfigure channel-path sclp command
574 * @chpid: channel-path ID
576 * Perform deconfigure channel-path command sclp command for specified chpid
577 * and wait for completion. On success return 0. Return non-zero otherwise.
595 * sclp_chp_read_info - perform read channel-path information sclp command
596 * @info: resulting channel-path information data
598 * Perform read channel-path information sclp command and wait for completion.
599 * On success, store channel-path information in @info and return 0. Return
600 * non-zero otherwise.
605 int rc; in sclp_chp_read_info() local
608 return -EOPNOTSUPP; in sclp_chp_read_info()
612 return -ENOMEM; in sclp_chp_read_info()
613 sccb->header.length = sizeof(*sccb); in sclp_chp_read_info()
614 rc = sclp_sync_request(SCLP_CMDW_READ_CHPATH_INFORMATION, sccb); in sclp_chp_read_info()
615 if (rc) in sclp_chp_read_info()
617 if (sccb->header.response_code != 0x0010) { in sclp_chp_read_info()
618 pr_warn("read channel-path info failed (response=0x%04x)\n", in sclp_chp_read_info()
619 sccb->header.response_code); in sclp_chp_read_info()
620 rc = -EIO; in sclp_chp_read_info()
623 memcpy(info->recognized, sccb->recognized, SCLP_CHP_INFO_MASK_SIZE); in sclp_chp_read_info()
624 memcpy(info->standby, sccb->standby, SCLP_CHP_INFO_MASK_SIZE); in sclp_chp_read_info()
625 memcpy(info->configured, sccb->configured, SCLP_CHP_INFO_MASK_SIZE); in sclp_chp_read_info()
628 return rc; in sclp_chp_read_info()