mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 02:01:18 -04:00
ice: dpll: fix rclk pin state get for E810
The refactoring of ice_dpll_rclk_state_on_pin_get() to use
ice_dpll_pin_get_parent_idx() omitted the base_rclk_idx adjustment that was
correctly added in the ice_dpll_rclk_state_on_pin_set() path. This breaks
E810 devices where base_rclk_idx is non-zero, causing the wrong hardware
index to be used for pin state lookup and incorrect recovered clock state
to be reported via the DPLL subsystem. E825C is unaffected as its
base_rclk_idx is 0.
While at it, add bounds check against ICE_DPLL_RCLK_NUM_MAX on hw_idx after
the base_rclk_idx subtraction in both ice_dpll_rclk_state_on_pin_{get,set}()
to prevent out-of-bounds access on the pin state array.
Fixes: ad1df4f2d5 ("ice: dpll: Support E825-C SyncE and dynamic pin discovery")
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20260506-jk-iwl-net-2026-05-04-v2-7-a5ea4dc837a9@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
0ded1f36ba
commit
cce709d8df
@@ -2523,6 +2523,8 @@ ice_dpll_rclk_state_on_pin_set(const struct dpll_pin *pin, void *pin_priv,
|
||||
if (hw_idx < 0)
|
||||
goto unlock;
|
||||
hw_idx -= pf->dplls.base_rclk_idx;
|
||||
if (hw_idx >= ICE_DPLL_RCLK_NUM_MAX)
|
||||
goto unlock;
|
||||
|
||||
if ((enable && p->state[hw_idx] == DPLL_PIN_STATE_CONNECTED) ||
|
||||
(!enable && p->state[hw_idx] == DPLL_PIN_STATE_DISCONNECTED)) {
|
||||
@@ -2586,6 +2588,9 @@ ice_dpll_rclk_state_on_pin_get(const struct dpll_pin *pin, void *pin_priv,
|
||||
hw_idx = ice_dpll_pin_get_parent_idx(p, parent_pin);
|
||||
if (hw_idx < 0)
|
||||
goto unlock;
|
||||
hw_idx -= pf->dplls.base_rclk_idx;
|
||||
if (hw_idx >= ICE_DPLL_RCLK_NUM_MAX)
|
||||
goto unlock;
|
||||
|
||||
ret = ice_dpll_pin_state_update(pf, p, ICE_DPLL_PIN_TYPE_RCLK_INPUT,
|
||||
extack);
|
||||
|
||||
Reference in New Issue
Block a user