[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202505290202.daQ8Q8Xq-lkp@intel.com>
Date: Thu, 29 May 2025 02:37:45 +0800
From: kernel test robot <lkp@...el.com>
To: weishangjuan@...incomputing.com, andrew+netdev@...n.ch,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
mcoquelin.stm32@...il.com, alexandre.torgue@...s.st.com,
vladimir.oltean@....com, rmk+kernel@...linux.org.uk,
yong.liang.choong@...ux.intel.com,
prabhakar.mahadev-lad.rj@...renesas.com, inochiama@...il.com,
jan.petrous@....nxp.com, jszhang@...nel.org, p.zabel@...gutronix.de,
0x1207@...il.com, boon.khai.ng@...era.com,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
ningyu@...incomputing.com, linmin@...incomputing.com,
lizhi2@...incomputing.com,
Shangjuan Wei <weishangjuan@...incomputing.com>
Subject: Re: [PATCH v2 2/2] ethernet: eswin: Add eic7700 ethernet driver
Hi,
kernel test robot noticed the following build warnings:
[auto build test WARNING on robh/for-next]
[also build test WARNING on net-next/main net/main linus/master v6.15 next-20250528]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/weishangjuan-eswincomputing-com/dt-bindings-ethernet-eswin-Document-for-EIC7700-SoC/20250528-121947
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link: https://lore.kernel.org/r/20250528041634.912-1-weishangjuan%40eswincomputing.com
patch subject: [PATCH v2 2/2] ethernet: eswin: Add eic7700 ethernet driver
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20250529/202505290202.daQ8Q8Xq-lkp@intel.com/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250529/202505290202.daQ8Q8Xq-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505290202.daQ8Q8Xq-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/net/ethernet/stmicro/stmmac/dwmac-eic7700.c:210:6: warning: unused variable 'err' [-Wunused-variable]
210 | int err;
| ^~~
>> drivers/net/ethernet/stmicro/stmmac/dwmac-eic7700.c:369:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
369 | if (data->probe)
| ^~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/dwmac-eic7700.c:371:6: note: uninitialized use occurs here
371 | if (ret < 0) {
| ^~~
drivers/net/ethernet/stmicro/stmmac/dwmac-eic7700.c:369:2: note: remove the 'if' if its condition is always true
369 | if (data->probe)
| ^~~~~~~~~~~~~~~~
370 | ret = data->probe(pdev, plat_dat, &stmmac_res);
drivers/net/ethernet/stmicro/stmmac/dwmac-eic7700.c:343:9: note: initialize the variable 'ret' to silence this warning
343 | int ret;
| ^
| = 0
drivers/net/ethernet/stmicro/stmmac/dwmac-eic7700.c:153:12: warning: unused function 'dwc_qos_probe' [-Wunused-function]
153 | static int dwc_qos_probe(struct platform_device *pdev,
| ^~~~~~~~~~~~~
3 warnings generated.
vim +/err +210 drivers/net/ethernet/stmicro/stmmac/dwmac-eic7700.c
196
197 static int eswin_qos_probe(struct platform_device *pdev,
198 struct plat_stmmacenet_data *plat_dat,
199 struct stmmac_resources *stmmac_res)
200 {
201 struct eswin_qos_priv *dwc_priv;
202 u32 hsp_aclk_ctrl_offset;
203 u32 hsp_aclk_ctrl_regset;
204 u32 hsp_cfg_ctrl_offset;
205 u32 eth_axi_lp_ctrl_offset;
206 u32 eth_phy_ctrl_offset;
207 u32 eth_phy_ctrl_regset;
208 struct clk *clk_app;
209 int ret;
> 210 int err;
211
212 dwc_priv = devm_kzalloc(&pdev->dev, sizeof(*dwc_priv), GFP_KERNEL);
213 if (!dwc_priv)
214 return -ENOMEM;
215
216 if (device_property_read_u32(&pdev->dev, "id", &dwc_priv->dev_id))
217 return dev_err_probe(&pdev->dev, -EINVAL,
218 "Can not read device id!\n");
219
220 dwc_priv->dev = &pdev->dev;
221
222 ret = of_property_read_u32_index(pdev->dev.of_node, "eswin,phyaddr", 0,
223 &dwc_priv->phyaddr);
224 if (ret)
225 dev_warn(&pdev->dev, "can't get phyaddr (%d)\n", ret);
226
227 ret = of_property_read_variable_u32_array(pdev->dev.of_node, "eswin,dly_hsp_reg",
228 &dwc_priv->dly_hsp_reg[0], 3, 0);
229 if (ret != 3) {
230 dev_err(&pdev->dev, "can't get delay hsp reg.ret(%d)\n", ret);
231 return ret;
232 }
233
234 ret = of_property_read_variable_u32_array(pdev->dev.of_node, "dly-param-1000m",
235 &dwc_priv->dly_param_1000m[0], 3, 0);
236 if (ret != 3) {
237 dev_err(&pdev->dev, "can't get delay param for 1Gbps mode (%d)\n", ret);
238 return ret;
239 }
240
241 ret = of_property_read_variable_u32_array(pdev->dev.of_node, "dly-param-100m",
242 &dwc_priv->dly_param_100m[0], 3, 0);
243 if (ret != 3) {
244 dev_err(&pdev->dev, "can't get delay param for 100Mbps mode (%d)\n", ret);
245 return ret;
246 }
247
248 ret = of_property_read_variable_u32_array(pdev->dev.of_node, "dly-param-10m",
249 &dwc_priv->dly_param_10m[0], 3, 0);
250 if (ret != 3) {
251 dev_err(&pdev->dev, "can't get delay param for 10Mbps mode (%d)\n", ret);
252 return ret;
253 }
254
255 dwc_priv->crg_regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
256 "eswin,syscrg_csr");
257 if (IS_ERR(dwc_priv->crg_regmap)) {
258 dev_dbg(&pdev->dev, "No syscrg_csr phandle specified\n");
259 return 0;
260 }
261
262 ret = of_property_read_u32_index(pdev->dev.of_node, "eswin,syscrg_csr", 1,
263 &hsp_aclk_ctrl_offset);
264 if (ret)
265 return dev_err_probe(&pdev->dev, ret, "can't get syscrg_csr 1\n");
266
267 regmap_read(dwc_priv->crg_regmap, hsp_aclk_ctrl_offset, &hsp_aclk_ctrl_regset);
268 hsp_aclk_ctrl_regset |= (HSP_ACLK_CLKEN | HSP_ACLK_DIVSOR);
269 regmap_write(dwc_priv->crg_regmap, hsp_aclk_ctrl_offset, hsp_aclk_ctrl_regset);
270
271 ret = of_property_read_u32_index(pdev->dev.of_node, "eswin,syscrg_csr", 2,
272 &hsp_cfg_ctrl_offset);
273 if (ret)
274 return dev_err_probe(&pdev->dev, ret, "can't get syscrg_csr 2\n");
275
276 regmap_write(dwc_priv->crg_regmap, hsp_cfg_ctrl_offset, HSP_CFG_CTRL_REGSET);
277
278 dwc_priv->hsp_regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
279 "eswin,hsp_sp_csr");
280 if (IS_ERR(dwc_priv->hsp_regmap)) {
281 dev_dbg(&pdev->dev, "No hsp_sp_csr phandle specified\n");
282 return 0;
283 }
284
285 ret = of_property_read_u32_index(pdev->dev.of_node, "eswin,hsp_sp_csr", 2,
286 ð_phy_ctrl_offset);
287 if (ret)
288 return dev_err_probe(&pdev->dev, ret, "can't get hsp_sp_csr 2\n");
289
290 regmap_read(dwc_priv->hsp_regmap,
291 eth_phy_ctrl_offset,
292 ð_phy_ctrl_regset);
293 eth_phy_ctrl_regset |= (ETH_TX_CLK_SEL | ETH_PHY_INTF_SELI);
294 regmap_write(dwc_priv->hsp_regmap,
295 eth_phy_ctrl_offset,
296 eth_phy_ctrl_regset);
297
298 ret = of_property_read_u32_index(pdev->dev.of_node, "eswin,hsp_sp_csr", 3,
299 ð_axi_lp_ctrl_offset);
300 if (ret)
301 return dev_err_probe(&pdev->dev, ret,
302 "can't get hsp_sp_csr 3\n");
303
304 regmap_write(dwc_priv->hsp_regmap,
305 eth_axi_lp_ctrl_offset,
306 ETH_CSYSREQ_VAL);
307
308 clk_app = devm_clk_get_enabled(&pdev->dev, "app");
309 if (IS_ERR(clk_app))
310 return dev_err_probe(&pdev->dev, PTR_ERR(clk_app),
311 "error getting app clock\n");
312
313 plat_dat->clk_tx_i = devm_clk_get_enabled(&pdev->dev, "tx");
314 if (IS_ERR(plat_dat->clk_tx_i))
315 return dev_err_probe(&pdev->dev, PTR_ERR(plat_dat->clk_tx_i),
316 "error getting tx clock\n");
317
318 plat_dat->fix_mac_speed = eswin_qos_fix_speed;
319 plat_dat->set_clk_tx_rate = stmmac_set_clk_tx_rate;
320 plat_dat->bsp_priv = dwc_priv;
321 plat_dat->phy_addr = PHY_ADDR;
322
323 return 0;
324 }
325
326 struct dwc_eth_dwmac_data {
327 int (*probe)(struct platform_device *pdev,
328 struct plat_stmmacenet_data *plat_dat,
329 struct stmmac_resources *res);
330 const char *stmmac_clk_name;
331 };
332
333 static const struct dwc_eth_dwmac_data eswin_qos_data = {
334 .probe = eswin_qos_probe,
335 .stmmac_clk_name = "stmmaceth",
336 };
337
338 static int dwc_eth_dwmac_probe(struct platform_device *pdev)
339 {
340 const struct dwc_eth_dwmac_data *data;
341 struct plat_stmmacenet_data *plat_dat;
342 struct stmmac_resources stmmac_res;
343 int ret;
344
345 data = device_get_match_data(&pdev->dev);
346
347 memset(&stmmac_res, 0, sizeof(struct stmmac_resources));
348
349 /**
350 * Since stmmac_platform supports name IRQ only, basic platform
351 * resource initialization is done in the glue logic.
352 */
353 stmmac_res.irq = platform_get_irq(pdev, 0);
354 if (stmmac_res.irq < 0)
355 return stmmac_res.irq;
356 stmmac_res.wol_irq = stmmac_res.irq;
357
358 stmmac_res.addr = devm_platform_ioremap_resource(pdev, 0);
359 if (IS_ERR(stmmac_res.addr))
360 return PTR_ERR(stmmac_res.addr);
361
362 plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
363 if (IS_ERR(plat_dat))
364 return PTR_ERR(plat_dat);
365
366 plat_dat->stmmac_clk = dwc_eth_find_clk(plat_dat,
367 data->stmmac_clk_name);
368
> 369 if (data->probe)
370 ret = data->probe(pdev, plat_dat, &stmmac_res);
371 if (ret < 0) {
372 return dev_err_probe(&pdev->dev, ret,
373 "failed to probe subdriver\n");
374 }
375
376 ret = dwc_eth_dwmac_config_dt(pdev, plat_dat);
377 if (ret)
378 return dev_err_probe(&pdev->dev, ret,
379 "Failed to config dt\n");
380
381 ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
382 if (ret)
383 return dev_err_probe(&pdev->dev, ret,
384 "Failed to driver probe\n");
385
386 return ret;
387 }
388
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists