Skip to content

Commit 9e5dead

Browse files
orospPaolo Abeni
authored andcommitted
ice: add dpll peer notification for paired SMA and U.FL pins
SMA and U.FL pins share physical signal paths in pairs (SMA1/U.FL1 and SMA2/U.FL2). When one pin's state changes via a PCA9575 GPIO write, the paired pin's state also changes, but no notification is sent for the peer pin. Userspace consumers monitoring the peer via dpll netlink subscribe never learn about the update. Add ice_dpll_sw_pin_notify_peer() which sends a change notification for the paired SW pin. Call it from ice_dpll_pin_sma_direction_set(), ice_dpll_sma_pin_state_set(), and ice_dpll_ufl_pin_state_set() after pf->dplls.lock is released. Use __dpll_pin_change_ntf() because dpll_lock is still held by the dpll netlink layer (dpll_pin_pre_doit). Fixes: 2dd5d03 ("ice: redesign dpll sma/u.fl pins control") Signed-off-by: Petr Oros <poros@redhat.com> Tested-by: Alexander Nowlin <alexander.nowlin@intel.com> Reviewed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://patch.msgid.link/20260427-jk-iwl-net-petr-oros-fixes-v1-11-cdcb48303fd8@intel.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 1a41b58 commit 9e5dead

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

drivers/net/ethernet/intel/ice/ice_dpll.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,32 @@ ice_dpll_input_state_get(const struct dpll_pin *pin, void *pin_priv,
11541154
extack, ICE_DPLL_PIN_TYPE_INPUT);
11551155
}
11561156

1157+
/**
1158+
* ice_dpll_sw_pin_notify_peer - notify the paired SW pin after a state change
1159+
* @d: pointer to dplls struct
1160+
* @changed: the SW pin that was explicitly changed (already notified by dpll core)
1161+
*
1162+
* SMA and U.FL pins share physical signal paths in pairs (SMA1/U.FL1 and
1163+
* SMA2/U.FL2). When one pin's routing changes via the PCA9575 GPIO
1164+
* expander, the paired pin's state may also change. Send a change
1165+
* notification for the peer pin so userspace consumers monitoring the
1166+
* peer via dpll netlink learn about the update.
1167+
*
1168+
* Context: Called from dpll_pin_ops callbacks after pf->dplls.lock is
1169+
* released. Uses __dpll_pin_change_ntf() because dpll_lock is
1170+
* still held by the dpll netlink layer.
1171+
*/
1172+
static void ice_dpll_sw_pin_notify_peer(struct ice_dplls *d,
1173+
struct ice_dpll_pin *changed)
1174+
{
1175+
struct ice_dpll_pin *peer;
1176+
1177+
peer = (changed >= d->sma && changed < d->sma + ICE_DPLL_PIN_SW_NUM) ?
1178+
&d->ufl[changed->idx] : &d->sma[changed->idx];
1179+
if (peer->pin)
1180+
__dpll_pin_change_ntf(peer->pin);
1181+
}
1182+
11571183
/**
11581184
* ice_dpll_sma_direction_set - set direction of SMA pin
11591185
* @p: pointer to a pin
@@ -1344,6 +1370,8 @@ ice_dpll_ufl_pin_state_set(const struct dpll_pin *pin, void *pin_priv,
13441370

13451371
unlock:
13461372
mutex_unlock(&pf->dplls.lock);
1373+
if (!ret)
1374+
ice_dpll_sw_pin_notify_peer(&pf->dplls, p);
13471375

13481376
return ret;
13491377
}
@@ -1462,6 +1490,8 @@ ice_dpll_sma_pin_state_set(const struct dpll_pin *pin, void *pin_priv,
14621490

14631491
unlock:
14641492
mutex_unlock(&pf->dplls.lock);
1493+
if (!ret)
1494+
ice_dpll_sw_pin_notify_peer(&pf->dplls, sma);
14651495

14661496
return ret;
14671497
}
@@ -1657,6 +1687,8 @@ ice_dpll_pin_sma_direction_set(const struct dpll_pin *pin, void *pin_priv,
16571687
mutex_lock(&pf->dplls.lock);
16581688
ret = ice_dpll_sma_direction_set(p, direction, extack);
16591689
mutex_unlock(&pf->dplls.lock);
1690+
if (!ret)
1691+
ice_dpll_sw_pin_notify_peer(&pf->dplls, p);
16601692

16611693
return ret;
16621694
}

0 commit comments

Comments
 (0)