@@ -188,6 +188,10 @@ static struct lynx_28g_pll *lynx_28g_pll_get(struct lynx_28g_priv *priv,
188
188
return pll ;
189
189
}
190
190
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 ));
191
195
return NULL ;
192
196
}
193
197
@@ -276,8 +280,12 @@ static void lynx_28g_lane_set_sgmii(struct lynx_28g_lane *lane)
276
280
lynx_28g_lane_rmw (lane , LNaGCR0 , PROTO_SEL_SGMII , PROTO_SEL_MSK );
277
281
lynx_28g_lane_rmw (lane , LNaGCR0 , IF_WIDTH_10_BIT , IF_WIDTH_MSK );
278
282
279
- /* Switch to the PLL that works with this interface type */
283
+ /* Find the PLL that works with this interface type */
280
284
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 */
281
289
lynx_28g_lane_set_pll (lane , pll );
282
290
283
291
/* 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)
312
320
lynx_28g_lane_rmw (lane , LNaGCR0 , PROTO_SEL_XFI , PROTO_SEL_MSK );
313
321
lynx_28g_lane_rmw (lane , LNaGCR0 , IF_WIDTH_20_BIT , IF_WIDTH_MSK );
314
322
315
- /* Switch to the PLL that works with this interface type */
323
+ /* Find the PLL that works with this interface type */
316
324
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 */
317
329
lynx_28g_lane_set_pll (lane , pll );
318
330
319
331
/* Choose the portion of clock net to be used on this lane */
0 commit comments