From: kernel test robot <lkp@intel.com>
To: Sean Anderson <sean.anderson@seco.com>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Madalin Bucur <madalin.bucur@nxp.com>,
netdev@vger.kernel.org
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Paolo Abeni <pabeni@redhat.com>,
Russell King <linux@armlinux.org.uk>,
Eric Dumazet <edumazet@google.com>,
Sean Anderson <sean.anderson@seco.com>
Subject: Re: [PATCH net-next 18/28] net: fman: Map the base address once
Date: Sat, 18 Jun 2022 10:01:06 +0800 [thread overview]
Message-ID: <202206180959.mgYg6khw-lkp@intel.com> (raw)
In-Reply-To: <20220617203312.3799646-19-sean.anderson@seco.com>
Hi Sean,
I love your patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Sean-Anderson/net-dpaa-Convert-to-phylink/20220618-044003
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 4875d94c69d5a4836c4225b51429d277c297aae8
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220618/202206180959.mgYg6khw-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 11.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/91ca730be8451e814e919382364039413db7e5bb
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Sean-Anderson/net-dpaa-Convert-to-phylink/20220618-044003
git checkout 91ca730be8451e814e919382364039413db7e5bb
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=arc SHELL=/bin/bash drivers/net/ethernet/freescale/fman/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/net/ethernet/freescale/fman/mac.c: In function 'mac_exception':
drivers/net/ethernet/freescale/fman/mac.c:48:34: warning: variable 'priv' set but not used [-Wunused-but-set-variable]
48 | struct mac_priv_s *priv;
| ^~~~
drivers/net/ethernet/freescale/fman/mac.c: In function 'mac_probe':
>> drivers/net/ethernet/freescale/fman/mac.c:387:30: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
387 | mac_dev->vaddr_end = (void *)res->end;
| ^
vim +387 drivers/net/ethernet/freescale/fman/mac.c
297
298 static int mac_probe(struct platform_device *_of_dev)
299 {
300 int err, i, nph;
301 int (*init)(struct mac_device *mac_dev, struct device_node *mac_node);
302 struct device *dev;
303 struct device_node *mac_node, *dev_node;
304 struct mac_device *mac_dev;
305 struct platform_device *of_dev;
306 struct resource *res;
307 struct mac_priv_s *priv;
308 u32 val;
309 u8 fman_id;
310 phy_interface_t phy_if;
311
312 dev = &_of_dev->dev;
313 mac_node = dev->of_node;
314 init = of_device_get_match_data(dev);
315
316 mac_dev = devm_kzalloc(dev, sizeof(*mac_dev), GFP_KERNEL);
317 if (!mac_dev) {
318 err = -ENOMEM;
319 goto _return;
320 }
321 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
322 if (!priv) {
323 err = -ENOMEM;
324 goto _return;
325 }
326
327 /* Save private information */
328 mac_dev->priv = priv;
329 mac_dev->dev = dev;
330
331 INIT_LIST_HEAD(&priv->mc_addr_list);
332
333 /* Get the FM node */
334 dev_node = of_get_parent(mac_node);
335 if (!dev_node) {
336 dev_err(dev, "of_get_parent(%pOF) failed\n",
337 mac_node);
338 err = -EINVAL;
339 goto _return_of_node_put;
340 }
341
342 of_dev = of_find_device_by_node(dev_node);
343 if (!of_dev) {
344 dev_err(dev, "of_find_device_by_node(%pOF) failed\n", dev_node);
345 err = -EINVAL;
346 goto _return_of_node_put;
347 }
348
349 /* Get the FMan cell-index */
350 err = of_property_read_u32(dev_node, "cell-index", &val);
351 if (err) {
352 dev_err(dev, "failed to read cell-index for %pOF\n", dev_node);
353 err = -EINVAL;
354 goto _return_of_node_put;
355 }
356 /* cell-index 0 => FMan id 1 */
357 fman_id = (u8)(val + 1);
358
359 priv->fman = fman_bind(&of_dev->dev);
360 if (!priv->fman) {
361 dev_err(dev, "fman_bind(%pOF) failed\n", dev_node);
362 err = -ENODEV;
363 goto _return_of_node_put;
364 }
365
366 of_node_put(dev_node);
367
368 /* Get the address of the memory mapped registers */
369 res = platform_get_mem_or_io(_of_dev, 0);
370 if (!res) {
371 dev_err(dev, "could not get registers\n");
372 return -EINVAL;
373 }
374
375 err = devm_request_resource(dev, fman_get_mem_region(priv->fman), res);
376 if (err) {
377 dev_err_probe(dev, err, "could not request resource\n");
378 goto _return_of_node_put;
379 }
380
381 mac_dev->vaddr = devm_ioremap(dev, res->start, resource_size(res));
382 if (!mac_dev->vaddr) {
383 dev_err(dev, "devm_ioremap() failed\n");
384 err = -EIO;
385 goto _return_of_node_put;
386 }
> 387 mac_dev->vaddr_end = (void *)res->end;
388
389 if (!of_device_is_available(mac_node)) {
390 err = -ENODEV;
391 goto _return_of_node_put;
392 }
393
394 /* Get the cell-index */
395 err = of_property_read_u32(mac_node, "cell-index", &val);
396 if (err) {
397 dev_err(dev, "failed to read cell-index for %pOF\n", mac_node);
398 err = -EINVAL;
399 goto _return_of_node_put;
400 }
401 priv->cell_index = (u8)val;
402
403 /* Get the MAC address */
404 err = of_get_mac_address(mac_node, mac_dev->addr);
405 if (err)
406 dev_warn(dev, "of_get_mac_address(%pOF) failed\n", mac_node);
407
408 /* Get the port handles */
409 nph = of_count_phandle_with_args(mac_node, "fsl,fman-ports", NULL);
410 if (unlikely(nph < 0)) {
411 dev_err(dev, "of_count_phandle_with_args(%pOF, fsl,fman-ports) failed\n",
412 mac_node);
413 err = nph;
414 goto _return_of_node_put;
415 }
416
417 if (nph != ARRAY_SIZE(mac_dev->port)) {
418 dev_err(dev, "Not supported number of fman-ports handles of mac node %pOF from device tree\n",
419 mac_node);
420 err = -EINVAL;
421 goto _return_of_node_put;
422 }
423
424 for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) {
425 /* Find the port node */
426 dev_node = of_parse_phandle(mac_node, "fsl,fman-ports", i);
427 if (!dev_node) {
428 dev_err(dev, "of_parse_phandle(%pOF, fsl,fman-ports) failed\n",
429 mac_node);
430 err = -EINVAL;
431 goto _return_of_node_put;
432 }
433
434 of_dev = of_find_device_by_node(dev_node);
435 if (!of_dev) {
436 dev_err(dev, "of_find_device_by_node(%pOF) failed\n",
437 dev_node);
438 err = -EINVAL;
439 goto _return_of_node_put;
440 }
441
442 mac_dev->port[i] = fman_port_bind(&of_dev->dev);
443 if (!mac_dev->port[i]) {
444 dev_err(dev, "dev_get_drvdata(%pOF) failed\n",
445 dev_node);
446 err = -EINVAL;
447 goto _return_of_node_put;
448 }
449 of_node_put(dev_node);
450 }
451
452 /* Get the PHY connection type */
453 err = of_get_phy_mode(mac_node, &phy_if);
454 if (err) {
455 dev_warn(dev,
456 "of_get_phy_mode() for %pOF failed. Defaulting to SGMII\n",
457 mac_node);
458 phy_if = PHY_INTERFACE_MODE_SGMII;
459 }
460 mac_dev->phy_if = phy_if;
461
462 priv->speed = phy2speed[mac_dev->phy_if];
463 priv->max_speed = priv->speed;
464 mac_dev->if_support = DTSEC_SUPPORTED;
465 /* We don't support half-duplex in SGMII mode */
466 if (mac_dev->phy_if == PHY_INTERFACE_MODE_SGMII)
467 mac_dev->if_support &= ~(SUPPORTED_10baseT_Half |
468 SUPPORTED_100baseT_Half);
469
470 /* Gigabit support (no half-duplex) */
471 if (priv->max_speed == 1000)
472 mac_dev->if_support |= SUPPORTED_1000baseT_Full;
473
474 /* The 10G interface only supports one mode */
475 if (mac_dev->phy_if == PHY_INTERFACE_MODE_XGMII)
476 mac_dev->if_support = SUPPORTED_10000baseT_Full;
477
478 /* Get the rest of the PHY information */
479 mac_dev->phy_node = of_parse_phandle(mac_node, "phy-handle", 0);
480
481 err = init(mac_dev, mac_node);
482 if (err < 0) {
483 dev_err(dev, "mac_dev->init() = %d\n", err);
484 of_node_put(mac_dev->phy_node);
485 goto _return_of_node_put;
486 }
487
488 /* pause frame autonegotiation enabled */
489 mac_dev->autoneg_pause = true;
490
491 /* By intializing the values to false, force FMD to enable PAUSE frames
492 * on RX and TX
493 */
494 mac_dev->rx_pause_req = true;
495 mac_dev->tx_pause_req = true;
496 mac_dev->rx_pause_active = false;
497 mac_dev->tx_pause_active = false;
498 err = fman_set_mac_active_pause(mac_dev, true, true);
499 if (err < 0)
500 dev_err(dev, "fman_set_mac_active_pause() = %d\n", err);
501
502 if (!is_zero_ether_addr(mac_dev->addr))
503 dev_info(dev, "FMan MAC address: %pM\n", mac_dev->addr);
504
505 priv->eth_dev = dpaa_eth_add_device(fman_id, mac_dev);
506 if (IS_ERR(priv->eth_dev)) {
507 dev_err(dev, "failed to add Ethernet platform device for MAC %d\n",
508 priv->cell_index);
509 priv->eth_dev = NULL;
510 }
511
512 goto _return;
513
514 _return_of_node_put:
515 of_node_put(dev_node);
516 _return:
517 return err;
518 }
519
--
0-DAY CI Kernel Test Service
https://01.org/lkp
next prev parent reply other threads:[~2022-06-18 2:02 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-17 20:32 [PATCH net-next 00/28] [RFC] net: dpaa: Convert to phylink Sean Anderson
2022-06-17 20:32 ` [PATCH net-next 01/28] dt-bindings: phy: Add QorIQ SerDes binding Sean Anderson
2022-06-17 23:27 ` Rob Herring
2022-06-18 1:15 ` Krzysztof Kozlowski
2022-06-18 3:38 ` Sean Anderson
2022-06-19 11:24 ` Krzysztof Kozlowski
2022-06-19 15:53 ` Sean Anderson
2022-06-20 10:54 ` Krzysztof Kozlowski
2022-06-20 17:19 ` Sean Anderson
2022-06-20 18:21 ` Krzysztof Kozlowski
2022-06-20 18:51 ` Sean Anderson
2022-06-21 7:12 ` Krzysztof Kozlowski
2022-06-17 20:32 ` [PATCH net-next 02/28] dt-bindings: net: fman: Add additional interface properties Sean Anderson
2022-06-18 1:16 ` Krzysztof Kozlowski
2022-06-18 15:55 ` Sean Anderson
2022-06-19 10:33 ` Krzysztof Kozlowski
2022-06-27 23:05 ` Rob Herring
2022-06-17 20:32 ` [PATCH net-next 03/28] phy: fsl: Add QorIQ SerDes driver Sean Anderson
2022-06-18 3:02 ` kernel test robot
[not found] ` <GV1PR04MB905598703F5E9A0989662EFDE0AE9@GV1PR04MB9055.eurprd04.prod.outlook.com>
2022-06-18 12:39 ` Ioana Ciornei
2022-06-18 15:52 ` Sean Anderson
2022-06-20 18:53 ` Sean Anderson
2022-06-17 20:32 ` [PATCH net-next 04/28] net: fman: Convert to SPDX identifiers Sean Anderson
2022-06-17 20:32 ` [PATCH net-next 05/28] net: fman: Don't pass comm_mode to enable/disable Sean Anderson
2022-06-17 20:32 ` [PATCH net-next 06/28] net: fman: Store en/disable in mac_device instead of mac_priv_s Sean Anderson
2022-06-17 20:32 ` [PATCH net-next 07/28] net: fman: dtsec: Always gracefully stop/start Sean Anderson
2022-06-17 20:32 ` [PATCH net-next 08/28] net: fman: Get PCS node in per-mac init Sean Anderson
2022-06-17 20:32 ` [PATCH net-next 09/28] net: fman: Store initialization function in match data Sean Anderson
2022-06-17 20:32 ` [PATCH net-next 10/28] net: fman: Move struct dev to mac_device Sean Anderson
2022-06-18 3:57 ` kernel test robot
2022-06-17 20:32 ` [PATCH net-next 11/28] net: fman: Configure fixed link in memac_initialization Sean Anderson
2022-06-17 20:32 ` [PATCH net-next 12/28] net: fman: Export/rename some common functions Sean Anderson
2022-06-17 20:32 ` [PATCH net-next 13/28] net: fman: memac: Use params instead of priv for max_speed Sean Anderson
2022-06-17 20:32 ` [PATCH net-next 14/28] net: fman: Move initialization to mac-specific files Sean Anderson
2022-06-17 20:32 ` [PATCH net-next 15/28] net: fman: Mark mac methods static Sean Anderson
2022-06-17 20:33 ` [PATCH net-next 16/28] net: fman: Inline several functions into initialization Sean Anderson
2022-06-17 20:33 ` [PATCH net-next 17/28] net: fman: Remove internal_phy_node from params Sean Anderson
2022-06-17 20:33 ` [PATCH net-next 18/28] net: fman: Map the base address once Sean Anderson
2022-06-18 2:01 ` kernel test robot [this message]
2022-06-17 20:33 ` [PATCH net-next 19/28] net: fman: Pass params directly to mac init Sean Anderson
2022-06-17 20:33 ` [PATCH net-next 20/28] net: fman: Use mac_dev for some params Sean Anderson
2022-06-17 20:33 ` [PATCH net-next 21/28] net: fman: Clean up error handling Sean Anderson
2022-06-17 20:33 ` [PATCH net-next 22/28] net: fman: memac: Add serdes support Sean Anderson
2022-06-17 20:33 ` [PATCH net-next 23/28] net: fman: memac: Use lynx pcs driver Sean Anderson
2022-06-17 20:33 ` [PATCH net-next 24/28] net: dpaa: Use mac_dev variable in dpaa_netdev_init Sean Anderson
2022-06-17 20:33 ` [PATCH net-next 25/28] [RFC] net: dpaa: Convert to phylink Sean Anderson
2022-06-17 22:01 ` Russell King (Oracle)
2022-06-18 0:45 ` Sean Anderson
2022-06-18 8:22 ` Russell King (Oracle)
2022-06-18 15:58 ` Sean Anderson
2022-06-23 22:39 ` Sean Anderson
2022-06-24 0:24 ` Russell King (Oracle)
2022-06-27 15:17 ` Sean Anderson
2022-06-17 20:33 ` [PATCH net-next 26/28] arm64: dts: ls1046ardb: Add serdes bindings Sean Anderson
2022-06-17 20:33 ` [PATCH net-next 27/28] arm64: dts: ls1046a: Add SerDes bindings Sean Anderson
2022-06-17 20:33 ` [PATCH net-next 28/28] arm64: dts: ls1046a: Specify which MACs support RGMII Sean Anderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202206180959.mgYg6khw-lkp@intel.com \
--to=lkp@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kbuild-all@lists.01.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=madalin.bucur@nxp.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sean.anderson@seco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).