@@ -188,6 +188,10 @@ static struct lynx_28g_pll *lynx_28g_pll_get(struct lynx_28g_priv *priv,
188188 return pll ;
189189 }
190190
191+ /* no pll supports requested mode, either caller forgot to check
192+ * lynx_28g_supports_lane_mode, or this is a bug.
193+ */
194+ dev_WARN_ONCE (priv -> dev , 1 , "no pll for interface %s\n" , phy_modes (intf ));
191195 return NULL ;
192196}
193197
@@ -276,8 +280,12 @@ static void lynx_28g_lane_set_sgmii(struct lynx_28g_lane *lane)
276280 lynx_28g_lane_rmw (lane , LNaGCR0 , PROTO_SEL_SGMII , PROTO_SEL_MSK );
277281 lynx_28g_lane_rmw (lane , LNaGCR0 , IF_WIDTH_10_BIT , IF_WIDTH_MSK );
278282
279- /* Switch to the PLL that works with this interface type */
283+ /* Find the PLL that works with this interface type */
280284 pll = lynx_28g_pll_get (priv , PHY_INTERFACE_MODE_SGMII );
285+ if (unlikely (pll == NULL ))
286+ return ;
287+
288+ /* Switch to the PLL that works with this interface type */
281289 lynx_28g_lane_set_pll (lane , pll );
282290
283291 /* Choose the portion of clock net to be used on this lane */
@@ -312,8 +320,12 @@ static void lynx_28g_lane_set_10gbaser(struct lynx_28g_lane *lane)
312320 lynx_28g_lane_rmw (lane , LNaGCR0 , PROTO_SEL_XFI , PROTO_SEL_MSK );
313321 lynx_28g_lane_rmw (lane , LNaGCR0 , IF_WIDTH_20_BIT , IF_WIDTH_MSK );
314322
315- /* Switch to the PLL that works with this interface type */
323+ /* Find the PLL that works with this interface type */
316324 pll = lynx_28g_pll_get (priv , PHY_INTERFACE_MODE_10GBASER );
325+ if (unlikely (pll == NULL ))
326+ return ;
327+
328+ /* Switch to the PLL that works with this interface type */
317329 lynx_28g_lane_set_pll (lane , pll );
318330
319331 /* Choose the portion of clock net to be used on this lane */
0 commit comments