* [patch net-next 0/3] dpll: expose lock status error value to user
@ 2024-01-29 14:59 Jiri Pirko
2024-01-29 14:59 ` [patch net-next 1/3] dpll: extend uapi by lock status error attribute Jiri Pirko
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Jiri Pirko @ 2024-01-29 14:59 UTC (permalink / raw)
To: netdev
Cc: kuba, pabeni, davem, edumazet, vadim.fedorenko,
arkadiusz.kubalewski, saeedm, leon, jesse.brandeburg,
anthony.l.nguyen, rrameshbabu
From: Jiri Pirko <jiri@nvidia.com>
Allow to expose lock status errort value over new DPLL generic netlink
attribute. Extend the lock_status_get() op by new argument to get the
value from the driver. Implement this new argument fill-up
in mlx5 driver.
Jiri Pirko (3):
dpll: extend uapi by lock status error attribute
dpll: extend lock_status_get() op by status error and expose to user
net/mlx5: DPLL, Implement lock status error value
Documentation/netlink/specs/dpll.yaml | 39 +++++++++++++++++++
drivers/dpll/dpll_netlink.c | 9 ++++-
drivers/net/ethernet/intel/ice/ice_dpll.c | 1 +
.../net/ethernet/mellanox/mlx5/core/dpll.c | 32 +++++++++++++--
drivers/ptp/ptp_ocp.c | 9 +++--
include/linux/dpll.h | 1 +
include/linux/mlx5/mlx5_ifc.h | 8 ++++
include/uapi/linux/dpll.h | 30 ++++++++++++++
8 files changed, 120 insertions(+), 9 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [patch net-next 1/3] dpll: extend uapi by lock status error attribute
2024-01-29 14:59 [patch net-next 0/3] dpll: expose lock status error value to user Jiri Pirko
@ 2024-01-29 14:59 ` Jiri Pirko
2024-01-29 14:59 ` [patch net-next 2/3] dpll: extend lock_status_get() op by status error and expose to user Jiri Pirko
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Jiri Pirko @ 2024-01-29 14:59 UTC (permalink / raw)
To: netdev
Cc: kuba, pabeni, davem, edumazet, vadim.fedorenko,
arkadiusz.kubalewski, saeedm, leon, jesse.brandeburg,
anthony.l.nguyen, rrameshbabu
From: Jiri Pirko <jiri@nvidia.com>
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>
---
Documentation/netlink/specs/dpll.yaml | 39 +++++++++++++++++++++++++++
include/uapi/linux/dpll.h | 30 +++++++++++++++++++++
2 files changed, 69 insertions(+)
diff --git a/Documentation/netlink/specs/dpll.yaml b/Documentation/netlink/specs/dpll.yaml
index b14aed18065f..1755066d8308 100644
--- a/Documentation/netlink/specs/dpll.yaml
+++ b/Documentation/netlink/specs/dpll.yaml
@@ -51,6 +51,40 @@ definitions:
if dpll lock-state was not DPLL_LOCK_STATUS_LOCKED_HO_ACQ, the
dpll's lock-state shall remain DPLL_LOCK_STATUS_UNLOCKED)
render-max: true
+ -
+ type: enum
+ name: lock-status-error
+ doc: |
+ if previous status change was done due to a failure, this provides
+ information of dpll device lock status error.
+ Valid values for DPLL_A_LOCK_STATUS_ERROR attribute
+ entries:
+ -
+ name: none
+ doc: |
+ dpll device lock status was changed without any error
+ value: 1
+ -
+ name: undefined
+ doc: |
+ dpll device lock status was changed due to undefined error.
+ Driver fills this value up in case it is not able
+ to obtain suitable exact error type.
+ -
+ name: media-down
+ doc: |
+ dpll device lock status was changed because of associated
+ media got down.
+ This may happen for example if dpll device was previously
+ locked on an input pin of type PIN_TYPE_SYNCE_ETH_PORT.
+ -
+ name: fractional-frequency-offset-too-high
+ doc: |
+ the FFO (Fractional Frequency Offset) between the RX and TX
+ symbol rate on the media got too high.
+ This may happen for example if dpll device was previously
+ locked on an input pin of type PIN_TYPE_SYNCE_ETH_PORT.
+ render-max: true
-
type: const
name: temp-divider
@@ -214,6 +248,10 @@ attribute-sets:
name: type
type: u32
enum: type
+ -
+ name: lock-status-error
+ type: u32
+ enum: lock-status-error
-
name: pin
enum-name: dpll_a_pin
@@ -379,6 +417,7 @@ operations:
- mode
- mode-supported
- lock-status
+ - lock-status-error
- temp
- clock-id
- type
diff --git a/include/uapi/linux/dpll.h b/include/uapi/linux/dpll.h
index b4e947f9bfbc..0c13d7f1a1bc 100644
--- a/include/uapi/linux/dpll.h
+++ b/include/uapi/linux/dpll.h
@@ -50,6 +50,35 @@ enum dpll_lock_status {
DPLL_LOCK_STATUS_MAX = (__DPLL_LOCK_STATUS_MAX - 1)
};
+/**
+ * enum dpll_lock_status_error - if previous status change was done due to a
+ * failure, this provides information of dpll device lock status error. Valid
+ * values for DPLL_A_LOCK_STATUS_ERROR attribute
+ * @DPLL_LOCK_STATUS_ERROR_NONE: dpll device lock status was changed without
+ * any error
+ * @DPLL_LOCK_STATUS_ERROR_UNDEFINED: dpll device lock status was changed due
+ * to undefined error. Driver fills this value up in case it is not able to
+ * obtain suitable exact error type.
+ * @DPLL_LOCK_STATUS_ERROR_MEDIA_DOWN: dpll device lock status was changed
+ * because of associated media got down. This may happen for example if dpll
+ * device was previously locked on an input pin of type
+ * PIN_TYPE_SYNCE_ETH_PORT.
+ * @DPLL_LOCK_STATUS_ERROR_FRACTIONAL_FREQUENCY_OFFSET_TOO_HIGH: the FFO
+ * (Fractional Frequency Offset) between the RX and TX symbol rate on the
+ * media got too high. This may happen for example if dpll device was
+ * previously locked on an input pin of type PIN_TYPE_SYNCE_ETH_PORT.
+ */
+enum dpll_lock_status_error {
+ DPLL_LOCK_STATUS_ERROR_NONE = 1,
+ DPLL_LOCK_STATUS_ERROR_UNDEFINED,
+ DPLL_LOCK_STATUS_ERROR_MEDIA_DOWN,
+ DPLL_LOCK_STATUS_ERROR_FRACTIONAL_FREQUENCY_OFFSET_TOO_HIGH,
+
+ /* private: */
+ __DPLL_LOCK_STATUS_ERROR_MAX,
+ DPLL_LOCK_STATUS_ERROR_MAX = (__DPLL_LOCK_STATUS_ERROR_MAX - 1)
+};
+
#define DPLL_TEMP_DIVIDER 1000
/**
@@ -150,6 +179,7 @@ enum dpll_a {
DPLL_A_LOCK_STATUS,
DPLL_A_TEMP,
DPLL_A_TYPE,
+ DPLL_A_LOCK_STATUS_ERROR,
__DPLL_A_MAX,
DPLL_A_MAX = (__DPLL_A_MAX - 1)
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [patch net-next 2/3] dpll: extend lock_status_get() op by status error and expose to user
2024-01-29 14:59 [patch net-next 0/3] dpll: expose lock status error value to user Jiri Pirko
2024-01-29 14:59 ` [patch net-next 1/3] dpll: extend uapi by lock status error attribute Jiri Pirko
@ 2024-01-29 14:59 ` Jiri Pirko
2024-01-30 10:46 ` kernel test robot
2024-01-29 14:59 ` [patch net-next 3/3] net/mlx5: DPLL, Implement lock status error value Jiri Pirko
2024-01-30 10:28 ` [patch net-next 0/3] dpll: expose lock status error value to user Vadim Fedorenko
3 siblings, 1 reply; 7+ messages in thread
From: Jiri Pirko @ 2024-01-29 14:59 UTC (permalink / raw)
To: netdev
Cc: kuba, pabeni, davem, edumazet, vadim.fedorenko,
arkadiusz.kubalewski, saeedm, leon, jesse.brandeburg,
anthony.l.nguyen, rrameshbabu
From: Jiri Pirko <jiri@nvidia.com>
Pass additional argunent status_error over lock_status_get()
so drivers can fill it up. In case they do, expose the value over
previously introduced attribute to user. Do it only in case the
current lock_status is either "unlocked" or "holdover".
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
---
drivers/dpll/dpll_netlink.c | 9 ++++++++-
drivers/net/ethernet/intel/ice/ice_dpll.c | 1 +
drivers/net/ethernet/mellanox/mlx5/core/dpll.c | 9 +++++----
drivers/ptp/ptp_ocp.c | 9 +++++----
include/linux/dpll.h | 1 +
5 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/drivers/dpll/dpll_netlink.c b/drivers/dpll/dpll_netlink.c
index 314bb3775465..cf3313517ae1 100644
--- a/drivers/dpll/dpll_netlink.c
+++ b/drivers/dpll/dpll_netlink.c
@@ -121,14 +121,21 @@ dpll_msg_add_lock_status(struct sk_buff *msg, struct dpll_device *dpll,
struct netlink_ext_ack *extack)
{
const struct dpll_device_ops *ops = dpll_device_ops(dpll);
+ enum dpll_lock_status_error status_error = 0;
enum dpll_lock_status status;
int ret;
- ret = ops->lock_status_get(dpll, dpll_priv(dpll), &status, extack);
+ ret = ops->lock_status_get(dpll, dpll_priv(dpll), &status,
+ &status_error, extack);
if (ret)
return ret;
if (nla_put_u32(msg, DPLL_A_LOCK_STATUS, status))
return -EMSGSIZE;
+ if (status_error &&
+ (status == DPLL_LOCK_STATUS_UNLOCKED ||
+ status == DPLL_LOCK_STATUS_HOLDOVER) &&
+ nla_put_u32(msg, DPLL_A_LOCK_STATUS_ERROR, status_error))
+ return -EMSGSIZE;
return 0;
}
diff --git a/drivers/net/ethernet/intel/ice/ice_dpll.c b/drivers/net/ethernet/intel/ice/ice_dpll.c
index b9c5eced6326..04cafa896e9d 100644
--- a/drivers/net/ethernet/intel/ice/ice_dpll.c
+++ b/drivers/net/ethernet/intel/ice/ice_dpll.c
@@ -500,6 +500,7 @@ ice_dpll_hw_input_prio_set(struct ice_pf *pf, struct ice_dpll *dpll,
static int
ice_dpll_lock_status_get(const struct dpll_device *dpll, void *dpll_priv,
enum dpll_lock_status *status,
+ enum dpll_lock_status_error *status_error,
struct netlink_ext_ack *extack)
{
struct ice_dpll *d = dpll_priv;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/dpll.c b/drivers/net/ethernet/mellanox/mlx5/core/dpll.c
index 18fed2b34fb1..07f43d5c90c6 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/dpll.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/dpll.c
@@ -118,10 +118,11 @@ mlx5_dpll_pin_ffo_get(struct mlx5_dpll_synce_status *synce_status,
return 0;
}
-static int mlx5_dpll_device_lock_status_get(const struct dpll_device *dpll,
- void *priv,
- enum dpll_lock_status *status,
- struct netlink_ext_ack *extack)
+static int
+mlx5_dpll_device_lock_status_get(const struct dpll_device *dpll, void *priv,
+ enum dpll_lock_status *status,
+ enum dpll_lock_status_error *status_error,
+ struct netlink_ext_ack *extack)
{
struct mlx5_dpll_synce_status synce_status;
struct mlx5_dpll *mdpll = priv;
diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index 5f858e426bbd..9507681e0d12 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -4209,10 +4209,11 @@ ptp_ocp_detach(struct ptp_ocp *bp)
device_unregister(&bp->dev);
}
-static int ptp_ocp_dpll_lock_status_get(const struct dpll_device *dpll,
- void *priv,
- enum dpll_lock_status *status,
- struct netlink_ext_ack *extack)
+static int
+ptp_ocp_dpll_lock_status_get(const struct dpll_device *dpll, void *priv,
+ enum dpll_lock_status *status,
+ enum dpll_lock_status_error *status_error,
+ struct netlink_ext_ack *extack)
{
struct ptp_ocp *bp = priv;
diff --git a/include/linux/dpll.h b/include/linux/dpll.h
index 9cf896ea1d41..9cb02ad73d51 100644
--- a/include/linux/dpll.h
+++ b/include/linux/dpll.h
@@ -19,6 +19,7 @@ struct dpll_device_ops {
enum dpll_mode *mode, struct netlink_ext_ack *extack);
int (*lock_status_get)(const struct dpll_device *dpll, void *dpll_priv,
enum dpll_lock_status *status,
+ enum dpll_lock_status_error *status_error,
struct netlink_ext_ack *extack);
int (*temp_get)(const struct dpll_device *dpll, void *dpll_priv,
s32 *temp, struct netlink_ext_ack *extack);
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [patch net-next 3/3] net/mlx5: DPLL, Implement lock status error value
2024-01-29 14:59 [patch net-next 0/3] dpll: expose lock status error value to user Jiri Pirko
2024-01-29 14:59 ` [patch net-next 1/3] dpll: extend uapi by lock status error attribute Jiri Pirko
2024-01-29 14:59 ` [patch net-next 2/3] dpll: extend lock_status_get() op by status error and expose to user Jiri Pirko
@ 2024-01-29 14:59 ` Jiri Pirko
2024-01-30 10:28 ` [patch net-next 0/3] dpll: expose lock status error value to user Vadim Fedorenko
3 siblings, 0 replies; 7+ messages in thread
From: Jiri Pirko @ 2024-01-29 14:59 UTC (permalink / raw)
To: netdev
Cc: kuba, pabeni, davem, edumazet, vadim.fedorenko,
arkadiusz.kubalewski, saeedm, leon, jesse.brandeburg,
anthony.l.nguyen, rrameshbabu
From: Jiri Pirko <jiri@nvidia.com>
Fill-up the lock status error value properly.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
---
.../net/ethernet/mellanox/mlx5/core/dpll.c | 23 +++++++++++++++++++
include/linux/mlx5/mlx5_ifc.h | 8 +++++++
2 files changed, 31 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/dpll.c b/drivers/net/ethernet/mellanox/mlx5/core/dpll.c
index 07f43d5c90c6..4ad3d2d3d4c8 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/dpll.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/dpll.c
@@ -41,6 +41,7 @@ struct mlx5_dpll_synce_status {
enum mlx5_msees_oper_status oper_status;
bool ho_acq;
bool oper_freq_measure;
+ enum mlx5_msees_failure_reason failure_reason;
s32 frequency_diff;
};
@@ -60,6 +61,7 @@ mlx5_dpll_synce_status_get(struct mlx5_core_dev *mdev,
synce_status->oper_status = MLX5_GET(msees_reg, out, oper_status);
synce_status->ho_acq = MLX5_GET(msees_reg, out, ho_acq);
synce_status->oper_freq_measure = MLX5_GET(msees_reg, out, oper_freq_measure);
+ synce_status->failure_reason = MLX5_GET(msees_reg, out, failure_reason);
synce_status->frequency_diff = MLX5_GET(msees_reg, out, frequency_diff);
return 0;
}
@@ -99,6 +101,26 @@ mlx5_dpll_lock_status_get(struct mlx5_dpll_synce_status *synce_status)
}
}
+static enum dpll_lock_status_error
+mlx5_dpll_lock_status_error_get(struct mlx5_dpll_synce_status *synce_status)
+{
+ switch (synce_status->oper_status) {
+ case MLX5_MSEES_OPER_STATUS_FAIL_HOLDOVER:
+ fallthrough;
+ case MLX5_MSEES_OPER_STATUS_FAIL_FREE_RUNNING:
+ switch (synce_status->failure_reason) {
+ case MLX5_MSEES_FAILURE_REASON_PORT_DOWN:
+ return DPLL_LOCK_STATUS_ERROR_MEDIA_DOWN;
+ case MLX5_MSEES_FAILURE_REASON_TOO_HIGH_FREQUENCY_DIFF:
+ return DPLL_LOCK_STATUS_ERROR_FRACTIONAL_FREQUENCY_OFFSET_TOO_HIGH;
+ default:
+ return DPLL_LOCK_STATUS_ERROR_UNDEFINED;
+ }
+ default:
+ return DPLL_LOCK_STATUS_ERROR_NONE;
+ }
+}
+
static enum dpll_pin_state
mlx5_dpll_pin_state_get(struct mlx5_dpll_synce_status *synce_status)
{
@@ -132,6 +154,7 @@ mlx5_dpll_device_lock_status_get(const struct dpll_device *dpll, void *priv,
if (err)
return err;
*status = mlx5_dpll_lock_status_get(&synce_status);
+ *status_error = mlx5_dpll_lock_status_error_get(&synce_status);
return 0;
}
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index c726f90ab752..6c44f107b8ba 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -12705,6 +12705,14 @@ enum mlx5_msees_oper_status {
MLX5_MSEES_OPER_STATUS_FAIL_FREE_RUNNING = 0x5,
};
+enum mlx5_msees_failure_reason {
+ MLX5_MSEES_FAILURE_REASON_UNDEFINED_ERROR = 0x0,
+ MLX5_MSEES_FAILURE_REASON_PORT_DOWN = 0x1,
+ MLX5_MSEES_FAILURE_REASON_TOO_HIGH_FREQUENCY_DIFF = 0x2,
+ MLX5_MSEES_FAILURE_REASON_NET_SYNCHRONIZER_DEVICE_ERROR = 0x3,
+ MLX5_MSEES_FAILURE_REASON_LACK_OF_RESOURCES = 0x4,
+};
+
struct mlx5_ifc_msees_reg_bits {
u8 reserved_at_0[0x8];
u8 local_port[0x8];
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [patch net-next 0/3] dpll: expose lock status error value to user
2024-01-29 14:59 [patch net-next 0/3] dpll: expose lock status error value to user Jiri Pirko
` (2 preceding siblings ...)
2024-01-29 14:59 ` [patch net-next 3/3] net/mlx5: DPLL, Implement lock status error value Jiri Pirko
@ 2024-01-30 10:28 ` Vadim Fedorenko
2024-01-30 11:56 ` Jiri Pirko
3 siblings, 1 reply; 7+ messages in thread
From: Vadim Fedorenko @ 2024-01-30 10:28 UTC (permalink / raw)
To: Jiri Pirko, netdev
Cc: kuba, pabeni, davem, edumazet, arkadiusz.kubalewski, saeedm, leon,
jesse.brandeburg, anthony.l.nguyen, rrameshbabu
On 29/01/2024 14:59, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@nvidia.com>
>
> Allow to expose lock status errort value over new DPLL generic netlink
> attribute. Extend the lock_status_get() op by new argument to get the
> value from the driver. Implement this new argument fill-up
> in mlx5 driver.
The list of errors shows that the focus is on SyncE devices here. What
do you think about extending it to PPS devices too? Like loss of input
frequency, or high phase offset?
But the series overall looks good,
Acked-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
> Jiri Pirko (3):
> dpll: extend uapi by lock status error attribute
> dpll: extend lock_status_get() op by status error and expose to user
> net/mlx5: DPLL, Implement lock status error value
>
> Documentation/netlink/specs/dpll.yaml | 39 +++++++++++++++++++
> drivers/dpll/dpll_netlink.c | 9 ++++-
> drivers/net/ethernet/intel/ice/ice_dpll.c | 1 +
> .../net/ethernet/mellanox/mlx5/core/dpll.c | 32 +++++++++++++--
> drivers/ptp/ptp_ocp.c | 9 +++--
> include/linux/dpll.h | 1 +
> include/linux/mlx5/mlx5_ifc.h | 8 ++++
> include/uapi/linux/dpll.h | 30 ++++++++++++++
> 8 files changed, 120 insertions(+), 9 deletions(-)
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch net-next 2/3] dpll: extend lock_status_get() op by status error and expose to user
2024-01-29 14:59 ` [patch net-next 2/3] dpll: extend lock_status_get() op by status error and expose to user Jiri Pirko
@ 2024-01-30 10:46 ` kernel test robot
0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2024-01-30 10:46 UTC (permalink / raw)
To: Jiri Pirko, netdev
Cc: oe-kbuild-all, kuba, pabeni, davem, edumazet, vadim.fedorenko,
arkadiusz.kubalewski, saeedm, leon, jesse.brandeburg,
anthony.l.nguyen, rrameshbabu
Hi Jiri,
kernel test robot noticed the following build warnings:
[auto build test WARNING on net-next/main]
url: https://github.com/intel-lab-lkp/linux/commits/Jiri-Pirko/dpll-extend-uapi-by-lock-status-error-attribute/20240129-230433
base: net-next/main
patch link: https://lore.kernel.org/r/20240129145916.244193-3-jiri%40resnulli.us
patch subject: [patch net-next 2/3] dpll: extend lock_status_get() op by status error and expose to user
config: openrisc-allyesconfig (https://download.01.org/0day-ci/archive/20240130/202401301831.QfsB6gZg-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240130/202401301831.QfsB6gZg-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401301831.QfsB6gZg-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/net/ethernet/intel/ice/ice_dpll.c:505: warning: Function parameter or struct member 'status_error' not described in 'ice_dpll_lock_status_get'
vim +505 drivers/net/ethernet/intel/ice/ice_dpll.c
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 485
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 486 /**
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 487 * ice_dpll_lock_status_get - get dpll lock status callback
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 488 * @dpll: registered dpll pointer
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 489 * @dpll_priv: private data pointer passed on dpll registration
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 490 * @status: on success holds dpll's lock status
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 491 * @extack: error reporting
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 492 *
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 493 * Dpll subsystem callback, provides dpll's lock status.
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 494 *
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 495 * Context: Acquires pf->dplls.lock
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 496 * Return:
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 497 * * 0 - success
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 498 * * negative - failure
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 499 */
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 500 static int
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 501 ice_dpll_lock_status_get(const struct dpll_device *dpll, void *dpll_priv,
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 502 enum dpll_lock_status *status,
0bbc9a9d0d8c32 Jiri Pirko 2024-01-29 503 enum dpll_lock_status_error *status_error,
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 504 struct netlink_ext_ack *extack)
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 @505 {
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 506 struct ice_dpll *d = dpll_priv;
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 507 struct ice_pf *pf = d->pf;
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 508
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 509 mutex_lock(&pf->dplls.lock);
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 510 *status = d->dpll_state;
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 511 mutex_unlock(&pf->dplls.lock);
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 512
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 513 return 0;
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 514 }
d7999f5ea64bb1 Arkadiusz Kubalewski 2023-09-13 515
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch net-next 0/3] dpll: expose lock status error value to user
2024-01-30 10:28 ` [patch net-next 0/3] dpll: expose lock status error value to user Vadim Fedorenko
@ 2024-01-30 11:56 ` Jiri Pirko
0 siblings, 0 replies; 7+ messages in thread
From: Jiri Pirko @ 2024-01-30 11:56 UTC (permalink / raw)
To: Vadim Fedorenko
Cc: netdev, kuba, pabeni, davem, edumazet, arkadiusz.kubalewski,
saeedm, leon, jesse.brandeburg, anthony.l.nguyen, rrameshbabu
Tue, Jan 30, 2024 at 11:28:56AM CET, vadim.fedorenko@linux.dev wrote:
>On 29/01/2024 14:59, Jiri Pirko wrote:
>> From: Jiri Pirko <jiri@nvidia.com>
>>
>> Allow to expose lock status errort value over new DPLL generic netlink
>> attribute. Extend the lock_status_get() op by new argument to get the
>> value from the driver. Implement this new argument fill-up
>> in mlx5 driver.
>
>The list of errors shows that the focus is on SyncE devices here. What
>do you think about extending it to PPS devices too? Like loss of input
>frequency, or high phase offset?
Sure, lets add it if that suits you. There is certainly room for
extensions of values here :)
>
>But the series overall looks good,
>
>Acked-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
>
>
>> Jiri Pirko (3):
>> dpll: extend uapi by lock status error attribute
>> dpll: extend lock_status_get() op by status error and expose to user
>> net/mlx5: DPLL, Implement lock status error value
>>
>> Documentation/netlink/specs/dpll.yaml | 39 +++++++++++++++++++
>> drivers/dpll/dpll_netlink.c | 9 ++++-
>> drivers/net/ethernet/intel/ice/ice_dpll.c | 1 +
>> .../net/ethernet/mellanox/mlx5/core/dpll.c | 32 +++++++++++++--
>> drivers/ptp/ptp_ocp.c | 9 +++--
>> include/linux/dpll.h | 1 +
>> include/linux/mlx5/mlx5_ifc.h | 8 ++++
>> include/uapi/linux/dpll.h | 30 ++++++++++++++
>> 8 files changed, 120 insertions(+), 9 deletions(-)
>>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-01-30 11:56 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-29 14:59 [patch net-next 0/3] dpll: expose lock status error value to user Jiri Pirko
2024-01-29 14:59 ` [patch net-next 1/3] dpll: extend uapi by lock status error attribute Jiri Pirko
2024-01-29 14:59 ` [patch net-next 2/3] dpll: extend lock_status_get() op by status error and expose to user Jiri Pirko
2024-01-30 10:46 ` kernel test robot
2024-01-29 14:59 ` [patch net-next 3/3] net/mlx5: DPLL, Implement lock status error value Jiri Pirko
2024-01-30 10:28 ` [patch net-next 0/3] dpll: expose lock status error value to user Vadim Fedorenko
2024-01-30 11:56 ` Jiri Pirko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).