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))
157 * The usage count is prepared to avoid race conditions between the in acpi_aml_used()
216 ret = -EFAULT; in acpi_aml_lock_write()
220 ret = -EAGAIN; in acpi_aml_lock_write()
235 ret = -EFAULT; in acpi_aml_lock_read()
239 ret = -EAGAIN; in acpi_aml_lock_read()
269 p = &crc->buf[crc->head]; in acpi_aml_write_kern()
274 crc->head = (crc->head + n) & (ACPI_AML_BUF_SIZE - 1); in acpi_aml_write_kern()
290 p = &crc->buf[crc->tail]; in acpi_aml_readb_kern()
294 crc->tail = (crc->tail + 1) & (ACPI_AML_BUF_SIZE - 1); in acpi_aml_readb_kern()
300 * acpi_aml_write_log() - Capture debugger output
310 int count = 0, size = 0; in acpi_aml_write_log() local
313 return -ENODEV; in acpi_aml_write_log()
315 count = strlen(msg); in acpi_aml_write_log()
316 while (count > 0) { in acpi_aml_write_log()
318 ret = acpi_aml_write_kern(msg + size, count); in acpi_aml_write_log()
319 if (ret == -EAGAIN) { in acpi_aml_write_log()
323 * We need to retry when the condition in acpi_aml_write_log()
333 count -= ret; in acpi_aml_write_log()
339 * acpi_aml_read_cmd() - Capture debugger input
347 static ssize_t acpi_aml_read_cmd(char *msg, size_t count) in acpi_aml_read_cmd() argument
357 while (count > 0) { in acpi_aml_read_cmd()
363 if (ret == -EAGAIN) { in acpi_aml_read_cmd()
367 * We need to retry when the condition becomes in acpi_aml_read_cmd()
377 count--; in acpi_aml_read_cmd()
383 *(msg + size - 1) = '\0'; in acpi_aml_read_cmd()
407 acpi_aml_io.usages--; in acpi_aml_thread()
418 * acpi_aml_create_thread() - Create AML debugger thread
460 return -EINVAL; in acpi_aml_wait_command_ready()
480 ret = -EBUSY; in acpi_aml_open()
483 if ((file->f_flags & O_ACCMODE) != O_WRONLY) { in acpi_aml_open()
489 ret = -EBUSY; in acpi_aml_open()
501 ret = -ENODEV; in acpi_aml_open()
513 ret = -EINVAL; in acpi_aml_open()
538 acpi_aml_io.users--; in acpi_aml_release()
591 p = &crc->buf[crc->tail]; in acpi_aml_read_user()
594 ret = -EFAULT; in acpi_aml_read_user()
599 crc->tail = (crc->tail + n) & (ACPI_AML_BUF_SIZE - 1); in acpi_aml_read_user()
607 size_t count, loff_t *ppos) in acpi_aml_read() argument
612 if (!count) in acpi_aml_read()
614 if (!access_ok(buf, count)) in acpi_aml_read()
615 return -EFAULT; in acpi_aml_read()
617 while (count > 0) { in acpi_aml_read()
619 ret = acpi_aml_read_user(buf + size, count); in acpi_aml_read()
620 if (ret == -EAGAIN) { in acpi_aml_read()
621 if (file->f_flags & O_NONBLOCK) in acpi_aml_read()
627 * We need to retry when the condition in acpi_aml_read()
641 count -= ret; in acpi_aml_read()
661 p = &crc->buf[crc->head]; in acpi_aml_write_user()
664 ret = -EFAULT; in acpi_aml_write_user()
669 crc->head = (crc->head + n) & (ACPI_AML_BUF_SIZE - 1); in acpi_aml_write_user()
677 size_t count, loff_t *ppos) in acpi_aml_write() argument
682 if (!count) in acpi_aml_write()
684 if (!access_ok(buf, count)) in acpi_aml_write()
685 return -EFAULT; in acpi_aml_write()
687 while (count > 0) { in acpi_aml_write()
689 ret = acpi_aml_write_user(buf + size, count); in acpi_aml_write()
690 if (ret == -EAGAIN) { in acpi_aml_write()
691 if (file->f_flags & O_NONBLOCK) in acpi_aml_write()
697 * We need to retry when the condition in acpi_aml_write()
711 count -= ret; in acpi_aml_write()
734 .poll = acpi_aml_poll,
753 return -ENODEV; in acpi_aml_init()