Lines Matching +full:poll +full:- +full:retry +full:- +full:count

1 // SPDX-License-Identifier: GPL-2.0-only
15 #include <linux/poll.h>
28 (CIRC_CNT((circ)->head, (circ)->tail, ACPI_AML_BUF_SIZE))
30 (CIRC_CNT_TO_END((circ)->head, (circ)->tail, ACPI_AML_BUF_SIZE))
32 (CIRC_SPACE((circ)->head, (circ)->tail, ACPI_AML_BUF_SIZE))
34 (CIRC_SPACE_TO_END((circ)->head, (circ)->tail, ACPI_AML_BUF_SIZE))
150 * The usage count is prepared to avoid race conditions between the in acpi_aml_used()
209 ret = -EFAULT; in acpi_aml_lock_write()
213 ret = -EAGAIN; in acpi_aml_lock_write()
228 ret = -EFAULT; in acpi_aml_lock_read()
232 ret = -EAGAIN; in acpi_aml_lock_read()
262 p = &crc->buf[crc->head]; in acpi_aml_write_kern()
267 crc->head = (crc->head + n) & (ACPI_AML_BUF_SIZE - 1); in acpi_aml_write_kern()
283 p = &crc->buf[crc->tail]; in acpi_aml_readb_kern()
287 crc->tail = (crc->tail + 1) & (ACPI_AML_BUF_SIZE - 1); in acpi_aml_readb_kern()
293 * acpi_aml_write_log() - Capture debugger output
303 int count = 0, size = 0; in acpi_aml_write_log() local
306 return -ENODEV; in acpi_aml_write_log()
308 count = strlen(msg); in acpi_aml_write_log()
309 while (count > 0) { in acpi_aml_write_log()
311 ret = acpi_aml_write_kern(msg + size, count); in acpi_aml_write_log()
312 if (ret == -EAGAIN) { in acpi_aml_write_log()
316 * We need to retry when the condition in acpi_aml_write_log()
326 count -= ret; in acpi_aml_write_log()
332 * acpi_aml_read_cmd() - Capture debugger input
340 static ssize_t acpi_aml_read_cmd(char *msg, size_t count) in acpi_aml_read_cmd() argument
350 while (count > 0) { in acpi_aml_read_cmd()
356 if (ret == -EAGAIN) { in acpi_aml_read_cmd()
360 * We need to retry when the condition becomes in acpi_aml_read_cmd()
370 count--; in acpi_aml_read_cmd()
376 *(msg + size - 1) = '\0'; in acpi_aml_read_cmd()
400 acpi_aml_io.usages--; in acpi_aml_thread()
411 * acpi_aml_create_thread() - Create AML debugger thread
453 return -EINVAL; in acpi_aml_wait_command_ready()
473 ret = -EBUSY; in acpi_aml_open()
476 if ((file->f_flags & O_ACCMODE) != O_WRONLY) { in acpi_aml_open()
482 ret = -EBUSY; in acpi_aml_open()
494 ret = -ENODEV; in acpi_aml_open()
506 ret = -EINVAL; in acpi_aml_open()
531 acpi_aml_io.users--; in acpi_aml_release()
584 p = &crc->buf[crc->tail]; in acpi_aml_read_user()
587 ret = -EFAULT; in acpi_aml_read_user()
592 crc->tail = (crc->tail + n) & (ACPI_AML_BUF_SIZE - 1); in acpi_aml_read_user()
600 size_t count, loff_t *ppos) in acpi_aml_read() argument
605 if (!count) in acpi_aml_read()
607 if (!access_ok(buf, count)) in acpi_aml_read()
608 return -EFAULT; in acpi_aml_read()
610 while (count > 0) { in acpi_aml_read()
612 ret = acpi_aml_read_user(buf + size, count); in acpi_aml_read()
613 if (ret == -EAGAIN) { in acpi_aml_read()
614 if (file->f_flags & O_NONBLOCK) in acpi_aml_read()
620 * We need to retry when the condition in acpi_aml_read()
634 count -= ret; in acpi_aml_read()
654 p = &crc->buf[crc->head]; in acpi_aml_write_user()
657 ret = -EFAULT; in acpi_aml_write_user()
662 crc->head = (crc->head + n) & (ACPI_AML_BUF_SIZE - 1); in acpi_aml_write_user()
670 size_t count, loff_t *ppos) in acpi_aml_write() argument
675 if (!count) in acpi_aml_write()
677 if (!access_ok(buf, count)) in acpi_aml_write()
678 return -EFAULT; in acpi_aml_write()
680 while (count > 0) { in acpi_aml_write()
682 ret = acpi_aml_write_user(buf + size, count); in acpi_aml_write()
683 if (ret == -EAGAIN) { in acpi_aml_write()
684 if (file->f_flags & O_NONBLOCK) in acpi_aml_write()
690 * We need to retry when the condition in acpi_aml_write()
704 count -= ret; in acpi_aml_write()
727 .poll = acpi_aml_poll,
746 return -ENODEV; in acpi_aml_init()