Merge remote-tracking branches 'spi/fix/lock', 'spi/fix/maintainers', 'spi/fix/put...
[cascardo/linux.git] / Documentation / media / uapi / gen-errors.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _gen_errors:
4
5 *******************
6 Generic Error Codes
7 *******************
8
9
10 .. _gen-errors:
11
12 .. flat-table:: Generic error codes
13     :header-rows:  0
14     :stub-columns: 0
15     :widths: 1 16
16
17
18     -  .. row 1
19
20        -  ``EAGAIN`` (aka ``EWOULDBLOCK``)
21
22        -  The ioctl can't be handled because the device is in state where it
23           can't perform it. This could happen for example in case where
24           device is sleeping and ioctl is performed to query statistics. It
25           is also returned when the ioctl would need to wait for an event,
26           but the device was opened in non-blocking mode.
27
28     -  .. row 2
29
30        -  ``EBADF``
31
32        -  The file descriptor is not a valid.
33
34     -  .. row 3
35
36        -  ``EBUSY``
37
38        -  The ioctl can't be handled because the device is busy. This is
39           typically return while device is streaming, and an ioctl tried to
40           change something that would affect the stream, or would require
41           the usage of a hardware resource that was already allocated. The
42           ioctl must not be retried without performing another action to fix
43           the problem first (typically: stop the stream before retrying).
44
45     -  .. row 4
46
47        -  ``EFAULT``
48
49        -  There was a failure while copying data from/to userspace, probably
50           caused by an invalid pointer reference.
51
52     -  .. row 5
53
54        -  ``EINVAL``
55
56        -  One or more of the ioctl parameters are invalid or out of the
57           allowed range. This is a widely used error code. See the
58           individual ioctl requests for specific causes.
59
60     -  .. row 6
61
62        -  ``ENODEV``
63
64        -  Device not found or was removed.
65
66     -  .. row 7
67
68        -  ``ENOMEM``
69
70        -  There's not enough memory to handle the desired operation.
71
72     -  .. row 8
73
74        -  ``ENOTTY``
75
76        -  The ioctl is not supported by the driver, actually meaning that
77           the required functionality is not available, or the file
78           descriptor is not for a media device.
79
80     -  .. row 9
81
82        -  ``ENOSPC``
83
84        -  On USB devices, the stream ioctl's can return this error, meaning
85           that this request would overcommit the usb bandwidth reserved for
86           periodic transfers (up to 80% of the USB bandwidth).
87
88     -  .. row 10
89
90        -  ``EPERM``
91
92        -  Permission denied. Can be returned if the device needs write
93           permission, or some special capabilities is needed (e. g. root)
94
95 .. note::
96
97   #. This list is not exaustive; ioctls may return other error codes.
98      Since errors may have side effects such as a driver reset,
99      applications should abort on unexpected errors, or otherwise
100      assume that the device is in a bad state.
101
102   #. Request-specific error codes are listed in the individual
103      requests descriptions.