Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'intel-wired-lan-update-2026-04-27-ice-iavf'

Jacob Keller says:

====================
Intel Wired LAN Update 2026-04-27 (ice, iavf)

Petr Oros from RedHat has accumulated a number of fixes for the Intel ice
and iavf drivers, bundled together in this series.

First, a series of 4 fixes to resolve issues with the iavf driver logic for
handling VLAN filters. This includes keeping VLAN filters while the
interface is brought down, waiting for confirmation on filter deletion
before deleting filters from the driver tracking structures, and handling
the VIRTCHNL_OP_ADD_VLAN for the old v1 VLAN_ADD command.

A fix for a crash in ice_reset_all_vfs(), properly checking for errors when
ice_vf_rebuild_vsi() fails.

A fix for a possible infinite recursion in ice_cfg_tx_topo() that occurs
when trying to apply invalid Tx topology configuration.

A fix to initialize the SMA pins in the DPLL subsystem properly.

A fix to change the SMA and U.FL pin state for paired pins, ensuring that
all flows changing one pin will also update its shared pin appropriately.

A preparatory patch to export __dpll_pin_change_ntf() so that drivers can
notify pin changes while already holding the dpll_lock.

A fix to ensure DPLL notifications are sent for the software-controlled
pins which wrap the physical CGU input/output pins.

A fix to add DPLL notifications for peer pins when changing the SMA or U.FL
pins, ensuring DPLL subsystem is notified about the paired connected pins.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
====================

Link: https://patch.msgid.link/20260427-jk-iwl-net-petr-oros-fixes-v1-0-cdcb48303fd8@intel.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

+207 -102
+10
drivers/dpll/dpll_netlink.c
··· 900 900 return dpll_pin_event_send(DPLL_CMD_PIN_DELETE_NTF, pin); 901 901 } 902 902 903 + /** 904 + * __dpll_pin_change_ntf - notify that the pin has been changed 905 + * @pin: registered pin pointer 906 + * 907 + * Context: caller must hold dpll_lock. Suitable for use inside pin 908 + * callbacks which are already invoked under dpll_lock. 909 + * Return: 0 if succeeds, error code otherwise. 910 + */ 903 911 int __dpll_pin_change_ntf(struct dpll_pin *pin) 904 912 { 913 + lockdep_assert_held(&dpll_lock); 905 914 dpll_pin_notify(pin, DPLL_PIN_CHANGED); 906 915 return dpll_pin_event_send(DPLL_CMD_PIN_CHANGE_NTF, pin); 907 916 } 917 + EXPORT_SYMBOL_GPL(__dpll_pin_change_ntf); 908 918 909 919 /** 910 920 * dpll_pin_change_ntf - notify that the pin has been changed
-2
drivers/dpll/dpll_netlink.h
··· 11 11 int dpll_pin_create_ntf(struct dpll_pin *pin); 12 12 13 13 int dpll_pin_delete_ntf(struct dpll_pin *pin); 14 - 15 - int __dpll_pin_change_ntf(struct dpll_pin *pin);
+4 -5
drivers/net/ethernet/intel/iavf/iavf.h
··· 158 158 enum iavf_vlan_state_t { 159 159 IAVF_VLAN_INVALID, 160 160 IAVF_VLAN_ADD, /* filter needs to be added */ 161 - IAVF_VLAN_IS_NEW, /* filter is new, wait for PF answer */ 162 - IAVF_VLAN_ACTIVE, /* filter is accepted by PF */ 163 - IAVF_VLAN_DISABLE, /* filter needs to be deleted by PF, then marked INACTIVE */ 164 - IAVF_VLAN_INACTIVE, /* filter is inactive, we are in IFF_DOWN */ 165 - IAVF_VLAN_REMOVE, /* filter needs to be removed from list */ 161 + IAVF_VLAN_ADDING, /* ADD sent to PF, waiting for response */ 162 + IAVF_VLAN_ACTIVE, /* PF confirmed, filter is in HW */ 163 + IAVF_VLAN_REMOVE, /* filter queued for DEL from PF */ 164 + IAVF_VLAN_REMOVING, /* DEL sent to PF, waiting for response */ 166 165 }; 167 166 168 167 struct iavf_vlan_filter {
+12 -40
drivers/net/ethernet/intel/iavf/iavf_main.c
··· 757 757 adapter->num_vlan_filters++; 758 758 iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_ADD_VLAN_FILTER); 759 759 } else if (f->state == IAVF_VLAN_REMOVE) { 760 - /* Re-add the filter since we cannot tell whether the 761 - * pending delete has already been processed by the PF. 762 - * A duplicate add is harmless. 763 - */ 760 + /* DEL not yet sent to PF, cancel it */ 761 + f->state = IAVF_VLAN_ACTIVE; 762 + } else if (f->state == IAVF_VLAN_REMOVING) { 763 + /* DEL already sent to PF, re-add after completion */ 764 764 f->state = IAVF_VLAN_ADD; 765 765 iavf_schedule_aq_request(adapter, 766 766 IAVF_FLAG_AQ_ADD_VLAN_FILTER); ··· 791 791 list_del(&f->list); 792 792 kfree(f); 793 793 adapter->num_vlan_filters--; 794 - } else { 794 + } else if (f->state != IAVF_VLAN_REMOVING) { 795 795 f->state = IAVF_VLAN_REMOVE; 796 796 iavf_schedule_aq_request(adapter, 797 797 IAVF_FLAG_AQ_DEL_VLAN_FILTER); 798 798 } 799 + /* If REMOVING, DEL is already sent to PF; completion 800 + * handler will free the filter when PF confirms. 801 + */ 799 802 } 800 803 801 804 spin_unlock_bh(&adapter->mac_vlan_list_lock); 802 805 } 803 806 804 - /** 805 - * iavf_restore_filters 806 - * @adapter: board private structure 807 - * 808 - * Restore existing non MAC filters when VF netdev comes back up 809 - **/ 810 - static void iavf_restore_filters(struct iavf_adapter *adapter) 811 - { 812 - struct iavf_vlan_filter *f; 813 - 814 - /* re-add all VLAN filters */ 815 - spin_lock_bh(&adapter->mac_vlan_list_lock); 816 - 817 - list_for_each_entry(f, &adapter->vlan_filter_list, list) { 818 - if (f->state == IAVF_VLAN_INACTIVE) 819 - f->state = IAVF_VLAN_ADD; 820 - } 821 - 822 - spin_unlock_bh(&adapter->mac_vlan_list_lock); 823 - adapter->aq_required |= IAVF_FLAG_AQ_ADD_VLAN_FILTER; 824 - } 825 807 826 808 /** 827 809 * iavf_get_num_vlans_added - get number of VLANs added ··· 1228 1246 } 1229 1247 1230 1248 /** 1231 - * iavf_clear_mac_vlan_filters - Remove mac and vlan filters not sent to PF 1232 - * yet and mark other to be removed. 1249 + * iavf_clear_mac_filters - Remove MAC filters not sent to PF yet and mark 1250 + * others to be removed. 1233 1251 * @adapter: board private structure 1234 1252 **/ 1235 - static void iavf_clear_mac_vlan_filters(struct iavf_adapter *adapter) 1253 + static void iavf_clear_mac_filters(struct iavf_adapter *adapter) 1236 1254 { 1237 - struct iavf_vlan_filter *vlf, *vlftmp; 1238 1255 struct iavf_mac_filter *f, *ftmp; 1239 1256 1240 1257 spin_lock_bh(&adapter->mac_vlan_list_lock); ··· 1251 1270 f->remove = true; 1252 1271 } 1253 1272 } 1254 - 1255 - /* disable all VLAN filters */ 1256 - list_for_each_entry_safe(vlf, vlftmp, &adapter->vlan_filter_list, 1257 - list) 1258 - vlf->state = IAVF_VLAN_DISABLE; 1259 1273 1260 1274 spin_unlock_bh(&adapter->mac_vlan_list_lock); 1261 1275 } ··· 1347 1371 iavf_napi_disable_all(adapter); 1348 1372 iavf_irq_disable(adapter); 1349 1373 1350 - iavf_clear_mac_vlan_filters(adapter); 1374 + iavf_clear_mac_filters(adapter); 1351 1375 iavf_clear_cloud_filters(adapter); 1352 1376 iavf_clear_fdir_filters(adapter); 1353 1377 iavf_clear_adv_rss_conf(adapter); ··· 1364 1388 */ 1365 1389 if (!list_empty(&adapter->mac_filter_list)) 1366 1390 adapter->aq_required |= IAVF_FLAG_AQ_DEL_MAC_FILTER; 1367 - if (!list_empty(&adapter->vlan_filter_list)) 1368 - adapter->aq_required |= IAVF_FLAG_AQ_DEL_VLAN_FILTER; 1369 1391 if (!list_empty(&adapter->cloud_filter_list)) 1370 1392 adapter->aq_required |= IAVF_FLAG_AQ_DEL_CLOUD_FILTER; 1371 1393 if (!list_empty(&adapter->fdir_list_head)) ··· 4468 4494 iavf_add_filter(adapter, adapter->hw.mac.addr); 4469 4495 spin_unlock_bh(&adapter->mac_vlan_list_lock); 4470 4496 4471 - /* Restore filters that were removed with IFF_DOWN */ 4472 - iavf_restore_filters(adapter); 4473 4497 iavf_restore_fdir_filters(adapter); 4474 4498 4475 4499 iavf_configure(adapter);
+36 -40
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
··· 746 746 747 747 spin_lock_bh(&adapter->mac_vlan_list_lock); 748 748 list_for_each_entry_safe(f, ftmp, &adapter->vlan_filter_list, list) { 749 - if (f->state == IAVF_VLAN_IS_NEW) { 749 + if (f->state == IAVF_VLAN_ADDING) { 750 750 list_del(&f->list); 751 751 kfree(f); 752 752 adapter->num_vlan_filters--; ··· 812 812 if (f->state == IAVF_VLAN_ADD) { 813 813 vvfl->vlan_id[i] = f->vlan.vid; 814 814 i++; 815 - f->state = IAVF_VLAN_IS_NEW; 815 + f->state = IAVF_VLAN_ADDING; 816 816 if (i == count) 817 817 break; 818 818 } ··· 874 874 vlan->tpid = f->vlan.tpid; 875 875 876 876 i++; 877 - f->state = IAVF_VLAN_IS_NEW; 877 + f->state = IAVF_VLAN_ADDING; 878 878 } 879 879 } 880 880 ··· 911 911 spin_lock_bh(&adapter->mac_vlan_list_lock); 912 912 913 913 list_for_each_entry_safe(f, ftmp, &adapter->vlan_filter_list, list) { 914 - /* since VLAN capabilities are not allowed, we dont want to send 915 - * a VLAN delete request because it will most likely fail and 916 - * create unnecessary errors/noise, so just free the VLAN 917 - * filters marked for removal to enable bailing out before 918 - * sending a virtchnl message 919 - */ 920 914 if (f->state == IAVF_VLAN_REMOVE && 921 915 !VLAN_FILTERING_ALLOWED(adapter)) { 922 916 list_del(&f->list); 923 917 kfree(f); 924 918 adapter->num_vlan_filters--; 925 - } else if (f->state == IAVF_VLAN_DISABLE && 926 - !VLAN_FILTERING_ALLOWED(adapter)) { 927 - f->state = IAVF_VLAN_INACTIVE; 928 - } else if (f->state == IAVF_VLAN_REMOVE || 929 - f->state == IAVF_VLAN_DISABLE) { 919 + } else if (f->state == IAVF_VLAN_REMOVE) { 930 920 count++; 931 921 } 932 922 } ··· 948 958 949 959 vvfl->vsi_id = adapter->vsi_res->vsi_id; 950 960 vvfl->num_elements = count; 951 - list_for_each_entry_safe(f, ftmp, &adapter->vlan_filter_list, list) { 952 - if (f->state == IAVF_VLAN_DISABLE) { 961 + list_for_each_entry(f, &adapter->vlan_filter_list, list) { 962 + if (f->state == IAVF_VLAN_REMOVE) { 953 963 vvfl->vlan_id[i] = f->vlan.vid; 954 - f->state = IAVF_VLAN_INACTIVE; 955 - i++; 956 - if (i == count) 957 - break; 958 - } else if (f->state == IAVF_VLAN_REMOVE) { 959 - vvfl->vlan_id[i] = f->vlan.vid; 960 - list_del(&f->list); 961 - kfree(f); 962 - adapter->num_vlan_filters--; 964 + f->state = IAVF_VLAN_REMOVING; 963 965 i++; 964 966 if (i == count) 965 967 break; ··· 988 1006 989 1007 vvfl_v2->vport_id = adapter->vsi_res->vsi_id; 990 1008 vvfl_v2->num_elements = count; 991 - list_for_each_entry_safe(f, ftmp, &adapter->vlan_filter_list, list) { 992 - if (f->state == IAVF_VLAN_DISABLE || 993 - f->state == IAVF_VLAN_REMOVE) { 1009 + list_for_each_entry(f, &adapter->vlan_filter_list, list) { 1010 + if (f->state == IAVF_VLAN_REMOVE) { 994 1011 struct virtchnl_vlan_supported_caps *filtering_support = 995 1012 &adapter->vlan_v2_caps.filtering.filtering_support; 996 1013 struct virtchnl_vlan *vlan; ··· 1003 1022 vlan->tci = f->vlan.vid; 1004 1023 vlan->tpid = f->vlan.tpid; 1005 1024 1006 - if (f->state == IAVF_VLAN_DISABLE) { 1007 - f->state = IAVF_VLAN_INACTIVE; 1008 - } else { 1009 - list_del(&f->list); 1010 - kfree(f); 1011 - adapter->num_vlan_filters--; 1012 - } 1025 + f->state = IAVF_VLAN_REMOVING; 1013 1026 i++; 1014 1027 if (i == count) 1015 1028 break; ··· 2366 2391 ether_addr_copy(adapter->hw.mac.addr, netdev->dev_addr); 2367 2392 wake_up(&adapter->vc_waitqueue); 2368 2393 break; 2369 - case VIRTCHNL_OP_DEL_VLAN: 2370 - dev_err(&adapter->pdev->dev, "Failed to delete VLAN filter, error %s\n", 2371 - iavf_stat_str(&adapter->hw, v_retval)); 2372 - break; 2373 2394 case VIRTCHNL_OP_DEL_ETH_ADDR: 2374 2395 dev_err(&adapter->pdev->dev, "Failed to delete MAC filter, error %s\n", 2375 2396 iavf_stat_str(&adapter->hw, v_retval)); ··· 2876 2905 spin_unlock_bh(&adapter->adv_rss_lock); 2877 2906 } 2878 2907 break; 2908 + case VIRTCHNL_OP_ADD_VLAN: 2879 2909 case VIRTCHNL_OP_ADD_VLAN_V2: { 2880 2910 struct iavf_vlan_filter *f; 2881 2911 2912 + if (v_retval) 2913 + break; 2914 + 2882 2915 spin_lock_bh(&adapter->mac_vlan_list_lock); 2883 2916 list_for_each_entry(f, &adapter->vlan_filter_list, list) { 2884 - if (f->state == IAVF_VLAN_IS_NEW) 2917 + if (f->state == IAVF_VLAN_ADDING) 2885 2918 f->state = IAVF_VLAN_ACTIVE; 2919 + } 2920 + spin_unlock_bh(&adapter->mac_vlan_list_lock); 2921 + } 2922 + break; 2923 + case VIRTCHNL_OP_DEL_VLAN: 2924 + case VIRTCHNL_OP_DEL_VLAN_V2: { 2925 + struct iavf_vlan_filter *f, *ftmp; 2926 + 2927 + spin_lock_bh(&adapter->mac_vlan_list_lock); 2928 + list_for_each_entry_safe(f, ftmp, &adapter->vlan_filter_list, 2929 + list) { 2930 + if (f->state == IAVF_VLAN_REMOVING) { 2931 + if (v_retval) { 2932 + /* PF rejected DEL, keep filter */ 2933 + f->state = IAVF_VLAN_ACTIVE; 2934 + } else { 2935 + list_del(&f->list); 2936 + kfree(f); 2937 + adapter->num_vlan_filters--; 2938 + } 2939 + } 2886 2940 } 2887 2941 spin_unlock_bh(&adapter->mac_vlan_list_lock); 2888 2942 }
+2
drivers/net/ethernet/intel/ice/devlink/devlink.c
··· 1245 1245 return err; 1246 1246 } 1247 1247 1248 + ice_init_dev_hw(pf); 1249 + 1248 1250 /* load MSI-X values */ 1249 1251 ice_set_min_max_msix(pf); 1250 1252
-2
drivers/net/ethernet/intel/ice/ice_common.c
··· 1126 1126 if (status) 1127 1127 goto err_unroll_fltr_mgmt_struct; 1128 1128 1129 - ice_init_dev_hw(hw->back); 1130 - 1131 1129 mutex_init(&hw->tnl_lock); 1132 1130 ice_init_chk_recipe_reuse_support(hw); 1133 1131
+134 -12
drivers/net/ethernet/intel/ice/ice_dpll.c
··· 1155 1155 } 1156 1156 1157 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 + 1183 + /** 1158 1184 * ice_dpll_sma_direction_set - set direction of SMA pin 1159 1185 * @p: pointer to a pin 1160 1186 * @direction: requested direction of the pin ··· 1197 1171 enum dpll_pin_direction direction, 1198 1172 struct netlink_ext_ack *extack) 1199 1173 { 1174 + struct ice_dplls *d = &p->pf->dplls; 1175 + struct ice_dpll_pin *peer; 1200 1176 u8 data; 1201 1177 int ret; 1202 1178 ··· 1217 1189 case ICE_DPLL_PIN_SW_2_IDX: 1218 1190 if (direction == DPLL_PIN_DIRECTION_INPUT) { 1219 1191 data &= ~ICE_SMA2_DIR_EN; 1192 + data |= ICE_SMA2_UFL2_RX_DIS; 1220 1193 } else { 1221 - data &= ~ICE_SMA2_TX_EN; 1194 + data &= ~(ICE_SMA2_TX_EN | ICE_SMA2_UFL2_RX_DIS); 1222 1195 data |= ICE_SMA2_DIR_EN; 1223 1196 } 1224 1197 break; ··· 1231 1202 ret = ice_dpll_pin_state_update(p->pf, p, 1232 1203 ICE_DPLL_PIN_TYPE_SOFTWARE, 1233 1204 extack); 1205 + if (ret) 1206 + return ret; 1207 + 1208 + /* When a direction change activates the paired U.FL pin, enable 1209 + * its backing CGU pin so the pin reports as connected. Without 1210 + * this the U.FL routing is correct but the CGU pin stays disabled 1211 + * and userspace sees the pin as disconnected. Do not disable the 1212 + * backing pin when U.FL becomes inactive because the SMA pin may 1213 + * still be using it. 1214 + */ 1215 + peer = &d->ufl[p->idx]; 1216 + if (peer->active) { 1217 + struct ice_dpll_pin *target; 1218 + enum ice_dpll_pin_type type; 1219 + 1220 + if (peer->output) { 1221 + target = peer->output; 1222 + type = ICE_DPLL_PIN_TYPE_OUTPUT; 1223 + } else { 1224 + target = peer->input; 1225 + type = ICE_DPLL_PIN_TYPE_INPUT; 1226 + } 1227 + ret = ice_dpll_pin_enable(&p->pf->hw, target, 1228 + d->eec.dpll_idx, type, extack); 1229 + if (!ret) 1230 + ret = ice_dpll_pin_state_update(p->pf, target, 1231 + type, extack); 1232 + } 1234 1233 1235 1234 return ret; 1236 1235 } ··· 1310 1253 data &= ~ICE_SMA1_MASK; 1311 1254 enable = true; 1312 1255 } else if (state == DPLL_PIN_STATE_DISCONNECTED) { 1256 + /* Skip if U.FL1 is not active, setting TX_EN 1257 + * while DIR_EN is set would also deactivate 1258 + * the paired SMA1 output. 1259 + */ 1260 + if (data & (ICE_SMA1_DIR_EN | ICE_SMA1_TX_EN)) { 1261 + ret = 0; 1262 + goto unlock; 1263 + } 1313 1264 data |= ICE_SMA1_TX_EN; 1314 1265 enable = false; 1315 1266 } else { ··· 1332 1267 data &= ~ICE_SMA2_UFL2_RX_DIS; 1333 1268 enable = true; 1334 1269 } else if (state == DPLL_PIN_STATE_DISCONNECTED) { 1270 + /* Skip if U.FL2 is not active, setting 1271 + * UFL2_RX_DIS could also disable the paired 1272 + * SMA2 input. 1273 + */ 1274 + if (!(data & ICE_SMA2_DIR_EN) || 1275 + (data & ICE_SMA2_UFL2_RX_DIS)) { 1276 + ret = 0; 1277 + goto unlock; 1278 + } 1335 1279 data |= ICE_SMA2_UFL2_RX_DIS; 1336 1280 enable = false; 1337 1281 } else { ··· 1370 1296 1371 1297 unlock: 1372 1298 mutex_unlock(&pf->dplls.lock); 1299 + if (!ret) 1300 + ice_dpll_sw_pin_notify_peer(&pf->dplls, p); 1373 1301 1374 1302 return ret; 1375 1303 } ··· 1490 1414 1491 1415 unlock: 1492 1416 mutex_unlock(&pf->dplls.lock); 1417 + if (!ret) 1418 + ice_dpll_sw_pin_notify_peer(&pf->dplls, sma); 1493 1419 1494 1420 return ret; 1495 1421 } ··· 1687 1609 mutex_lock(&pf->dplls.lock); 1688 1610 ret = ice_dpll_sma_direction_set(p, direction, extack); 1689 1611 mutex_unlock(&pf->dplls.lock); 1612 + if (!ret) 1613 + ice_dpll_sw_pin_notify_peer(&pf->dplls, p); 1690 1614 1691 1615 return ret; 1692 1616 } ··· 1995 1915 d->active_input == p->input->pin)) 1996 1916 *phase_offset = d->phase_offset * ICE_DPLL_PHASE_OFFSET_FACTOR; 1997 1917 else if (d->phase_offset_monitor_period) 1998 - *phase_offset = p->phase_offset * ICE_DPLL_PHASE_OFFSET_FACTOR; 1918 + *phase_offset = (p->input && 1919 + p->direction == DPLL_PIN_DIRECTION_INPUT ? 1920 + p->input->phase_offset : 1921 + p->phase_offset) * ICE_DPLL_PHASE_OFFSET_FACTOR; 1999 1922 else 2000 1923 *phase_offset = 0; 2001 1924 mutex_unlock(&pf->dplls.lock); ··· 2693 2610 } 2694 2611 2695 2612 /** 2613 + * ice_dpll_pin_ntf - notify pin change including any SW pin wrappers 2614 + * @dplls: pointer to dplls struct 2615 + * @pin: the dpll_pin that changed 2616 + * 2617 + * Send a change notification for @pin and for any registered SMA/U.FL pin 2618 + * whose backing CGU input matches @pin. 2619 + */ 2620 + static void ice_dpll_pin_ntf(struct ice_dplls *dplls, struct dpll_pin *pin) 2621 + { 2622 + dpll_pin_change_ntf(pin); 2623 + for (int i = 0; i < ICE_DPLL_PIN_SW_NUM; i++) { 2624 + if (dplls->sma[i].pin && dplls->sma[i].input && 2625 + dplls->sma[i].input->pin == pin) 2626 + dpll_pin_change_ntf(dplls->sma[i].pin); 2627 + if (dplls->ufl[i].pin && dplls->ufl[i].input && 2628 + dplls->ufl[i].input->pin == pin) 2629 + dpll_pin_change_ntf(dplls->ufl[i].pin); 2630 + } 2631 + } 2632 + 2633 + /** 2696 2634 * ice_dpll_notify_changes - notify dpll subsystem about changes 2697 2635 * @d: pointer do dpll 2698 2636 * ··· 2721 2617 */ 2722 2618 static void ice_dpll_notify_changes(struct ice_dpll *d) 2723 2619 { 2620 + struct ice_dplls *dplls = &d->pf->dplls; 2724 2621 bool pin_notified = false; 2725 2622 2726 2623 if (d->prev_dpll_state != d->dpll_state) { ··· 2730 2625 } 2731 2626 if (d->prev_input != d->active_input) { 2732 2627 if (d->prev_input) 2733 - dpll_pin_change_ntf(d->prev_input); 2628 + ice_dpll_pin_ntf(dplls, d->prev_input); 2734 2629 d->prev_input = d->active_input; 2735 2630 if (d->active_input) { 2736 - dpll_pin_change_ntf(d->active_input); 2631 + ice_dpll_pin_ntf(dplls, d->active_input); 2737 2632 pin_notified = true; 2738 2633 } 2739 2634 } 2740 2635 if (d->prev_phase_offset != d->phase_offset) { 2741 2636 d->prev_phase_offset = d->phase_offset; 2742 2637 if (!pin_notified && d->active_input) 2743 - dpll_pin_change_ntf(d->active_input); 2638 + ice_dpll_pin_ntf(dplls, d->active_input); 2744 2639 } 2745 2640 } 2746 2641 ··· 2769 2664 2770 2665 /** 2771 2666 * ice_dpll_pins_notify_mask - notify dpll subsystem about bulk pin changes 2667 + * @dplls: pointer to dplls struct 2772 2668 * @pins: array of ice_dpll_pin pointers registered within dpll subsystem 2773 2669 * @pin_num: number of pins 2774 2670 * @phase_offset_ntf_mask: bitmask of pin indexes to notify ··· 2779 2673 * 2780 2674 * Context: Must be called while pf->dplls.lock is released. 2781 2675 */ 2782 - static void ice_dpll_pins_notify_mask(struct ice_dpll_pin *pins, 2676 + static void ice_dpll_pins_notify_mask(struct ice_dplls *dplls, 2677 + struct ice_dpll_pin *pins, 2783 2678 u8 pin_num, 2784 2679 u32 phase_offset_ntf_mask) 2785 2680 { 2786 - int i = 0; 2787 - 2788 - for (i = 0; i < pin_num; i++) 2789 - if (phase_offset_ntf_mask & (1 << i)) 2790 - dpll_pin_change_ntf(pins[i].pin); 2681 + for (int i = 0; i < pin_num; i++) 2682 + if (phase_offset_ntf_mask & BIT(i)) 2683 + ice_dpll_pin_ntf(dplls, pins[i].pin); 2791 2684 } 2792 2685 2793 2686 /** ··· 2962 2857 ice_dpll_notify_changes(de); 2963 2858 ice_dpll_notify_changes(dp); 2964 2859 if (phase_offset_ntf) 2965 - ice_dpll_pins_notify_mask(d->inputs, d->num_inputs, 2860 + ice_dpll_pins_notify_mask(d, d->inputs, d->num_inputs, 2966 2861 phase_offset_ntf); 2967 2862 2968 2863 resched: ··· 4119 4014 struct ice_dpll_pin *pin; 4120 4015 u32 phase_adj_max, caps; 4121 4016 int i, ret; 4017 + u8 data; 4122 4018 4123 4019 if (pf->hw.device_id == ICE_DEV_ID_E810C_QSFP) 4124 4020 input_idx_offset = ICE_E810_RCLK_PINS_NUM; ··· 4179 4073 } 4180 4074 ice_dpll_phase_range_set(&pin->prop.phase_range, phase_adj_max); 4181 4075 } 4076 + 4077 + /* Initialize the SMA control register to a known-good default state. 4078 + * Without this write the PCA9575 GPIO expander retains its power-on 4079 + * default (all outputs high) which makes all SW pins appear inactive. 4080 + * Set SMA1 and SMA2 as active inputs, disable U.FL1 output and 4081 + * U.FL2 input. 4082 + */ 4083 + ret = ice_read_sma_ctrl(&pf->hw, &data); 4084 + if (ret) 4085 + return ret; 4086 + data &= ~ICE_ALL_SMA_MASK; 4087 + data |= ICE_SMA1_TX_EN | ICE_SMA2_TX_EN | ICE_SMA2_UFL2_RX_DIS; 4088 + ret = ice_write_sma_ctrl(&pf->hw, data); 4089 + if (ret) 4090 + return ret; 4091 + 4182 4092 ret = ice_dpll_pin_state_update(pf, pin, ICE_DPLL_PIN_TYPE_SOFTWARE, 4183 4093 NULL); 4184 4094 if (ret)
+2
drivers/net/ethernet/intel/ice/ice_main.c
··· 5245 5245 return err; 5246 5246 } 5247 5247 5248 + ice_init_dev_hw(pf); 5249 + 5248 5250 adapter = ice_adapter_get(pdev); 5249 5251 if (IS_ERR(adapter)) { 5250 5252 err = PTR_ERR(adapter);
+6 -1
drivers/net/ethernet/intel/ice/ice_vf_lib.c
··· 804 804 ice_vf_ctrl_invalidate_vsi(vf); 805 805 806 806 ice_vf_pre_vsi_rebuild(vf); 807 - ice_vf_rebuild_vsi(vf); 807 + if (ice_vf_rebuild_vsi(vf)) { 808 + dev_err(dev, "VF %u VSI rebuild failed, leaving VF disabled\n", 809 + vf->vf_id); 810 + mutex_unlock(&vf->cfg_lock); 811 + continue; 812 + } 808 813 ice_vf_post_vsi_rebuild(vf); 809 814 810 815 ice_eswitch_attach_vf(pf, vf);
+1
include/linux/dpll.h
··· 286 286 287 287 int dpll_device_change_ntf(struct dpll_device *dpll); 288 288 289 + int __dpll_pin_change_ntf(struct dpll_pin *pin); 289 290 int dpll_pin_change_ntf(struct dpll_pin *pin); 290 291 291 292 int register_dpll_notifier(struct notifier_block *nb);