Skip to content

Commit 2e810d9

Browse files
committed
dpll: extend uapi by lock status error attribute
JIRA: https://issues.redhat.com/browse/RHEL-59895 Upstream commit(s): commit cf4f0f1 Author: Jiri Pirko <jiri@nvidia.com> Date: Tue Jan 30 13:08:29 2024 +0100 dpll: extend uapi by lock status error attribute If the dpll devices goes to state "unlocked" or "holdover", it may be caused by an error. In that case, allow user to see what the error was. Introduce a new attribute and values it can carry. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Acked-by: Vadim Fedorenko <vadim.fedorenko@linux.dev> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Petr Oros <poros@redhat.com>
1 parent 375ed2d commit 2e810d9

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

Documentation/netlink/specs/dpll.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,40 @@ definitions:
5151
if dpll lock-state was not DPLL_LOCK_STATUS_LOCKED_HO_ACQ, the
5252
dpll's lock-state shall remain DPLL_LOCK_STATUS_UNLOCKED)
5353
render-max: true
54+
-
55+
type: enum
56+
name: lock-status-error
57+
doc: |
58+
if previous status change was done due to a failure, this provides
59+
information of dpll device lock status error.
60+
Valid values for DPLL_A_LOCK_STATUS_ERROR attribute
61+
entries:
62+
-
63+
name: none
64+
doc: |
65+
dpll device lock status was changed without any error
66+
value: 1
67+
-
68+
name: undefined
69+
doc: |
70+
dpll device lock status was changed due to undefined error.
71+
Driver fills this value up in case it is not able
72+
to obtain suitable exact error type.
73+
-
74+
name: media-down
75+
doc: |
76+
dpll device lock status was changed because of associated
77+
media got down.
78+
This may happen for example if dpll device was previously
79+
locked on an input pin of type PIN_TYPE_SYNCE_ETH_PORT.
80+
-
81+
name: fractional-frequency-offset-too-high
82+
doc: |
83+
the FFO (Fractional Frequency Offset) between the RX and TX
84+
symbol rate on the media got too high.
85+
This may happen for example if dpll device was previously
86+
locked on an input pin of type PIN_TYPE_SYNCE_ETH_PORT.
87+
render-max: true
5488
-
5589
type: const
5690
name: temp-divider
@@ -214,6 +248,10 @@ attribute-sets:
214248
name: type
215249
type: u32
216250
enum: type
251+
-
252+
name: lock-status-error
253+
type: u32
254+
enum: lock-status-error
217255
-
218256
name: pin
219257
enum-name: dpll_a_pin
@@ -380,6 +418,7 @@ operations:
380418
- mode
381419
- mode-supported
382420
- lock-status
421+
- lock-status-error
383422
- temp
384423
- clock-id
385424
- type

include/uapi/linux/dpll.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,35 @@ enum dpll_lock_status {
5050
DPLL_LOCK_STATUS_MAX = (__DPLL_LOCK_STATUS_MAX - 1)
5151
};
5252

53+
/**
54+
* enum dpll_lock_status_error - if previous status change was done due to a
55+
* failure, this provides information of dpll device lock status error. Valid
56+
* values for DPLL_A_LOCK_STATUS_ERROR attribute
57+
* @DPLL_LOCK_STATUS_ERROR_NONE: dpll device lock status was changed without
58+
* any error
59+
* @DPLL_LOCK_STATUS_ERROR_UNDEFINED: dpll device lock status was changed due
60+
* to undefined error. Driver fills this value up in case it is not able to
61+
* obtain suitable exact error type.
62+
* @DPLL_LOCK_STATUS_ERROR_MEDIA_DOWN: dpll device lock status was changed
63+
* because of associated media got down. This may happen for example if dpll
64+
* device was previously locked on an input pin of type
65+
* PIN_TYPE_SYNCE_ETH_PORT.
66+
* @DPLL_LOCK_STATUS_ERROR_FRACTIONAL_FREQUENCY_OFFSET_TOO_HIGH: the FFO
67+
* (Fractional Frequency Offset) between the RX and TX symbol rate on the
68+
* media got too high. This may happen for example if dpll device was
69+
* previously locked on an input pin of type PIN_TYPE_SYNCE_ETH_PORT.
70+
*/
71+
enum dpll_lock_status_error {
72+
DPLL_LOCK_STATUS_ERROR_NONE = 1,
73+
DPLL_LOCK_STATUS_ERROR_UNDEFINED,
74+
DPLL_LOCK_STATUS_ERROR_MEDIA_DOWN,
75+
DPLL_LOCK_STATUS_ERROR_FRACTIONAL_FREQUENCY_OFFSET_TOO_HIGH,
76+
77+
/* private: */
78+
__DPLL_LOCK_STATUS_ERROR_MAX,
79+
DPLL_LOCK_STATUS_ERROR_MAX = (__DPLL_LOCK_STATUS_ERROR_MAX - 1)
80+
};
81+
5382
#define DPLL_TEMP_DIVIDER 1000
5483

5584
/**
@@ -150,6 +179,7 @@ enum dpll_a {
150179
DPLL_A_LOCK_STATUS,
151180
DPLL_A_TEMP,
152181
DPLL_A_TYPE,
182+
DPLL_A_LOCK_STATUS_ERROR,
153183

154184
__DPLL_A_MAX,
155185
DPLL_A_MAX = (__DPLL_A_MAX - 1)

0 commit comments

Comments
 (0)