ice: dpll: fix phase offset value
Subsystems (2)
PATCH 1/1 ice: dpll: fix phase offset value
Stop dividing the phase_offset value received from firmware, this is fault introduced with the initial implementation.
The phase_offset value received from firmware is in 0.01ps resolution. Dpll subsystem is using the value in 0.001ps, raw value is adjusted before providing it to the user.
--- drivers/net/ethernet/intel/ice/ice_common.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/intel/ice/ice_common.c +1 -3
@@ -5332,7 +5332,6 @@ ice_aq_get_cgu_dpll_status(struct ice_hw *hw, u8 dpll_num, u8 *ref_state, u8 *eec_mode) {struct ice_aqc_get_cgu_dpll_status *cmd; -const s64 nsec_per_psec =1000LL ;struct ice_aq_desc desc;int status;
@@ -5348,8 +5347,7 @@ ice_aq_get_cgu_dpll_status(struct ice_hw *hw, u8 dpll_num, u8 *ref_state, *phase_offset =le32_to_cpu (cmd->phase_offset_h); *phase_offset <<=32 ; *phase_offset +=le32_to_cpu (cmd->phase_offset_l); - *phase_offset =div64_s64 (sign_extend64 (*phase_offset,47 ), - nsec_per_psec); + *phase_offset =sign_extend64 (*phase_offset,47 ); *eec_mode = cmd->eec_mode; }
Signature · 6 lines
2.38.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Dear Arkadiusz,
Thank you for your patch.
Am 14.12.23 um 09:50 schrieb Arkadiusz Kubalewski:
Quoted 2 lines
Stop dividing the
phase_offsetvalue received from firmware, this is fault introduced with the initial implementation.
… firmware. This fault is present since the initial implementation.
Quoted 3 lines
The
phase_offsetvalue received from firmware is in 0.01ps resolution. Dpll subsystem is using the value in 0.001ps, raw value is adjusted before providing it to the user.
What problems does this fault have, and how can it be tested, that it’s fixed?
Kind regards,
Paul
Quoted 22 lines
Fixes 8a3a565ff210 ("ice: add admin commands to access cgu configuration")Fixes 90e1c90750d7 ("ice: dpll: implement phase related callbacks")Reviewed-by Aleksandr Loktionov <[email protected]>Reviewed-by Przemek Kitszel <[email protected]>Signed-off-by Arkadiusz Kubalewski <[email protected]>--- drivers/net/ethernet/intel/ice/ice_common.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/net/ethernet/intel/ice/ice_common.c +0
-1@@ -5332,7 +5332,6 @@ ice_aq_get_cgu_dpll_status(struct ice_hw *hw, u8 dpll_num, u8 *ref_state, u8 *eec_mode) {struct ice_aqc_get_cgu_dpll_status *cmd; -const s64 nsec_per_psec =1000LL ;struct ice_aq_desc desc;int status;
drivers/net/ethernet/intel/ice/ice_common.c ice_aq_get_cgu_dpll_status(struct ice_hw *hw, u8 dpll_num, u8 *ref_state, · line 5353
Quoted 9 lines
drivers/net/ethernet/intel/ice/ice_common.c +1
-2@@ -5348,8 +5347,7 @@ ice_aq_get_cgu_dpll_status(struct ice_hw *hw, u8 dpll_num, u8 *ref_state, *phase_offset =le32_to_cpu (cmd->phase_offset_h); *phase_offset <<=32 ; *phase_offset +=le32_to_cpu (cmd->phase_offset_l); - *phase_offset =div64_s64 (sign_extend64 (*phase_offset,47 ), - nsec_per_psec); + *phase_offset =sign_extend64 (*phase_offset,47 ); *eec_mode = cmd->eec_mode; }
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Quoted 13 lines
From: Intel-wired-lan <[email protected]> On Behalf Of Paul Menzel
Sent: Thursday, December 14, 2023 10:31 AMDear Arkadiusz,
Thank you for your patch.
Am 14.12.23 um 09:50 schrieb Arkadiusz Kubalewski:
Quoted 2 lines
Stop dividing the
phase_offsetvalue received from firmware, this is fault introduced with the initial implementation.
Quoted 9 lines
… firmware. This fault is present since the initial implementation.
Quoted 3 lines
The
phase_offsetvalue received from firmware is in 0.01ps resolution. Dpll subsystem is using the value in 0.001ps, raw value is adjusted before providing it to the user.What problems does this fault have, and how can it be tested, that it’s fixed?
Hi Paul,
Basically the userspace receives value which is lower than it should be. Instead of expected in DPLL subsystem 0.001ps phase offset resolution the user is provided with 1ps resolution.
Quoted 5 lines
Kind regards,
Paul
Thanks for your feedback, I will prepare better commit message and will send the v2.
Thank you!
Arkadiusz
Quoted 25 lines
Quoted 25 lines
Fixes 8a3a565ff210 ("ice: add admin commands to access cguconfiguration")
Fixes 90e1c90750d7 ("ice: dpll: implement phase related callbacks")Reviewed-by Aleksandr Loktionov <[email protected]>Reviewed-by Przemek Kitszel <[email protected]>Signed-off-by Arkadiusz Kubalewski <[email protected]>--- drivers/net/ethernet/intel/ice/ice_common.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/net/ethernet/intel/ice/ice_common.c +0
-1@@ -5332,7 +5332,6 @@ ice_aq_get_cgu_dpll_status(struct ice_hw *hw, u8 dpll_num, u8 *ref_state, u8 *eec_mode) {struct ice_aqc_get_cgu_dpll_status *cmd; -const s64 nsec_per_psec =1000LL ;struct ice_aq_desc desc;int status;
Quoted 15 lines
drivers/net/ethernet/intel/ice/ice_common.c ice_aq_get_cgu_dpll_status(struct ice_hw *hw, u8 · line 5353
Quoted 11 lines
drivers/net/ethernet/intel/ice/ice_common.c +1
-2@@ -5348,8 +5347,7 @@ ice_aq_get_cgu_dpll_status(struct ice_hw *hw, u8 dpll_num, u8 *ref_state, *phase_offset =le32_to_cpu (cmd->phase_offset_h); *phase_offset <<=32 ; *phase_offset +=le32_to_cpu (cmd->phase_offset_l); - *phase_offset =div64_s64 (sign_extend64 (*phase_offset,47 ), - nsec_per_psec); + *phase_offset =sign_extend64 (*phase_offset,47 ); *eec_mode = cmd->eec_mode; }_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan